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
fix(notifications): give the companion category its default channel row
nirholas9cc799405fee
diff --git a/api/_lib/notify-prefs.js b/api/_lib/notify-prefs.jsindex 47ada763f..51c86e144 100644--- a/api/_lib/notify-prefs.js+++ b/api/_lib/notify-prefs.js@@ -160,6 +160,10 @@ const DEFAULTS = {social: { in_app: true, push: true, email: false, telegram: false, avatar: false },irl: { in_app: true, push: true, email: false, telegram: false, avatar: false },alerts: { in_app: true, push: true, email: false, telegram: true, avatar: false },+ // The user's own inbox, calendar and phone, triaged by the companion. It is+ // their material, not ours, so it never leaves the site by email; the avatar+ // saying it out loud is the feature itself.+ companion: { in_app: true, push: true, email: false, telegram: false, avatar: true },// Only unattended completions notify (api/cron/forge-finalize.js), so email// defaulting on is the feature, not spam: the user left the page and asked// to hear back.diff --git a/tests/notify-prefs.test.js b/tests/notify-prefs.test.jsindex dea0b3b08..70467f364 100644--- a/tests/notify-prefs.test.js+++ b/tests/notify-prefs.test.js@@ -1,5 +1,5 @@// Unit tests for api/_lib/notify-prefs.js — the preference model that gates-// every notification channel (in-app / push / email / telegram).+// every notification channel (in-app / push / email / telegram / avatar).//// These are pure functions; resolvePrefs (the only DB-touching export) is not// exercised here. Importing the module is safe because api/_lib/db.js creates@@ -18,11 +18,11 @@ import {} from '../api/_lib/notify-prefs.js';describe('category model', () => {- it('exposes the seven display categories and four channels', () => {+ it('exposes the eight display categories and five channels', () => {expect(CATEGORIES.map((c) => c.key)).toEqual([- 'sales', 'purchases', 'social', 'irl', 'alerts', 'creations', 'account',+ 'sales', 'purchases', 'social', 'irl', 'alerts', 'creations', 'companion', 'account',]);- expect(CHANNELS).toEqual(['in_app', 'push', 'email', 'telegram']);+ expect(CHANNELS).toEqual(['in_app', 'push', 'email', 'telegram', 'avatar']);});it('every category has a label and description for the preference center', () => {@@ -90,6 +90,28 @@ describe('defaultMatrix / mergeWithDefaults', () => {expect(m.alerts.telegram).toBe(true);});+ // The avatar channel physically interrupts: the corner companion walks on+ // screen and speaks. It is on only where an interruption is welcome.+ it('avatar defaults on for money, finished creations, and account events', () => {+ const m = defaultMatrix();+ expect(m.sales.avatar).toBe(true);+ expect(m.creations.avatar).toBe(true);+ expect(m.account.avatar).toBe(true);+ expect(m.purchases.avatar).toBe(false);+ expect(m.social.avatar).toBe(false);+ expect(m.irl.avatar).toBe(false);+ expect(m.alerts.avatar).toBe(false);+ });++ it('every category carries a value for every channel', () => {+ const m = defaultMatrix();+ for (const c of CATEGORIES) {+ for (const ch of CHANNELS) {+ expect(typeof m[c.key][ch]).toBe('boolean');+ }+ }+ });+it('a fresh mutation of the default matrix does not leak across calls', () => {const a = defaultMatrix();a.sales.push = false;