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
docs(ops): a deploy worktree needs chat/node_modules and character-studio/build staged too
nirholasb54d70746237
diff --git a/CLAUDE.md b/CLAUDE.mdindex c585ea74f..08be5f4bf 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -33,7 +33,7 @@ Agents stopping mid-task to ask a question is a failure mode the owner explicitl| Whether tests pass | `npm test`; do NOT pipe through `tail` (masks exit codes); a vitest failure gates the whole Playwright stage. || Model weights / assets missing | Stage them from `gs://three-ws-model-weights` or the worker README's source. Staging weights is part of deploying a worker, not a reason to stop. || Where a feature lives | `STRUCTURE.md` maps every surface to its directory. |-| How to deploy | API/frontend, from a CLEAN worktree (`git worktree add --detach /workspaces/.deploy-wt HEAD`, hardlink node_modules with `cp -al` on the same filesystem): run `npm run build:gcp` then `gcloud builds submit --config server/cloudbuild.yaml --region us-central1 --project aerial-vehicle-466722-p5`, then `npm run deploy:gcp:purge-cdn` (or the whole build+submit+purge in one: `npm run deploy:gcp:full`). ORDER IS LOAD-BEARING and `build:gcp` encodes it: the frontend `vite build` WIPES `dist/`, so it must run FIRST, then the UMD lib build, then `publish:lib` (which mirrors the lib into `dist/`), then `build:info`, then `check:dist`, then `check:pages`. Do NOT hand-run `build:vercel` as the frontend build — it builds the SDK/lib sub-artifacts, NOT the static HTML pages, so `dist/` ends up without `/`, `/create`, etc. and `check:dist` fails. `check:dist` needs the UMD bundle (publish:lib) present. GPU workers: their own `workers/<name>/cloudbuild.yaml`. EVERY cloudbuild config must pin `serviceAccount: …/three-ws-build@…` (default compute SA was deleted) and manual submits need `--substitutions=SHORT_SHA=manual$(date +%s)` when the config tags images with `$SHORT_SHA`. Verify the deploy landed: `curl -s https://three.ws/api/version` returns the live commit SHA + Cloud Run revision, and `npm run smoke:prod` sweeps every page declared in `data/pages.json` against the live site (`deploy:gcp` runs it automatically after the purge). The CDN purge is synchronous on purpose — do not re-add `--async`, or post-deploy checks read stale edge content and report phantom failures. |+| How to deploy | API/frontend, from a CLEAN worktree (`git worktree add --detach /workspaces/.deploy-wt HEAD`, hardlink THREE artifacts with `cp -al` on the same filesystem, not just the first — `node_modules`, `chat/node_modules`, and `character-studio/build`, plus copy `.env`; omitting either nested one kills the build minutes in, with an OOM exit 144 on the avatar-studio rebuild or `Cannot find package '@sveltejs/vite-plugin-svelte'` on the chat build, see `docs/ops/gcp-production.md`): run `npm run build:gcp` then `gcloud builds submit --config server/cloudbuild.yaml --region us-central1 --project aerial-vehicle-466722-p5`, then `npm run deploy:gcp:purge-cdn` (or the whole build+submit+purge in one: `npm run deploy:gcp:full`). ORDER IS LOAD-BEARING and `build:gcp` encodes it: the frontend `vite build` WIPES `dist/`, so it must run FIRST, then the UMD lib build, then `publish:lib` (which mirrors the lib into `dist/`), then `build:info`, then `check:dist`, then `check:pages`. Do NOT hand-run `build:vercel` as the frontend build — it builds the SDK/lib sub-artifacts, NOT the static HTML pages, so `dist/` ends up without `/`, `/create`, etc. and `check:dist` fails. `check:dist` needs the UMD bundle (publish:lib) present. GPU workers: their own `workers/<name>/cloudbuild.yaml`. EVERY cloudbuild config must pin `serviceAccount: …/three-ws-build@…` (default compute SA was deleted) and manual submits need `--substitutions=SHORT_SHA=manual$(date +%s)` when the config tags images with `$SHORT_SHA`. Verify the deploy landed: `curl -s https://three.ws/api/version` returns the live commit SHA + Cloud Run revision, and `npm run smoke:prod` sweeps every page declared in `data/pages.json` against the live site (`deploy:gcp` runs it automatically after the purge). The CDN purge is synchronous on purpose — do not re-add `--async`, or post-deploy checks read stale edge content and report phantom failures. |The ONLY standing stop-and-ask gates (everything else: proceed, then report):1. Irreversible on-chain / spend actions (the gate below).diff --git a/docs/ops/gcp-production.md b/docs/ops/gcp-production.mdindex 412b38c8f..efe320e61 100644--- a/docs/ops/gcp-production.md+++ b/docs/ops/gcp-production.md@@ -146,6 +146,33 @@ curl -s https://three.ws/api/version | jq '{commitShort, branch, builtAt, revisinpm run smoke:prod```+> **A fresh deploy worktree needs THREE staged artifacts, not just+> `node_modules`.** `build:gcp` shells into two nested projects that carry their+> own dependency trees, and neither is in git. Hardlinking only the root+> `node_modules` leaves both broken, and each one fails several minutes into the+> build (2026-07-26: two consecutive dead builds, one exit 144, one exit 1):+>+> ```bash+> git worktree add --detach /workspaces/.deploy-wt HEAD+> cp -al /workspaces/three.ws/node_modules /workspaces/.deploy-wt/node_modules+> cp -al /workspaces/three.ws/chat/node_modules /workspaces/.deploy-wt/chat/node_modules+> cp -al /workspaces/three.ws/character-studio/build /workspaces/.deploy-wt/character-studio/build+> cp /workspaces/three.ws/.env /workspaces/.deploy-wt/.env+> ```+>+> - `character-studio/build` — `ensure:avatar-studio` only skips the heavy+> avatar-studio vite build when `character-studio/build/index.html` exists.+> Without it the build runs for real and gets OOM-killed (exit 144) on a box+> already hosting concurrent agent builds.+> - `chat/node_modules` — `build:chat` runs `chat/scripts/ensure-deps.mjs`, whose+> `npm install` can finish "successfully" while still leaving+> `@sveltejs/vite-plugin-svelte` unresolvable, so `vite build` dies with+> `Cannot find package '.../@sveltejs/vite-plugin-svelte/index.js'`.+> - `cp -al` (hardlink) only works on the SAME filesystem and is near-instant;+> plain `cp -r` of these trees costs minutes. If the destination directory+> already exists, `cp -al src dst` nests into `dst/build` — `rm -rf` the+> destination first.+> **The CDN purge is synchronous on purpose.** `deploy:gcp:purge-cdn` used to> pass `--async`, so anything verifying immediately afterwards read stale edge> content and reported phantom failures — a cached pre-deploy 404 for a page