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
test: repair the three guards that went red on main
nirholasd38749620308
diff --git a/tests/forge-timeline.test.js b/tests/forge-timeline.test.jsindex 42e262287..388531890 100644--- a/tests/forge-timeline.test.js+++ b/tests/forge-timeline.test.js@@ -70,12 +70,27 @@ describe('forge timeline stages', () => {expect(stateOf('reference')).toBe('done');});- it('says the prompt was used verbatim when no rewrite comes back', () => {+ it('says the prompt was used verbatim when the director reports no rewrite', () => {timeline.begin({ mode: 'text', backend: 'trellis_selfhost', usesReference: true });- timeline.applySubmit({ status: 'queued', preview_image_url: 'https://cdn.example/ref.png' });+ // The KEY is present and null: the director ran and chose to leave the+ // prompt alone, which is a claim we can make about the user's words.+ timeline.applySubmit({+ status: 'queued',+ directed_prompt: null,+ preview_image_url: 'https://cdn.example/ref.png',+ });expect(labelOf('direct')).toBe('Prompt used as you wrote it');});+ it('claims nothing about the wording when the lane omits directed_prompt', () => {+ timeline.begin({ mode: 'text', backend: 'trellis_selfhost', usesReference: true });+ // No `directed_prompt` key at all (an older deployment). Silence is not a+ // report that the prompt survived unchanged, so the label must not say so.+ timeline.applySubmit({ status: 'queued', preview_image_url: 'https://cdn.example/ref.png' });+ expect(labelOf('direct')).toBe('Prompt handed to the painter');+ expect(stateOf('direct')).toBe('done');+ });+it('reveals a reference view that only arrives on a later poll', () => {timeline.begin({ mode: 'text', backend: 'trellis_selfhost', usesReference: true });// A coalesced job answers with a job id and nothing else.diff --git a/tests/thumbnail-url-guard.test.js b/tests/thumbnail-url-guard.test.jsindex 639a4867e..bb6a7075f 100644--- a/tests/thumbnail-url-guard.test.js+++ b/tests/thumbnail-url-guard.test.js@@ -120,6 +120,15 @@ describe('write paths confirm the object exists before persisting a key', () =>});it('forge-seed adopts only a relative preview_key', () => {- expect(read('api/cron/forge-seed-cron.js')).toMatch(/case when fc\.preview_key !~ '\^https\?:\/\/' then fc\.preview_key end/);+ const src = read('api/cron/forge-seed-cron.js');+ // Alias-agnostic on purpose: the preview row moved behind a subselect when+ // the rig stage landed (the rig creation has no preview of its own), and it+ // may move again. What must never move is the `!~ '^https?://'` filter.+ // An absolute URL in thumbnail_key resolves against an origin where no+ // object lives (api/_lib/avatar-thumbs.js).+ expect(src).toMatch(/case when \w+\.preview_key !~ '\^https\?:\/\/' then \w+\.preview_key end/);+ // And nothing adopts the column raw, which is the regression this guards.+ expect(src).not.toMatch(/then\s+\w+\.preview_key\s+end.*\|\|/);+ expect(src).not.toMatch(/thumbnail_key\s*=\s*\$\{?\w*preview/i);});});diff --git a/tests/x402-probe-challenge.test.js b/tests/x402-probe-challenge.test.jsindex b342a2d6d..30cb39fd1 100644--- a/tests/x402-probe-challenge.test.js+++ b/tests/x402-probe-challenge.test.js@@ -34,10 +34,22 @@ beforeAll(async () => {// first test's 15s budget. Charging the warm-up to the hook budget keeps each// test measuring the challenge contract, not the import graph. The responses// are deliberately ignored; the tests below re-assert them against warm code.- await Promise.all([- fetch(`${BASE}/api/x402/tutor`).catch(() => {}),- fetch(`${BASE}/api/v1/x/openai/chat`).catch(() => {}),- ]);+ // Every distinct handler below, not just the first two: each /api/x402/<name>+ // is its own module with its own lazy import graph, so warming `tutor` alone+ // left `cosmetic-purchase` and friends to pay their cold import inside a 15s+ // test budget and time out under full-suite load. The hook has 120s for this.+ await Promise.all(+ [+ '/api/x402/tutor',+ '/api/x402/asset-download',+ '/api/x402/skill-call',+ '/api/x402/cosmetic-purchase',+ '/api/x402/animation-download',+ '/api/x402/fact-check',+ '/api/v1/x/openai/chat',+ '/api/v1/x/coingecko/price',+ ].map((route) => fetch(`${BASE}${route}`).catch(() => {})),+ );}, 120_000);afterAll(() => {