Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
Post every commit on main to Telegram as it lands
nirholasfbfd145a8eb8
diff --git a/.env.example b/.env.exampleindex 8c00de1cd..b7b17fa50 100644--- a/.env.example+++ b/.env.example@@ -1419,6 +1419,13 @@ TELEGRAM_BOT_TOKEN=# the -100… numeric id; the bot above must be an admin of the channel.TELEGRAM_CHANGELOG_CHAT_ID=-1003927666373+# Telegram commit feed — /api/cron/commit-feed-push posts every new commit on+# `main` here as it lands (raw, one message per commit, no curation). Optional:+# falls back to TELEGRAM_CHANGELOG_CHAT_ID above when unset, so it works out of+# the box on the same channel. Set this to a separate chat id to keep the+# commit firehose out of the holder-facing changelog channel.+TELEGRAM_COMMITS_CHAT_ID=+# Telegram Oracle signals channel — prime/strong conviction coins posted here# by the oracle-score cron. Separate from ops alerts and the changelog channel.# Leave blank to disable. Set ORACLE_ALERT_MIN_TIER=prime to only post the top tier.diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f9bd52a20..bcdeb06c3 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -11,6 +11,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Audit any agent's trade decisions, linked from the write-ups** — The first-autonomous-trade postmortem, the Agent Sniper doc, and the sniper tutorial now link straight to the agent's live, tamper-evident Reasoning Ledger and to the on-chain transactions, so you can verify the +42% trade yourself instead of taking our word for it. The Reasoning Ledger is now a discoverable page, and its landing view features a live example to open first. (`/ledger/4c0e4d18-0544-4c95-a0db-a16896b029be`) `[improvement, docs]`- **Bonding curve progress reads correctly again in the MCP tools** — The agent tools that report a coin's bonding curve were showing every coin as 0% to graduation with zero reserves and a zero price. Pump renamed these on-chain fields when USDC became a possible trading pair, and the tools were still reading the old names, which quietly resolved to zero instead of failing. They now read the current fields, so graduation progress, reserves, and price reflect the real curve. Verified against live coins reading 2% through 70% to graduation. `[fix]`- **Closed a gap that could price a drained PumpSwap pool as the safest trade** — A PumpSwap pool that has run out of tradable depth could, in rare cases, be priced as a 0% price-impact trade instead of being refused, because the impact math never reports a negative number and a drained pool's reserves can go negative internally. That reading is deceptively attractive and would have slipped past both the sniper's safety breaker and the agent trade guard's max price-impact limit. Every path that can quote a swap, the agent trade API, the pump.fun MCP tool, and the in-browser quote helper, now refuses a pool with no real depth before it ever returns a price. (`/docs/mcp`) `[fix, security]`+- **Every commit to three.ws now posts live to Telegram** — Alongside the curated changelog digest, the holders' Telegram channel now gets a message the moment each commit lands on main: short SHA, author, and a link to the diff. It's a raw, unfiltered build log instead of a periodic summary, for anyone who wants to watch the platform get built in real time. `[feature, infra]`- **Every page on three.ws now reads in 48 languages** — Translation used to cover only part of the site, so following a link out of a translated page often dropped you back into English. Every page is now translatable, from the studios and docs down to the news archive, and the existing languages were backfilled so they cover all of it rather than the handful of pages they started on. Eight more languages join the switcher as well: Gujarati, Kannada, Malayalam, Assamese, Nepali, Kazakh, Uzbek and Azerbaijani. A language only appears in the switcher once its wording is complete, so you should never land on a page that is half translated. (`/docs/i18n`) `[improvement]`- **Every three.ws MCP server now resolves to its current version** — The MCP servers three.ws publishes are listed in the public Model Context Protocol registry, which is how most AI assistants discover them. Those listings had fallen behind what was actually released, so an assistant adding one could pin a months-old build and miss tools that already shipped. All 44 listings now match their released versions, and one server that had never appeared at all is listed for the first time. Adding a three.ws server to Claude, or any MCP-capable assistant, gets you the current tools. `[sdk, fix]`- **Graduated-coin prices now match PumpSwap exactly** — PumpSwap changed how pool prices are calculated: a pool can now hold quote-side liquidity that is not sitting in its vault, and prices have to count it. Every place we price a graduated coin has been updated to match, so quotes, price impact, market caps, and agent trade fills line up with what actually executes on-chain. Coins that have not graduated are unaffected, and the change is exact rather than approximate: where a pool carries none of this liquidity, prices are identical to before. `[fix, infra]`diff --git a/api/_lib/commit-feed-push.js b/api/_lib/commit-feed-push.jsnew file mode 100644index 000000000..1a9275c4c--- /dev/null+++ b/api/_lib/commit-feed-push.js@@ -0,0 +1,149 @@+// @ts-check+// Automatic commit-feed delivery to Telegram: every commit that lands on+// `main` gets its own message, independent of (and much noisier than) the+// curated holder changelog in changelog-push.js. Driven by+// /api/cron/commit-feed-push on Cloud Scheduler.+//+// State (app_settings key `commit_feed_push_telegram`):+// { lastSha: string|null }+// The cron walks GitHub's commit list for `main`, finds lastSha, and posts+// everything newer, oldest-first, so message order matches commit order.+// On first run (no state yet) it seeds lastSha from the newest commit+// without posting anything, so deploying this feature never dumps repo+// history into the channel.++import { sql } from './db.js';++const REPO = 'nirholas/three.ws';+const TELEGRAM_LIMIT = 15; // per run; Bot API allows ~20 msg/min per chat+const TELEGRAM_PACE_MS = 3500;+const LOCK_KEY = 'commit_feed_push_lock';+const LOCK_TTL_S = 240;+const STATE_KEY = 'commit_feed_push_telegram';++async function ensureTable() {+ await sql`+ CREATE TABLE IF NOT EXISTS app_settings (+ key text PRIMARY KEY,+ value jsonb NOT NULL,+ updated_at timestamptz NOT NULL DEFAULT now()+ )+ `;+}++async function getState(key) {+ const [row] = await sql`SELECT value FROM app_settings WHERE key = ${key}`;+ return row?.value ?? null;+}++async function setState(key, value) {+ await sql`+ INSERT INTO app_settings (key, value) VALUES (${key}, ${JSON.stringify(value)}::jsonb)+ ON CONFLICT (key) DO UPDATE SET value = excluded.value, updated_at = now()+ `;+}++export async function acquireLock() {+ await ensureTable();+ const rows = await sql`+ INSERT INTO app_settings (key, value)+ VALUES (${LOCK_KEY}, jsonb_build_object('until', extract(epoch from now()) + ${LOCK_TTL_S}))+ ON CONFLICT (key) DO UPDATE+ SET value = excluded.value, updated_at = now()+ WHERE (app_settings.value->>'until')::numeric < extract(epoch from now())+ RETURNING key+ `;+ return rows.length > 0;+}++export async function releaseLock() {+ await setState(LOCK_KEY, { until: 0 });+}++const sleep = (ms) => new Promise((r) => setTimeout(r, ms));++async function fetchRecentCommits() {+ const headers = { accept: 'application/vnd.github+json', 'user-agent': 'three.ws-commit-feed' };+ const token = process.env.GITHUB_TOKEN || process.env.GH_TOKEN || '';+ if (token) headers.authorization = `Bearer ${token}`;+ const res = await fetch(`https://api.github.com/repos/${REPO}/commits?sha=main&per_page=30`, { headers });+ if (!res.ok) throw new Error(`GitHub commits fetch failed (${res.status})`);+ return res.json();+}++// Returns commits newer than `lastSha`, oldest-first. If lastSha is absent+// from the fetched page (unset, or more than 30 commits stale), returns []+// and lets the caller reseed from the newest commit instead of flooding the+// channel with backlog.+function newCommitsSince(commits, lastSha) {+ if (!lastSha) return { commits: [], reseed: true };+ const idx = commits.findIndex((c) => c.sha === lastSha);+ if (idx === -1) return { commits: [], reseed: true };+ return { commits: commits.slice(0, idx).reverse(), reseed: false };+}++const escapeHtml = (s) =>+ String(s).replace(/[<>&]/g, (c) => ({ '<': '<', '>': '>', '&': '&' })[c]);++export function formatTelegramMessage(commit) {+ const shortSha = commit.sha.slice(0, 7);+ const subject = (commit.commit?.message || '').split('\n')[0];+ const author = commit.author?.login || commit.commit?.author?.name || 'unknown';+ const url = commit.html_url || `https://github.com/${REPO}/commit/${commit.sha}`;+ return [+ `<code>${escapeHtml(shortSha)}</code> ${escapeHtml(subject)}`,+ `${escapeHtml(author)} · <a href="${url}">view</a>`,+ ].join('\n');+}++async function sendTelegram(botToken, chatId, text) {+ const res = await fetch(`https://api.telegram.org/bot${botToken}/sendMessage`, {+ method: 'POST',+ headers: { 'content-type': 'application/json' },+ body: JSON.stringify({+ chat_id: chatId,+ text,+ parse_mode: 'HTML',+ link_preview_options: { is_disabled: true },+ }),+ });+ const body = await res.json().catch(() => ({}));+ if (!res.ok || !body.ok) {+ throw new Error(`Telegram sendMessage failed (${res.status}): ${body.description || 'unknown error'}`);+ }+}++export async function pushTelegramLane() {+ const botToken = process.env.TELEGRAM_BOT_TOKEN;+ const chatId = process.env.TELEGRAM_COMMITS_CHAT_ID || process.env.TELEGRAM_CHANGELOG_CHAT_ID;+ if (!botToken || !chatId) return { skipped: 'not_configured' };++ const state = (await getState(STATE_KEY)) || { lastSha: null };+ const commits = await fetchRecentCommits();+ if (commits.length === 0) return { posted: 0 };++ const { commits: pending, reseed } = newCommitsSince(commits, state.lastSha);+ if (reseed) {+ await setState(STATE_KEY, { lastSha: commits[0].sha });+ return { posted: 0, seeded: true };+ }+ if (pending.length === 0) return { posted: 0 };++ const capped = pending.slice(-TELEGRAM_LIMIT);+ const dropped = pending.length - capped.length;++ let sent = 0;+ let lastSha = state.lastSha;+ try {+ for (const commit of capped) {+ await sendTelegram(botToken, chatId, formatTelegramMessage(commit));+ lastSha = commit.sha;+ sent++;+ await setState(STATE_KEY, { lastSha });+ await sleep(TELEGRAM_PACE_MS);+ }+ } catch (err) {+ return { posted: sent, dropped, error: String(err?.message || err) };+ }+ return { posted: sent, dropped };+}diff --git a/api/cron/commit-feed-push.js b/api/cron/commit-feed-push.jsnew file mode 100644index 000000000..89a362a5e--- /dev/null+++ b/api/cron/commit-feed-push.js@@ -0,0 +1,57 @@+// @ts-check+// GET /api/cron/commit-feed-push — posts every new commit on `main` to+// Telegram as it lands, independent of the curated changelog cron+// (changelog-push.js only ships holder-readable, deploy-gated entries).+//+// Runs every 5 minutes. Reads the commit list from the GitHub REST API,+// diffs it against the last-posted SHA in app_settings, and posts anything+// newer, oldest-first, one message per commit.+//+// Destination: TELEGRAM_COMMITS_CHAT_ID if set, else TELEGRAM_CHANGELOG_CHAT_ID+// (the existing @three_ws channel) so this works out of the box on the same+// bot. Point TELEGRAM_COMMITS_CHAT_ID at a separate chat to split dev/commit+// noise out of the holder-facing channel.+//+// A lane whose credentials are absent reports { skipped: 'not_configured' }.+// Telegram: TELEGRAM_BOT_TOKEN + (TELEGRAM_COMMITS_CHAT_ID or TELEGRAM_CHANGELOG_CHAT_ID)+//+// A DB lock (app_settings) keeps overlapping ticks from double-posting.++import { error, json, method, wrapCron } from '../_lib/http.js';+import { env } from '../_lib/env.js';+import { constantTimeEquals } from '../_lib/crypto.js';+import { acquireLock, releaseLock, pushTelegramLane } from '../_lib/commit-feed-push.js';++function requireCron(req, res) {+ const secret = process.env.CRON_SECRET || env.CRON_SECRET;+ if (!secret) {+ error(res, 503, 'not_configured', 'CRON_SECRET unset');+ return false;+ }+ const auth = req.headers['authorization'] || '';+ const presented = auth.startsWith('Bearer ') ? auth.slice(7) : '';+ if (!constantTimeEquals(presented, secret)) {+ error(res, 401, 'unauthorized', 'invalid cron secret');+ return false;+ }+ return true;+}++export default wrapCron(async (req, res) => {+ if (!method(req, res, ['GET'])) return;+ if (!requireCron(req, res)) return;++ if (!(await acquireLock())) {+ json(res, 200, { ok: true, skipped: 'locked' });+ return;+ }++ try {+ const telegram = await pushTelegramLane();+ const failed = Boolean(telegram.error);+ if (failed) console.warn('[cron] commit-feed-push lane error', { telegram });+ json(res, failed ? 502 : 200, { ok: !failed, telegram });+ } finally {+ await releaseLock().catch(() => {});+ }+});diff --git a/data/changelog.json b/data/changelog.jsonindex 97cf03a4e..f47059cb5 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -15148,6 +15148,15 @@"feature"],"link": "/pose"+ },+ {+ "date": "2026-07-20",+ "title": "Every commit to three.ws now posts live to Telegram",+ "summary": "Alongside the curated changelog digest, the holders' Telegram channel now gets a message the moment each commit lands on main: short SHA, author, and a link to the diff. It's a raw, unfiltered build log instead of a periodic summary, for anyone who wants to watch the platform get built in real time.",+ "tags": [+ "feature",+ "infra"+ ]}]}diff --git a/public/changelog.json b/public/changelog.jsonindex ee6f37b64..1f08b5150 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-20T22:00:55.168Z",+ "generated_at": "2026-07-20T22:19:37.888Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -58,6 +58,17 @@"security"]},+ {+ "date": "2026-07-20",+ "type": "update",+ "title": "Every commit to three.ws now posts live to Telegram",+ "summary": "Alongside the curated changelog digest, the holders' Telegram channel now gets a message the moment each commit lands on main: short SHA, author, and a link to the diff. It's a raw, unfiltered build log instead of a periodic summary, for anyone who wants to watch the platform get built in real time.",+ "link": null,+ "tags": [+ "feature",+ "infra"+ ]+ },{"date": "2026-07-20","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 7f70a000c..b6c8766d3 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -46,6 +46,14 @@<category>fix</category><description>A PumpSwap pool that has run out of tradable depth could, in rare cases, be priced as a 0% price-impact trade instead of being refused, because the impact math never reports a negative number and a drained pool's reserves can go negative internally. That reading is deceptively attractive and would have slipped past both the sniper's safety breaker and the agent trade guard's max price-impact limit. Every path that can quote a swap, the agent trade API, the pump.fun MCP tool, and the in-browser quote helper, now refuses a pool with no real depth before it ever returns a price.</description></item>+ <item>+ <title>Every commit to three.ws now posts live to Telegram</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-07-20:Every commit to three.ws now posts live to Telegram</guid>+ <pubDate>Mon, 20 Jul 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Alongside the curated changelog digest, the holders' Telegram channel now gets a message the moment each commit lands on main: short SHA, author, and a link to the diff. It's a raw, unfiltered build log instead of a periodic summary, for anyone who wants to watch the platform get built in real time.</description>+ </item><item><title>Every page on three.ws now reads in 48 languages</title><link>https://three.ws/docs/i18n</link>diff --git a/public/features.json b/public/features.jsonindex 1599b458b..037f2c592 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-20T22:00:55.153Z",+ "generated_at": "2026-07-20T22:19:37.875Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/vercel.json b/vercel.jsonindex 049f131c2..83291f08a 100644--- a/vercel.json+++ b/vercel.json@@ -5499,6 +5499,10 @@"path": "/api/cron/changelog-push","schedule": "*/20 * * * *"},+ {+ "path": "/api/cron/commit-feed-push",+ "schedule": "*/5 * * * *"+ },{"path": "/api/cron/forge-off-crown","schedule": "7 0 * * 1"