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
feat(changelog): finish automatic holder-channel delivery
nirholas28bb747bff69
diff --git a/CLAUDE.md b/CLAUDE.mdindex 110f49e22..d8db75293 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -185,7 +185,7 @@ $THREE holders follow the public changelog (three.ws/changelog, RSS, JSON, Teleg- **New page?** Nothing extra — the `added` date in `data/pages.json` feeds the changelog automatically.- **Everything else users would notice** (feature, improvement, fix, SDK release, security work): append an entry to `data/changelog.json` — date, holder-readable title + summary (plain language, no commit jargon), tags from: feature, improvement, fix, sdk, infra, docs, security. Optional `link` must be a live page path.- `npm run build:pages` regenerates CHANGELOG.md, public/changelog.json, and public/changelog.xml — it also validates your entry and fails the build on a malformed one.-- After the change is deployed, `npm run changelog:push` posts new entries to the holders' Telegram channel (needs `TELEGRAM_BOT_TOKEN` + `TELEGRAM_CHANGELOG_CHAT_ID`; use `--dry-run` to preview), and `npm run changelog:push:x` posts them from @trythreews as replies chained under the pinned updates thread — one anchor post on the profile, each release a reply to the previous one (needs `X_API_KEY`/`X_API_SECRET`/`X_ACCESS_TOKEN`/`X_ACCESS_SECRET`; same `--dry-run` flag; thread ids live in `data/changelog-x-state.json`, commit it after a push). X is the primary holder channel. Skip silently if creds are absent locally.+- **Delivery to holders is automatic.** `/api/cron/changelog-push` (Cloud Scheduler, every 20 min) reads the feed baked into the running image, diffs it against DB state (`app_settings`), and posts anything new to the holders' Telegram channel (@three_ws) and the @trythreews X release thread. An entry goes out on its own shortly after the deploy that ships it; there is no manual push step. Credentials live on the Cloud Run service. Do NOT run `npm run changelog:push` / `changelog:push:x` for routine releases anymore: their file-based state (`data/changelog-*-state.json`) is separate from the cron's DB state, so a manual push double-posts. The scripts remain for `--dry-run` previews and owner-directed backfills only.- Internal-only chores (CI, lockfiles, refactors with no visible effect) do NOT get entries.## Documentation: every feature ships with its docsdiff --git a/api/_lib/changelog-push.js b/api/_lib/changelog-push.jsindex ae1d8fb19..b18d1e6d7 100644--- a/api/_lib/changelog-push.js+++ b/api/_lib/changelog-push.js@@ -109,7 +109,7 @@ function cutoffDate() {return new Date(Date.now() - CUTOFF_DAYS * 86400000).toISOString().slice(0, 10);}-function pendingEntries(feed, posted, limit, { newestWin = false } = {}) {+export function pendingEntries(feed, posted, limit, { newestWin = false } = {}) {const cutoff = cutoffDate();const unposted = feed.entries.filter((e) => !posted.has(entryKey(e)) && e.date >= cutoff && e.type !== 'launch')@@ -128,7 +128,7 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));const escapeHtml = (s) =>String(s).replace(/[<>&]/g, (c) => ({ '<': '<', '>': '>', '&': '&' })[c]);-function formatTelegramMessage(e) {+export function formatTelegramMessage(e) {const detailUrl = `https://three.ws/changelog/${slugify(e.title, e.date)}`;const label = e.type === 'launch' ? 'New on three.ws' : 'Update';const hashtags = (e.type === 'launch' ? ['launch'] : e.tags).map((t) => `#${t}`).join(' ');@@ -196,9 +196,9 @@ export async function pushTelegramLane(feed) {// codepoint as 2. Compose title + summary + link within the 280 budget,// trimming the summary on a word boundary when it overflows.const URL_WEIGHT = 23;-const weightedLength = (s) => [...s].reduce((n, ch) => n + (ch.codePointAt(0) > 0xffff ? 2 : 1), 0);+export const weightedLength = (s) => [...s].reduce((n, ch) => n + (ch.codePointAt(0) > 0xffff ? 2 : 1), 0);-function formatTweet(e) {+export function formatTweet(e) {const detailUrl = `https://three.ws/changelog/${slugify(e.title, e.date)}`;const suffix = `\n\n${detailUrl}`;const suffixWeight = 2 + URL_WEIGHT;diff --git a/data/changelog.json b/data/changelog.jsonindex e8234d834..b5766e065 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,16 @@{"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-07-16",+ "title": "Changelog updates now reach Telegram and X on their own",+ "summary": "Every entry in this changelog is now delivered to the holder channels automatically. Once the release an entry describes is live in production, an autonomous job spots it and posts it to the holders' Telegram channel (@three_ws) and to the running release thread on X (@trythreews), usually within 20 minutes. No human has to remember to announce anything, and nothing is ever announced before it is actually live. The full history stays at three.ws/changelog and in the RSS and JSON feeds as always.",+ "tags": [+ "infra",+ "improvement"+ ],+ "link": "/changelog"+ },{"date": "2026-07-16","title": "Leave the page while your 3D model generates. We'll finish it and let you know",diff --git a/docs/agora/tasks/11-production-hardening.md b/docs/agora/tasks/11-production-hardening.mdindex 5c28e0a93..ee929d0c9 100644--- a/docs/agora/tasks/11-production-hardening.md+++ b/docs/agora/tasks/11-production-hardening.md@@ -48,8 +48,8 @@ until every box here is true.7. **Docs + changelog + index.** Update `docs/agora.md` roadmap checkboxes toreflect reality; mark task status in `00-INDEX.md`; ensure `data/pages.json`has `/agora`; add the launch `data/changelog.json` entry (feature) and run- `npm run build:pages` (it validates the entry). After deploy,- `npm run changelog:push` (if creds present).+ `npm run build:pages` (it validates the entry). Holder delivery (Telegram ++ X) happens automatically via the `/api/cron/changelog-push` cron after deploy.8. **Final self-review.** Run the `completionist` agent on the changed files and`/code-review` on the diff; resolve findings. Then the CLAUDE.md pride check.diff --git a/prompts/okx-ai/RUNBOOK.md b/prompts/okx-ai/RUNBOOK.mdindex fe12e113b..41b414415 100644--- a/prompts/okx-ai/RUNBOOK.md+++ b/prompts/okx-ai/RUNBOOK.md@@ -128,10 +128,10 @@ This is the holder-visible moment. Work the list top to bottom.with tag `feature`, in plain holder-readable language, then:```bashnpm run build:pages # validates the entry; fails the build if malformed- npm run changelog:push # Telegram (needs TELEGRAM_BOT_TOKEN + TELEGRAM_CHANGELOG_CHAT_ID)- npm run changelog:push:x # X / @trythreews — the primary holder channel```- Both push scripts accept `--dry-run`. They skip silently when credentials are absent.+ Delivery to Telegram (@three_ws) and X (@trythreews) is automatic: the+ `/api/cron/changelog-push` cron posts the entry once the deploy that ships+ it is live. No manual push step.4. **Set the agent's own avatar live** if WO-06's dogfood upload was deferred (it was — theasset is generated but never written on-chain). This is an on-chain write: OTP required.diff --git a/scripts/changelog-telegram.mjs b/scripts/changelog-telegram.mjsindex a8d5bd8f1..6cf6605bf 100644--- a/scripts/changelog-telegram.mjs+++ b/scripts/changelog-telegram.mjs@@ -1,6 +1,12 @@#!/usr/bin/env node// Push new changelog entries to the $THREE holders Telegram channel.//+// NOTE: routine delivery is AUTOMATIC now: /api/cron/changelog-push (Cloud+// Scheduler) posts new entries after every deploy, with its own DB state.+// This script's file state is separate, so a manual push here can double-post+// what the cron also sees. Use it for --dry-run previews and owner-directed+// backfills only (see api/_lib/changelog-push.js).+//// Reads the generated feed (public/changelog.json — run `npm run build:pages`// first if it's stale), diffs it against data/changelog-telegram-state.json,// and posts each unposted entry to Telegram via the Bot API. Successfullydiff --git a/scripts/changelog-x.mjs b/scripts/changelog-x.mjsindex f91248361..a396f2074 100644--- a/scripts/changelog-x.mjs+++ b/scripts/changelog-x.mjs@@ -2,6 +2,12 @@// Push new changelog entries to the @trythreews X (Twitter) account as one// continuous thread.//+// NOTE: routine delivery is AUTOMATIC now: /api/cron/changelog-push (Cloud+// Scheduler) posts new entries after every deploy, with its own DB state+// (including the thread ids). This script's file state is separate, so a+// manual push here can double-post or fork the thread. Use it for --dry-run+// previews and owner-directed backfills only (see api/_lib/changelog-push.js).+//// Instead of bloating the profile feed with a standalone tweet per release,// the account keeps a single anchor post ("everything we ship lands in this// thread") and every changelog entry is posted as a reply chained to thediff --git a/tests/changelog-push.test.js b/tests/changelog-push.test.jsnew file mode 100644index 000000000..50a61da5d--- /dev/null+++ b/tests/changelog-push.test.js@@ -0,0 +1,99 @@+import { describe, it, expect } from 'vitest';+import {+ entryKey,+ pendingEntries,+ formatTelegramMessage,+ formatTweet,+ weightedLength,+ pushTelegramLane,+ pushXLane,+} from '../api/_lib/changelog-push.js';++const day = (offset) => new Date(Date.now() + offset * 86400000).toISOString().slice(0, 10);++const entry = (over = {}) => ({+ date: day(0),+ title: 'A test release',+ summary: 'Something shipped.',+ tags: ['feature'],+ ...over,+});++describe('entryKey', () => {+ it('is date:title', () => {+ expect(entryKey({ date: '2026-07-16', title: 'X' })).toBe('2026-07-16:X');+ });+});++describe('pendingEntries', () => {+ it('filters posted, launches, and entries older than the cutoff', () => {+ const feed = {+ entries: [+ entry({ title: 'fresh' }),+ entry({ title: 'already posted' }),+ entry({ title: 'a launch', type: 'launch' }),+ entry({ title: 'ancient', date: day(-30) }),+ ],+ };+ const posted = new Set([`${day(0)}:already posted`]);+ const { pending, backlog } = pendingEntries(feed, posted, 10);+ expect(pending.map((e) => e.title)).toEqual(['fresh']);+ expect(backlog).toBe(1);+ });++ it('sorts chronologically and slices oldest-first by default, newest-first with newestWin', () => {+ const feed = {+ entries: [+ entry({ title: 'today', date: day(0) }),+ entry({ title: 'yesterday', date: day(-1) }),+ entry({ title: 'two days ago', date: day(-2) }),+ ],+ };+ const none = new Set();+ expect(pendingEntries(feed, none, 2).pending.map((e) => e.title)).toEqual(['two days ago', 'yesterday']);+ expect(pendingEntries(feed, none, 2, { newestWin: true }).pending.map((e) => e.title)).toEqual(['yesterday', 'today']);+ });+});++describe('formatTelegramMessage', () => {+ it('escapes HTML and carries the detail link, date, and hashtags', () => {+ const msg = formatTelegramMessage(entry({ title: 'A <b>bold</b> & brave release', tags: ['fix', 'infra'] }));+ expect(msg).toContain('A <b>bold</b> & brave release');+ expect(msg).toContain(`https://three.ws/changelog/${day(0)}-a-b-bold-b-brave-release`);+ expect(msg).toContain('#fix #infra');+ expect(msg).toContain(day(0));+ });+});++describe('formatTweet', () => {+ it('keeps a short entry intact and appends the detail URL', () => {+ const t = formatTweet(entry());+ expect(t).toContain('A test release');+ expect(t).toContain('Something shipped.');+ expect(t).toMatch(/https:\/\/three\.ws\/changelog\/\S+$/);+ });++ it('trims a long summary to the 280 weighted-char budget on a word boundary', () => {+ const t = formatTweet(entry({ summary: 'word '.repeat(200).trim() }));+ // Weigh the t.co-wrapped URL at 23 like X does.+ const weighted = weightedLength(t.replace(/https:\/\/\S+$/, 'x'.repeat(23)));+ expect(weighted).toBeLessThanOrEqual(280);+ expect(t).toContain('…');+ });+});++describe('lanes without credentials', () => {+ it('report not_configured without touching network or db', async () => {+ const saved = {};+ for (const k of ['TELEGRAM_BOT_TOKEN', 'TELEGRAM_CHANGELOG_CHAT_ID', 'X_API_KEY', 'X_API_SECRET', 'X_ACCESS_TOKEN', 'X_ACCESS_SECRET']) {+ saved[k] = process.env[k];+ delete process.env[k];+ }+ try {+ expect(await pushTelegramLane({ entries: [entry()] })).toEqual({ skipped: 'not_configured' });+ expect(await pushXLane({ entries: [entry()] })).toEqual({ skipped: 'not_configured' });+ } finally {+ for (const [k, v] of Object.entries(saved)) if (v !== undefined) process.env[k] = v;+ }+ });+});