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: add skill listings and asset blurbs for circulation agents
udvk0227fd570708
diff --git a/api/_lib/circulation-personas.js b/api/_lib/circulation-personas.jsindex 1d665cb9b..cca718e86 100644--- a/api/_lib/circulation-personas.js+++ b/api/_lib/circulation-personas.js@@ -227,6 +227,41 @@ export const OWNER_FIRST_NAMES = ['arman', 'priya', 'cole', 'mika', 'sasha', 'remy', 'tariq', 'wren', 'zane', 'asha',];+// Skills a circulation agent lists for sale on its marketplace profile, grouped by+// the agent's category so the listing reads coherently (a programming agent sells+// code skills, a design agent sells design skills). Each becomes a real+// agent_skill_prices row priced in $THREE; some are flagged trial-eligible so the+// engine can exercise the free-trial path too. Plain skill names — no coin but+// $THREE is ever referenced.+export const SKILL_LISTINGS = {+ programming: ['code-review', 'refactor-pass', 'bug-hunt', 'test-scaffold', 'api-design', 'perf-audit'],+ marketing: ['launch-plan', 'landing-copy', 'growth-teardown', 'positioning-brief', 'ad-variants'],+ design: ['ui-critique', 'brand-system', 'wireframe-pass', 'design-token-audit', 'icon-set'],+ general: ['research-brief', 'source-synthesis', 'fact-pass', 'summary-digest', 'decision-memo'],+ copywriting: ['line-edit', 'story-pass', 'voice-tune', 'headline-set', 'newsletter-draft'],+ entertainment: ['game-loop', 'world-lore', 'pitch-deck', 'hook-pass', 'quest-design'],+ education: ['lesson-plan', 'concept-explainer', 'study-guide', 'quiz-set', 'curriculum-map'],+ career: ['resume-rewrite', 'mock-interview', 'cover-letter', 'offer-strategy', 'linkedin-pass'],+ office: ['process-map', 'doc-template', 'automation-spec', 'meeting-digest', 'sop-draft'],+ games: ['mechanic-review', 'balance-pass', 'level-brief', 'economy-design', 'playtest-notes'],+ emotions: ['reflection-prompt', 'journaling-set', 'reframe-pass', 'check-in-script'],+ academic: ['derivation-check', 'model-review', 'proof-pass', 'data-audit', 'methods-brief'],+ life: ['trip-plan', 'habit-system', 'move-checklist', 'week-plan', 'budget-pass'],+ translation: ['localize-pass', 'tone-match', 'idiom-check', 'subtitle-pass'],+};++// Short blurbs attached when an agent lists its 3D avatar as a purchasable asset.+export const ASSET_BLURBS = [+ 'A clean, animation-ready avatar — rigged and drop-in for any scene.',+ 'Stylized humanoid with a readable silhouette and PBR materials.',+ 'Game-ready body, retopologized and skinned, ready to walk.',+ 'Expressive face rig with blendshapes — good for talking-head scenes.',+ 'Minimal, modern character built to read at a glance.',+];++// Fallback skill names for any category not explicitly mapped above.+export const GENERIC_SKILLS = ['research-brief', 'summary-digest', 'quick-consult', 'work-pass'];+export function pick(arr) {return arr[Math.floor(Math.random() * arr.length)];}diff --git a/api/_lib/circulation.js b/api/_lib/circulation.jsindex f16b65c70..5b9f4f04c 100644--- a/api/_lib/circulation.js+++ b/api/_lib/circulation.js@@ -32,12 +32,18 @@ import { solUsdPrice } from './avatar-wallet.js';import { CHAIN_BY_ID } from './erc8004-chains.js';import { publicUrl as r2PublicUrl } from './r2.js';import { pinToIPFS } from './ipfs-pin.js';+import { confirmSkillPurchase, resolvePayoutAddress } from './purchase-confirm.js';+import { submitProtected } from './execution-engine.js';+import { insertNotification } from './notify.js';import {PERSONAS,COIN_THEMES,PAYMENT_SERVICES,REVIEW_LINES,OWNER_FIRST_NAMES,+ SKILL_LISTINGS,+ ASSET_BLURBS,+ GENERIC_SKILLS,pick,pickTwo,} from './circulation-personas.js';@@ -56,6 +62,22 @@ const PAY_MAX = Math.floor(0.01 * SOL);const THREE_MINT = () => env.THREE_TOKEN_MINT || 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';+// Marketplace economics. Listings are priced in whole $THREE; buyers acquire $THREE+// through the same real trade engine before paying, so the only funding rail is the+// SOL treasury. Prices are deliberately small — a believable marketplace heartbeat,+// not volume for its own sake.+const THREE_DECIMALS = 6;+const SKILL_PRICE_MIN_THREE = 80; // whole $THREE+const SKILL_PRICE_MAX_THREE = 1200;+const ASSET_PRICE_MIN_THREE = 600;+const ASSET_PRICE_MAX_THREE = 4000;+const THREE_TOPUP_SOL = 0.012; // SOL spent to buy $THREE when a buyer is short+const SKILLS_PER_SELLER = 3; // how many skills a seller lists before it's "stocked"++function threeAtomic(whole) {+ return BigInt(Math.round(whole)) * 10n ** BigInt(THREE_DECIMALS);+}+function clampInt(v, dflt, lo, hi) {const n = Number.parseInt(String(v ?? ''), 10);if (!Number.isFinite(n)) return dflt;diff --git a/vite.config.js b/vite.config.jsindex b9430087e..c56b6e3ce 100644--- a/vite.config.js+++ b/vite.config.js@@ -2203,7 +2203,19 @@ support: resolve(__dirname, 'pages/support.html'),// always return the current page from Vercel's edge — no stale HTML// and no offline.html served to online users.navigateFallback: null,- globPatterns: ['**/*.{js,css,ico,woff2}'],+ // Precache ONLY stable, rarely-renamed assets (icons + fonts).+ // JS/CSS are intentionally excluded from the precache manifest and+ // served via runtime StaleWhileRevalidate instead (see runtimeCaching+ // below). Reason: every JS/CSS chunk is content-hashed and Vercel's+ // production alias only serves the *latest* deployment's assets. When+ // a new deploy lands while a user still holds an older page/SW — or+ // while a fresh SW is mid-install — the precache manifest references+ // chunks (e.g. assets/stage-<hash>.js) that now 404. Workbox treats a+ // single 404 as fatal `bad-precaching-response` and aborts the ENTIRE+ // SW install, leaving the user with no SW at all. Runtime caching makes+ // a 404 non-fatal: it's just a missed fetch the page's own dynamic+ // import handles, and autoUpdate still rolls the new SW forward.+ globPatterns: ['**/*.{ico,woff2}'],globIgnores: ['pages/**','**/animations/**',@@ -2237,6 +2249,29 @@ support: resolve(__dirname, 'pages/support.html'),urlPattern: /^https?:\/\/[^/]+\/api\/widgets\//i,handler: 'NetworkOnly',},+ // Same-origin scripts & styles. Not precached (see globPatterns+ // note above) — cached opportunistically at runtime so repeat+ // visits stay fast without the deploy-skew fragility of+ // precaching every hashed chunk. StaleWhileRevalidate serves the+ // cached chunk instantly and refreshes it in the background; a+ // 404 during a deploy rollover is a non-fatal background miss,+ // never a broken SW install. Placed after the /widget, /embed,+ // and /api/widgets NetworkOnly rules so those keep precedence.+ {+ urlPattern: ({ request, sameOrigin }) =>+ sameOrigin &&+ (request.destination === 'script' ||+ request.destination === 'style'),+ handler: 'StaleWhileRevalidate',+ options: {+ cacheName: 'app-assets',+ expiration: {+ maxEntries: 200,+ maxAgeSeconds: 60 * 60 * 24 * 30,+ },+ cacheableResponse: { statuses: [200] },+ },+ },{urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,handler: 'CacheFirst',