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(mixamo): implement sharding for parallel downloads and progress tracking
fudjia788c924e8410
diff --git a/package-lock.json b/package-lock.jsonindex d55a6f7c1..d6e6c9632 100644--- a/package-lock.json+++ b/package-lock.json@@ -409,7 +409,7 @@},"agent-ui-sdk": {"name": "@three-ws/agent-ui",- "version": "0.2.0",+ "version": "0.2.1","license": "Apache-2.0","engines": {"node": ">=18"@@ -420,7 +420,7 @@},"avatar-sdk": {"name": "@three-ws/avatar",- "version": "0.2.0",+ "version": "0.2.1","license": "Apache-2.0","engines": {"node": ">=18"@@ -1138,7 +1138,7 @@},"mcp-bridge": {"name": "@three-ws/mcp-bridge",- "version": "1.0.0",+ "version": "1.0.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -1207,7 +1207,7 @@},"mcp-server": {"name": "@three-ws/mcp-server",- "version": "1.2.0",+ "version": "1.2.1","license": "Apache-2.0","dependencies": {"@bonfida/spl-name-service": "0.1.67",@@ -51272,7 +51272,7 @@},"packages/activity-mcp": {"name": "@three-ws/activity-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51287,7 +51287,7 @@},"packages/agenc-mcp": {"name": "@three-ws/agenc-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51302,7 +51302,7 @@},"packages/agent-sniper": {"name": "@three-ws/agent-sniper",- "version": "0.1.0",+ "version": "0.1.1","license": "MIT","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51379,7 +51379,7 @@},"packages/agentcore-payments-mcp": {"name": "@three-ws/agentcore-payments-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51394,7 +51394,7 @@},"packages/agora-mcp": {"name": "@three-ws/agora-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51412,7 +51412,7 @@},"packages/alerts-mcp": {"name": "@three-ws/alerts-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51427,7 +51427,7 @@},"packages/alibaba-cloud-mcp": {"name": "@three-ws/alibaba-cloud-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0"@@ -51441,7 +51441,7 @@},"packages/audio-mcp": {"name": "@three-ws/audio-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51471,7 +51471,7 @@},"packages/avatar-agent-mcp": {"name": "@three-ws/avatar-agent",- "version": "1.2.0",+ "version": "1.2.1","license": "Apache-2.0","dependencies": {"@gltf-transform/core": "^4.3.0",@@ -51526,7 +51526,7 @@},"packages/billing-mcp": {"name": "@three-ws/billing-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51541,7 +51541,7 @@},"packages/brain-mcp": {"name": "@three-ws/brain-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51556,7 +51556,7 @@},"packages/clash-mcp": {"name": "@three-ws/clash-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51573,7 +51573,7 @@},"packages/copy-mcp": {"name": "@three-ws/copy-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51602,7 +51602,7 @@},"packages/ibm-x402-mcp": {"name": "@three-ws/ibm-x402-mcp",- "version": "1.1.0",+ "version": "1.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51622,7 +51622,7 @@},"packages/intel-mcp": {"name": "@three-ws/intel-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51652,7 +51652,7 @@},"packages/loom-mcp": {"name": "@three-ws/loom-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51667,7 +51667,7 @@},"packages/marketplace-mcp": {"name": "@three-ws/marketplace-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51682,7 +51682,7 @@},"packages/naming-mcp": {"name": "@three-ws/naming-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51697,7 +51697,7 @@},"packages/notifications-mcp": {"name": "@three-ws/notifications-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51730,7 +51730,7 @@},"packages/provenance-mcp": {"name": "@three-ws/provenance-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51746,7 +51746,7 @@},"packages/pumpfun-mcp": {"name": "@three-ws/pumpfun-mcp",- "version": "0.2.1",+ "version": "0.2.2","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0"@@ -51760,7 +51760,7 @@},"packages/scene-mcp": {"name": "@three-ws/scene-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51775,7 +51775,7 @@},"packages/signals-mcp": {"name": "@three-ws/signals-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51790,7 +51790,7 @@},"packages/three-token-mcp": {"name": "@three-ws/three-token-mcp",- "version": "1.1.0",+ "version": "1.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51841,7 +51841,7 @@},"packages/vanity-mcp": {"name": "@three-ws/vanity-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51872,7 +51872,7 @@},"packages/vision-mcp": {"name": "@three-ws/vision-mcp",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51887,7 +51887,7 @@},"packages/x402-mcp": {"name": "@three-ws/x402-mcp",- "version": "0.2.0",+ "version": "0.2.1","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -51909,7 +51909,7 @@},"page-agent-sdk": {"name": "@three-ws/page-agent",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","engines": {"node": ">=18"@@ -51979,7 +51979,7 @@},"tour-sdk": {"name": "@three-ws/tour",- "version": "0.1.0",+ "version": "0.2.0","license": "Apache-2.0","bin": {"tour-build-curriculum": "bin/tour-build-curriculum.mjs"@@ -51991,7 +51991,7 @@"node": ">=18"},"peerDependencies": {- "@three-ws/walk": ">=0.1.0",+ "@three-ws/walk": ">=0.1.1","three": ">=0.150.0"}},@@ -52481,7 +52481,7 @@},"walk-sdk": {"name": "@three-ws/walk",- "version": "0.1.0",+ "version": "0.1.1","license": "Apache-2.0","engines": {"node": ">=18"diff --git a/scripts/mixamo-all.mjs b/scripts/mixamo-all.mjsindex 6532d050d..5e722dd43 100644--- a/scripts/mixamo-all.mjs+++ b/scripts/mixamo-all.mjs@@ -101,9 +101,31 @@ const RUN_UPLOAD = flags.upload || flags.all || (!Object.keys(flags)const CONCURRENCY = Number(flags.concurrency) || 1;const MAX_DOWNLOADS = flags.limit ? Number(flags.limit) : Infinity;+// ── Sharding ─────────────────────────────────────────────────────────────────+// --shard=I/N splits the catalog across N cooperating downloaders (one per+// Mixamo account/token, ideally one per egress IP). Shard I (1-indexed) claims+// every clip whose catalog index ≡ (I-1) mod N — an interleave, so each shard+// gets an even mix of fast/slow clips. Shards write disjoint slices but share+// animation-sources/, and the on-disk mx-*.fbx existence check is the final+// dedup guard, so overlapping or restarted shards never re-export a clip.+function parseShard(v) {+ if (!v || v === true) return { index: 1, count: 1 };+ const m = String(v).match(/^(\d+)\s*\/\s*(\d+)$/);+ if (!m) throw new Error(`--shard must look like I/N (e.g. 2/6), got "${v}"`);+ const index = Number(m[1]);+ const count = Number(m[2]);+ if (index < 1 || index > count) throw new Error(`--shard index ${index} out of range for ${count} shards`);+ return { index, count };+}+const SHARD = parseShard(flags.shard);+// ── Paths ──────────────────────────────────────────────────────────────────const CATALOG_PATH = join(__dirname, 'mixamo-catalog.json');-const PROGRESS_PATH = join(__dirname, 'mixamo-progress.json');+// Each shard keeps its own progress file so parallel processes never clobber+// one another's writes (the shared FBX-on-disk check still dedups across them).+const PROGRESS_PATH = SHARD.count > 1+ ? join(__dirname, `mixamo-progress.shard-${SHARD.index}-of-${SHARD.count}.json`)+ : join(__dirname, 'mixamo-progress.json');const SOURCES_DIR = join(ROOT, 'animation-sources');// Bulk library outputs — all gitignored; the library ships via R2, not git.@@ -344,6 +366,14 @@ async function downloadAll(catalog, token) {const characterId = await resolveCharacterId(authHeaders);console.log(` Export character: ${characterId}`);+ // Restrict to this shard's slice of the catalog (interleaved by index).+ const shardCatalog = SHARD.count > 1+ ? catalog.filter((_, i) => i % SHARD.count === SHARD.index - 1)+ : catalog;+ if (SHARD.count > 1) {+ console.log(` Shard ${SHARD.index}/${SHARD.count}: ${shardCatalog.length} of ${catalog.length} clips`);+ }+const progress = existsSync(PROGRESS_PATH)? JSON.parse(readFileSync(PROGRESS_PATH, 'utf8')): {};@@ -353,7 +383,7 @@ async function downloadAll(catalog, token) {renameSync(PROGRESS_PATH + '.tmp', PROGRESS_PATH);};- const toDownload = catalog.filter((a) => {+ const toDownload = shardCatalog.filter((a) => {if (progress[a.id]?.status === 'done') {// Pack clips are recorded in progress; single motions re-check disk.if (a.type === 'MotionPack') return false;@@ -364,14 +394,14 @@ async function downloadAll(catalog, token) {return true;});- const alreadyDone = catalog.length - toDownload.length;- console.log(` Catalog: ${catalog.length} | Already done: ${alreadyDone} | To download: ${Math.min(toDownload.length, MAX_DOWNLOADS)}`);+ const alreadyDone = shardCatalog.length - toDownload.length;+ console.log(` Catalog: ${shardCatalog.length} | Already done: ${alreadyDone} | To download: ${Math.min(toDownload.length, MAX_DOWNLOADS)}`);let ok = 0, fail = 0;let cursor = 0;async function downloadOne(anim, idx) {- const label = ` [${idx + 1 + alreadyDone}/${catalog.length}]`;+ const label = ` [${idx + 1 + alreadyDone}/${shardCatalog.length}]`;const slug = slugify(anim.name);const isPack = anim.type === 'MotionPack';const outPath = join(SOURCES_DIR, `mx-${slug}.fbx`);