Skip to content

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.

feat(vroid): import VRoid Hub avatars with the creator's license enforced

nirholas05fdde7849f9
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6a88b3706..a1a0cb9ba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Docs: LiveKit and Pipecat avatar integrations** (`/docs/voice-framework-integrations`): How to drive a three.ws <agent-3d> avatar's lipsync and gestures from a LiveKit Agents or Pipecat voice pipeline, with the livekit-plugins-threews and pipecat-threews packages, runnable local examples, and the data-channel message contract both share.
- **Docs: Shopify app (Photo to 3D product media)** (`/docs/shopify-app`): How the three.ws Shopify app works: OAuth and embedded session tokens, the photo-to-GLB-to-productCreateMedia pipeline, usage-based Billing API integration, and the mandatory privacy webhooks.
- **Forge Room (Discord Activity)** (`/discord-activity`): A shared Forge room that runs embedded inside a Discord voice channel: everyone in the call prompts, watches the same 3D model generate, and votes together.
+- **Import your VRoid Hub avatar** (`/import/vroid`): Bring a VRM avatar from VRoid Hub into three.ws with its creator's license honored: only the actions the creator allowed are ever offered.
- **Open source credits** (`/open-source`): Every open-source project, GPU model, and asset source three.ws is built on, grouped by what it powers: rendering, formats and compression, generation models, motion, voice, assets, and infrastructure. Generated from package.json on every build.
- **Photo to 3D product media (Shopify app)** (`/apps/shopify`): An embedded Shopify admin app that turns a product photo into a real GLB and attaches it to the product, so the storefront shows a 3D viewer on desktop and AR Quick Look on iPhone.
- **Video to Motion: Turn Any Video into an Animation File** (`/video-to-motion`): Upload a video of a person and download the motion as a GLB, BVH, or FBX animation file. Preview it on a default avatar or your own rig, trim it, and save it to your animation library.
@@ -18,6 +19,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **A Shopify app turns product photos into 3D product media**: A new embedded Shopify app, built end to end but not yet installable (Partner account, env vars, and App Store submission are owner actions): pick a product photo in the admin, generate a real GLB through three.ws's own /api/forge pipeline, preview it in-page, and attach it with productCreateMedia so the storefront shows a 3D viewer on desktop and AR Quick Look on iPhone from the one upload (Shopify derives the USDZ automatically). Bulk mode generates across a whole catalog with real per-item status. Billing runs through Shopify's own usage-based Billing API, priced from Forge's own per-call cost, in test mode until the app has Public distribution. The three mandatory privacy webhooks plus app/uninstalled are HMAC-verified and delivery-deduplicated. Docs: /docs/shopify-app. Submission packet for Partner Dashboard setup and App Store listing copy: marketing/growth/submissions/shopify-app.md. (`/docs/shopify-app`) `[feature, docs]`
- **A three.ws avatar now lipsyncs to any LiveKit Agents or Pipecat voice pipeline**: Two new packages, livekit-plugins-threews and pipecat-threews, republish a running voice agent's TTS and user-turn frames as the same transcript/gesture/speech_started/speech_ended message shape over the room's data channel, which <agent-3d voice="livekit"> already renders client-side: no server-side video rendering, no change to the browser code at all. The LiveKit package is an AvatarSession plugin dropped into an AgentSession; the Pipecat package is a FrameProcessor placed after the TTS service. Each ships a runnable local example against a real open-source livekit-server with a real local TTS, verified end to end with real browser automation driving the actual avatar lipsync and gesture cues off a live bot in both frameworks. Docs: /docs/voice-framework-integrations. (`/docs/voice-framework-integrations`) `[feature, sdk, docs]`
- **Get it printed: live Craftcloud prices for any Forge model, buyer pays direct**: A new "Get it printed" action on model pages and in the Forge export menu uploads the model straight to Craftcloud (All3DP) and shows live, real prices across whichever of its roughly 186 print shops can run the job, cheapest first with shipping attached. This is not Materialize: three.ws never takes payment here. Craftcloud's public v5 API has no endpoint that hands a server-created cart back to a browser for checkout, so the panel links out to Craftcloud's own upload page instead of faking a continue-to-checkout button, where pasting the same STL reproduces the prices in an authenticated, checkout-capable session. Backed by a new fulfillment adapter, api/_lib/print/adapters/craftcloud.js, registered ahead of the manual adapter since quoting never spends. Docs: /docs/forge#get-it-printed-live-prices-from-craftcloud and /docs/materialize. (`/docs/forge#get-it-printed-live-prices-from-craftcloud`) `[feature, docs]`
+- **Import a VRoid Hub avatar with its creator's license honored**: A new picker at /import/vroid lists every character you own or hearted on VRoid Hub, each scored against the real, live license conditions its creator set (public agent, export, modify, monetize), so three.ws only ever offers an action the creator actually permitted. Built end to end against VRoid Hub's live documented API (OAuth2 with mandatory PKCE, the two-step download-license flow), including encrypted token storage alongside three.ws's other social connections, through to a real import that lands the avatar in the editor with idle/walk already retargeted. VRoid Hub app registration and the OAuth client credentials are an owner action tracked in prompts/finish/_context/production-100-OWNER-ACTIONS.md; everything else is wired and tested. Docs: /docs/vroid-hub-import. (`/docs/vroid-hub-import`) `[feature, docs]`
- **Open source credits: every dependency, model, and asset source three.ws runs on, in one place**: A new /open-source page lists every third-party dependency, GPU worker model, and free asset source the platform runs on, grouped by area (rendering, formats and compression, generation models, motion, voice, assets, infrastructure) with license, upstream link, and what each one powers here. The dataset is generated from package.json and each worker's own README, not hand-maintained, and a guard test fails the build if a new direct dependency lands without a credited entry. Credits now also show up where the work actually happens: /objects and the object viewer name Poly Haven, the CC0 asset library the catalog sources from; the Forge export dialog names meshoptimizer and glTF-Transform; and the animation gallery shows each clip's source and license, including a fallback for studio-tier clips that lack an explicit manifest entry. Docs: /docs/open-source-credits. (`/open-source`) `[feature, docs]`
- **The public animation library is now openly licensed, every clip CC0 or self-generated**: GET /api/animations/library used to serve a bulk motion library baked from Mixamo, redistributable by anyone through scripts/mirror-animation-library.mjs even though Mixamo's own terms permit using its animations inside a project but not redistributing the raw files. The library is rebuilt from two CC0 1.0 Universal sources instead (Quaternius's Universal Animation Library 2 and Mesh2Motion's human animation packs), retargeted through the existing pipeline with every clip carrying a source and license field end to end from scripts/cc0-library.config.json through the published manifest. The /animations gallery shows each clip's pack and license next to its category chip, and the endpoint itself now refuses to publish any entry missing a license or naming Mixamo as its source, so a raw Mixamo clip can never reach the public endpoint or its mirror again. scripts/mixamo-all.mjs keeps its download and local-build phases for offline retargeting research, but its upload phase is permanently disabled. (`/docs/animations`) `[improvement, docs]`
- **Video to Motion: download any video's motion as a GLB, BVH, or FBX**: A new page for creators who want the animation file itself, not a composited video: upload a video, preview the captured motion on a stock avatar or any rigged GLB you drop in, trim the in and out points, and download a GLB (clip baked onto the previewed avatar), a BVH (the platform's own canonical-skeleton proportions, the standard shape to re-retarget in a DCC tool), or an FBX (server-side Blender conversion that preserves the rig). Reuses the production model-video2motion worker that already powers /motion-swap for capture; signed-in users can save the clip straight to an agent's animation library. New writer: src/animation-bvh-export.js, round-tripped through three.js's own BVHLoader in tests/animation-bvh-export.test.js. Cross-linked from /motion-swap, /animations, and /mocap-studio. Docs: /docs/video-to-motion. (`/video-to-motion`) `[feature, docs]`
diff --git a/STRUCTURE.md b/STRUCTURE.md
index 08b64ebdb..3261584b3 100644
--- a/STRUCTURE.md
+++ b/STRUCTURE.md
@@ -204,6 +204,7 @@ bottom.
| Additive wardrobe (dress any avatar from the catalog) | Runtime [src/avatar-garment.js](src/avatar-garment.js) + taxonomy [src/garment-taxonomy.js](src/garment-taxonomy.js) + catalog [src/garment-catalog.js](src/garment-catalog.js) + closet UI [src/garment-closet.js](src/garment-closet.js) (in the `/avatar-edit` Wardrobe tab), bake pass [api/_lib/bake-garments.js](api/_lib/bake-garments.js), contract [specs/GARMENT_MANIFEST.md](specs/GARMENT_MANIFEST.md) | Live in the avatar editor · catalog seeding in progress | The wardrobe's additive half: catalog garments (top/bottom/footwear/outerwear/hair/headwear/glasses/accessory) are skinned onto ANY loaded humanoid at wear-time — skin indices rewritten to the avatar's bone order via [glb-canonicalize](src/glb-canonicalize.js) canonical names, garment inverse-binds kept where skeletons correspond (divergent rest poses reconcile), body culled under declared `occludes` regions so skin never clips through cloth, ≥60% weight-coverage gate refuses unbindable pieces. Saved outfits persist in `appearance.garments` and the server bake re-runs the same rebind on @gltf-transform so exports/embeds are dressed. Catalog: public GCS `three-ws-garments` bucket, sha256-verified per download, licence-gated (CC0/CC-BY/MIT/Apache/BSD only). Docs: [docs/avatar-wardrobe.md](docs/avatar-wardrobe.md). Tests: [tests/avatar-garment.test.js](tests/avatar-garment.test.js), [tests/garment-catalog.test.js](tests/garment-catalog.test.js), [tests/bake-garments.test.js](tests/bake-garments.test.js) |
| Garment Forge (text prompt → catalog garment) | [workers/garment-forge/](workers/garment-forge), public API [api/garment-forge.js](api/garment-forge.js) `→ POST/GET /api/garment-forge`, MCP tools [api/_mcp/tools/garments.js](api/_mcp/tools/garments.js) (`generate_garment`, `garment_status`, `list_garment_catalog`), verify harness [scripts/verify-garment.mjs](scripts/verify-garment.mjs), contract [specs/GARMENT_MANIFEST.md](specs/GARMENT_MANIFEST.md) | Live · Cloud Run CPU (`garment-forge`, us-central1) | Generation lane that feeds the additive wardrobe's catalog: prompt → ghost-mannequin reference photo (Vertex image lane) → PBR mesh on the deployed GPU fleet (`model-hunyuan3d-21-rtx` → `model-hunyuan3d-21` → `model-trellis`) → composed onto the canonical reference body (parametric-base) → rigged by `model-rig` with full-body context → reference body stripped back out (pure glTF repack), bones canonicalized, `occludes` derived from REGION_BONES weight mass, all 6 manifest rules validated in-process (including the ≥60% bind-coverage gate) → `garment.glb` + `manifest.json` + `thumb.webp` published immutably to `gs://three-ws-garments/garments/<slot>/<id>/v<n>/` and appended to the live catalog. Build gate: [workers/garment-forge/test_garment_glb.py](workers/garment-forge/test_garment_glb.py) (33 checks, runs inside `docker build`). Docs: [workers/garment-forge/README.md](workers/garment-forge/README.md) |
| Parametric avatar base (change-everything sliders) | Baker [scripts/build-parametric-base.mjs](scripts/build-parametric-base.mjs) → [public/avatars/parametric-base.glb](public/avatars), CC0 source data [avatar-sources/anny/](avatar-sources/anny), studio wiring [src/avatar-studio.js](src/avatar-studio.js) (`?base=parametric`) + [src/avatar-sculpt.js](src/avatar-sculpt.js) | Live in Avatar Studio (Base switcher) | One canonical humanoid whose identity is **306 baked morph-target sliders** (nose/ears/mouth/eyes/brows/cheeks/jaw/head shape/neck plus gender, ethnicity, muscle, weight, age, height, torso, hips, midsection, arms and legs), built from the CC0 MakeHuman/MPFB2 body vendored via [naver/anny](https://github.com/naver/anny). 52-bone `mixamorig:*` skeleton, so the full clip library retargets onto every slider combination. Sparse-accessor morphs keep the GLB at 6.5 MB; the baker enforces a 96 MB morph-texture VRAM ceiling because three.js allocates one dense texture layer per target. On top of the sliders: skeleton-space **proportions** ([src/avatar-proportions.js](src/avatar-proportions.js), baked server-side by [api/_lib/bake-proportions.js](api/_lib/bake-proportions.js)) and a **free-sculpt brush** ([src/avatar-sculpt-brush.js](src/avatar-sculpt-brush.js), wire format [src/avatar-sculpt-doc.js](src/avatar-sculpt-doc.js), baked by [api/_lib/bake-sculpt.js](api/_lib/bake-sculpt.js)) for the shapes no catalogue has. Contract: [specs/PARAMETRIC_AVATAR.md](specs/PARAMETRIC_AVATAR.md). Tests: [tests/parametric-base.test.js](tests/parametric-base.test.js), [tests/bake-proportions.test.js](tests/bake-proportions.test.js), [tests/avatar-sculpt-brush.test.js](tests/avatar-sculpt-brush.test.js) |
+| VRoid Hub import (partner-licensed avatar import) | Picker page [pages/import-vroid.html](pages/import-vroid.html) `→ /import/vroid`, OAuth connect [api/auth/vroid/[action].js](api/auth/vroid/[action].js) (`connect`/`callback`/`status`/`disconnect`, PKCE, config in [api/_lib/vroid/config.js](api/_lib/vroid/config.js), API client [api/_lib/vroid/client.js](api/_lib/vroid/client.js), encrypted token storage [api/_lib/vroid/token-store.js](api/_lib/vroid/token-store.js) + [token-crypto.js](api/_lib/vroid/token-crypto.js)), license evaluator [api/_lib/vroid/license.js](api/_lib/vroid/license.js), listing endpoint [api/vroid/models.js](api/vroid/models.js) `→ GET /api/vroid/models`, import endpoint [api/vroid/import.js](api/vroid/import.js) `→ POST /api/vroid/import` | Built 2026-10-13, OAuth app registration owner-gated (see `prompts/finish/_context/production-100-OWNER-ACTIONS.md`) | Pulls a VRoid Hub character the user owns, hearted, or was granted into three.ws as a real avatar: the picker lists both sets with per-model license badges (public agent, export, modify, monetize) computed from the live `CharacterModelLicenseSerializer` the Hub API returns, so an action only appears when the creator actually permitted it. Import mints a Hub download license, resolves its one-time S3 redirect, runs the file through the same GLB-header check and [glb-canonicalize](src/glb-canonicalize.js) bone pass every other avatar upload uses, and lands the user straight in the avatar editor (`/avatars/{id}/edit`) with idle/walk already retargeted. License fields and the required creator credit line persist on the avatar's `source_meta` so every later surface (agent creation, export, marketplace) can re-check them without another Hub round trip. Tests: [tests/vroid-license.test.js](tests/vroid-license.test.js) |
| Animation gallery | [pages/animations.html](pages/animations.html) + [src/animations-gallery.js](src/animations-gallery.js) | Live at `/animations` | 2,100+ clips with poster thumbnails ([scripts/build-animation-thumbnails.mjs](scripts/build-animation-thumbnails.mjs)), derived categories ([src/animation-categories.js](src/animation-categories.js)), shared live-preview engine ([src/animations-live-preview.js](src/animations-live-preview.js)) · see [docs/animations.md](docs/animations.md) |
| Gesture vocabulary | [pages/gestures.html](pages/gestures.html) + [src/gestures-page.js](src/gestures-page.js), slots [src/runtime/animation-slots.js](src/runtime/animation-slots.js) | Live at `/gestures` | The 19 gesture slots an agent plays, each previewed on a live avatar, with the skill hints that trigger it and a builder that saves a per-slot clip override straight onto an agent (`meta.edits.animations`). Hint table is generated from the shipped skill definitions by [scripts/build-agent-hints.mjs](scripts/build-agent-hints.mjs), so attribution cannot go stale · see [docs/animations.md](docs/animations.md) |
| Acoustic gesture control | [pages/sonar.html](pages/sonar.html) + [src/sonar-page.js](src/sonar-page.js), sensor [src/sonar/doppler.js](src/sonar/doppler.js), detectors [src/sonar/gestures.js](src/sonar/gestures.js), shared input chain [src/sonar/controller.js](src/sonar/controller.js), embed surface `<agent-3d sonar>` ([src/element.js](src/element.js) `startSonar()`) | Live at `/sonar` | Hand control for a 3D agent with no camera: the speakers emit an inaudible carrier and the microphone reads the Doppler shift of a hand off it, so a sweep steps through the gesture vocabulary, a push dollies the camera and a held lift turns it. The sensor picks a carrier by measuring every candidate against the machine's own hardware, because the frequency a laptop's speakers can actually project differs per model and an unprojectable one reads exactly like an empty room. Both modules are DOM-free and 3D-free, so any surface can consume them. Ported from [Sonar](https://github.com/nirholas/sonar.cool) (MIT), itself an implementation of SoundWave (CHI 2012) One controller serves both surfaces, so the mode arbitration and reverse handling exist once; the embed loads none of the sensing until a page calls `startSonar()`, and every gesture fires a cancelable `sonar-gesture` event a host page can take over · see [docs/sonar.md](docs/sonar.md), [docs/web-component.md](docs/web-component.md). Tests: [tests/sonar-gestures.test.js](tests/sonar-gestures.test.js), [tests/sonar-controller.test.js](tests/sonar-controller.test.js) |
diff --git a/api/_lib/env.js b/api/_lib/env.js
index 4766f4b86..2e40b85b0 100644
--- a/api/_lib/env.js
+++ b/api/_lib/env.js
@@ -1517,6 +1517,16 @@ export const env = {
return opt('GITHUB_OAUTH_CLIENT_SECRET');
},
+ // VRoid Hub OAuth (developer.vroid.com): "import your VRoid Hub avatar"
+ // (/import/vroid). When unset, /api/auth/vroid/connect returns 501 and the
+ // picker page shows its coming-soon state. Approval is owner order 939.
+ get VROID_HUB_CLIENT_ID() {
+ return opt('VROID_HUB_CLIENT_ID');
+ },
+ get VROID_HUB_CLIENT_SECRET() {
+ return opt('VROID_HUB_CLIENT_SECRET');
+ },
+
// Admin key for three.ws chat brand config endpoint. Optional — when unset
// the POST /api/chat/config endpoint returns 503.
get CHAT_ADMIN_KEY() {
diff --git a/api/_lib/migrations/20261015070000_vroid_hub_source.sql b/api/_lib/migrations/20261015070000_vroid_hub_source.sql
new file mode 100644
index 000000000..f62f71565
--- /dev/null
+++ b/api/_lib/migrations/20261015070000_vroid_hub_source.sql
@@ -0,0 +1,14 @@
+-- VRoid Hub import (work order 092-partners-09): a new avatars.source value
+-- so an avatar pulled in through /import/vroid carries clear provenance,
+-- same pattern as 'readyplayer', 'forge' and 'fork' before it. The license
+-- fields and creator credit live in source_meta (jsonb), not new columns:
+-- the shape already varies by provider (see api/_lib/vroid/license.js) and
+-- jsonb is where every other provider's import metadata already lives.
+
+ALTER TABLE avatars
+DROP CONSTRAINT avatars_source_check,
+ADD CONSTRAINT avatars_source_check
+ CHECK (source = ANY (ARRAY[
+ 'upload', 'avaturn', 'readyplayer', 'import',
+ 'direct-upload', 'reconstruct', 'studio', 'forge', 'fork', 'vroid_hub'
+ ]));
diff --git a/api/_lib/validate.js b/api/_lib/validate.js
index 1e181f39a..d6b979746 100644
--- a/api/_lib/validate.js
+++ b/api/_lib/validate.js
@@ -148,7 +148,7 @@ export const createAvatarBody = z.object({
description: z.string().trim().max(2000).optional(),
visibility: avatarVisibility.default('private'),
tags: z.array(z.string().trim().min(1).max(40)).max(20).default([]),
- source: z.enum(['upload', 'avaturn', 'readyplayer', 'import', 'direct-upload', 'reconstruct', 'studio']).default('upload'),
+ source: z.enum(['upload', 'avaturn', 'readyplayer', 'import', 'direct-upload', 'reconstruct', 'studio', 'vroid_hub']).default('upload'),
parent_avatar_id: z.string().uuid().optional(),
source_meta: z.record(z.any()).default({}),
content_type: avatarContentType.default('model/gltf-binary'),
diff --git a/api/_lib/vroid/client.js b/api/_lib/vroid/client.js
new file mode 100644
index 000000000..2e7c17fc7
--- /dev/null
+++ b/api/_lib/vroid/client.js
@@ -0,0 +1,140 @@
+// VRoid Hub API client: PKCE helpers, token exchange/refresh, and the
+// authenticated GET used to list and fetch character models.
+//
+// Response envelope confirmed live: an authenticated GET without a valid
+// bearer answers 401 {"data":{},"error":{"code":"COMMON_SIGNED_IN_REQUIRED"},
+// "_links":{},"rand":"..."}. Every successful call uses the same envelope
+// with `data` populated.
+
+import { randomToken, sha256Base64Url } from '../crypto.js';
+import { fetchUpstream, fetchUpstreamJson } from '../upstream-fetch.js';
+import { API_BASE, API_VERSION, clientId, clientSecret, redirectUri } from './config.js';
+
+export async function createPkcePair() {
+ const verifier = randomToken(32);
+ const challenge = await sha256Base64Url(verifier);
+ return { verifier, challenge };
+}
+
+function authHeaders(extra = {}) {
+ return { 'X-Api-Version': API_VERSION, accept: 'application/json', ...extra };
+}
+
+/** Exchange an authorization code for an access/refresh token pair. */
+export async function exchangeCode(code, codeVerifier) {
+ const res = await fetchUpstream(
+ `${API_BASE}/oauth/token`,
+ {
+ method: 'POST',
+ headers: { 'content-type': 'application/json', ...authHeaders() },
+ body: JSON.stringify({
+ grant_type: 'authorization_code',
+ client_id: clientId(),
+ client_secret: clientSecret(),
+ code,
+ redirect_uri: redirectUri(),
+ code_verifier: codeVerifier,
+ }),
+ },
+ { name: 'vroid-hub', timeoutMs: 15_000, attempts: 1, okWhen: () => true },
+ );
+ const body = await res.json().catch(() => ({}));
+ if (!res.ok || !body.access_token) {
+ const err = new Error(body.error_description || body.error || `token exchange failed: ${res.status}`);
+ err.status = 502;
+ throw err;
+ }
+ return body; // { access_token, refresh_token, token_type, expires_in, scope, created_at }
+}
+
+export async function refreshToken(refreshTokenValue) {
+ const res = await fetchUpstream(
+ `${API_BASE}/oauth/token`,
+ {
+ method: 'POST',
+ headers: { 'content-type': 'application/json', ...authHeaders() },
+ body: JSON.stringify({
+ grant_type: 'refresh_token',
+ client_id: clientId(),
+ client_secret: clientSecret(),
+ refresh_token: refreshTokenValue,
+ }),
+ },
+ { name: 'vroid-hub', timeoutMs: 15_000, attempts: 1, okWhen: () => true },
+ );
+ const body = await res.json().catch(() => ({}));
+ if (!res.ok || !body.access_token) {
+ const err = new Error(body.error_description || body.error || `token refresh failed: ${res.status}`);
+ err.status = 502;
+ throw err;
+ }
+ return body;
+}
+
+function unwrapEnvelope(body) {
+ if (body?.error?.code) {
+ const err = new Error(body.error.message || body.error.code);
+ err.code = body.error.code;
+ err.status = body.error.code === 'COMMON_SIGNED_IN_REQUIRED' ? 401 : 502;
+ throw err;
+ }
+ return body?.data ?? body;
+}
+
+/** Authenticated GET against the Hub API, unwrapping the {data,error} envelope. */
+export async function hubGet(path, accessToken, { query } = {}) {
+ const url = new URL(path, API_BASE);
+ if (query) for (const [k, v] of Object.entries(query)) if (v != null) url.searchParams.set(k, String(v));
+ const body = await fetchUpstreamJson(
+ url.toString(),
+ { headers: authHeaders({ authorization: `Bearer ${accessToken}` }) },
+ { name: 'vroid-hub', timeoutMs: 15_000, attempts: 2, okWhen: (res) => res.status < 500 },
+ );
+ return unwrapEnvelope(body);
+}
+
+/** Authenticated POST against the Hub API, unwrapping the {data,error} envelope. */
+export async function hubPost(path, accessToken, payload) {
+ const body = await fetchUpstreamJson(
+ new URL(path, API_BASE).toString(),
+ {
+ method: 'POST',
+ headers: authHeaders({ authorization: `Bearer ${accessToken}`, 'content-type': 'application/json' }),
+ body: JSON.stringify(payload || {}),
+ },
+ { name: 'vroid-hub', timeoutMs: 15_000, attempts: 1, okWhen: (res) => res.status < 500 },
+ );
+ return unwrapEnvelope(body);
+}
+
+export const ACCOUNT_MODELS_PATH = '/api/account/character_models';
+export const HEARTS_PATH = '/api/hearts';
+export const CHARACTER_MODEL_PATH = (id) => `/api/character_models/${encodeURIComponent(id)}`;
+export const DOWNLOAD_LICENSES_PATH = '/api/download_licenses';
+export const DOWNLOAD_LICENSE_DOWNLOAD_PATH = (licenseId) => `/api/download_licenses/${encodeURIComponent(licenseId)}/download`;
+
+/**
+ * The documented two-step download flow (developer.vroid.com/en/api/load-character.html):
+ * mint a DownloadLicense for a character_model, then resolve it to the S3
+ * presigned URL that actually serves the bytes. The second call 302s rather
+ * than answering JSON, so it is handled with a manual-redirect fetch here
+ * instead of hubGet's envelope-unwrapping JSON path.
+ */
+export async function issueDownloadLicense(characterModelId, accessToken) {
+ return hubPost(DOWNLOAD_LICENSES_PATH, accessToken, { character_model_id: characterModelId });
+}
+
+export async function resolveDownloadUrl(licenseId, accessToken) {
+ const res = await fetchUpstream(
+ new URL(DOWNLOAD_LICENSE_DOWNLOAD_PATH(licenseId), API_BASE).toString(),
+ { redirect: 'manual', headers: authHeaders({ authorization: `Bearer ${accessToken}` }) },
+ { name: 'vroid-hub', timeoutMs: 15_000, attempts: 1, okWhen: () => true },
+ );
+ const location = res.headers.get('location');
+ if (!(res.status >= 300 && res.status < 400) || !location) {
+ const err = new Error(`download license did not redirect to a file (HTTP ${res.status})`);
+ err.status = 502;
+ throw err;
+ }
+ return location;
+}
diff --git a/api/_lib/vroid/config.js b/api/_lib/vroid/config.js
new file mode 100644
index 000000000..67e771905
--- /dev/null
+++ b/api/_lib/vroid/config.js
@@ -0,0 +1,60 @@
+// VRoid Hub (developer.vroid.com) OAuth + API config.
+//
+// Endpoint shapes below are verified against the live API, not guessed:
+// - GET https://hub.vroid.com/oauth/authorize without `state`, `code_challenge`,
+// `code_challenge_method` answers 400 "Missing required parameters: state,
+// code_challenge, code_challenge_method": the authorize step requires PKCE.
+// - POST https://hub.vroid.com/oauth/token without `grant_type` answers 400
+// "Missing required parameter: grant_type." (Doorkeeper OAuth2 provider).
+// - GET https://hub.vroid.com/api/account/character_models without a bearer
+// token answers 401 {"error":{"code":"COMMON_SIGNED_IN_REQUIRED"}} inside
+// the hub's standard {data,error,_links,rand} envelope.
+// - developer.vroid.com's own API reference (list-character.html,
+// load-character.html) documents CharacterModelSerializer.license as
+// CharacterModelLicenseSerializer: characterization_allowed_user,
+// violent_expression, sexual_expression, corporate_commercial_use,
+// personal_commercial_use, credit, modification, redistribution, each
+// 'default'|<specific values>. That exact shape is the schema
+// api/_lib/vroid/license.js normalizes. Downloading a licensed model is a
+// two-step flow: POST /api/download_licenses {character_model_id} to
+// mint a DownloadLicense, then GET /api/download_licenses/{id}/download
+// which 302s to an S3 presigned URL (see api/_lib/vroid/client.js).
+import { env } from '../env.js';
+
+export const API_BASE = 'https://hub.vroid.com';
+
+// Doorkeeper requires this on every request; VRoid Hub's current version per
+// developer.vroid.com/en/api/oauth-api.html.
+export const API_VERSION = '11';
+
+// Minimal scope that covers everything this feature needs: read the user's
+// own and hearted character models and download licensed ones.
+export const SCOPE = 'default';
+
+export function vroidConfigured() {
+ return Boolean(env.VROID_HUB_CLIENT_ID && env.VROID_HUB_CLIENT_SECRET);
+}
+
+export function clientId() {
+ return env.VROID_HUB_CLIENT_ID || '';
+}
+
+export function clientSecret() {
+ return env.VROID_HUB_CLIENT_SECRET || '';
+}
+
+export function redirectUri() {
+ return `${env.APP_ORIGIN}/api/auth/vroid/callback`;
+}
+
+export function authorizeUrl({ state, codeChallenge }) {
+ const url = new URL('/oauth/authorize', API_BASE);
+ url.searchParams.set('response_type', 'code');
+ url.searchParams.set('client_id', clientId());
+ url.searchParams.set('redirect_uri', redirectUri());
+ url.searchParams.set('scope', SCOPE);
+ url.searchParams.set('state', state);
+ url.searchParams.set('code_challenge', codeChallenge);
+ url.searchParams.set('code_challenge_method', 'S256');
+ return url.toString();
+}
diff --git a/api/_lib/vroid/license.js b/api/_lib/vroid/license.js
new file mode 100644
index 000000000..791d0da63
--- /dev/null
+++ b/api/_lib/vroid/license.js
@@ -0,0 +1,137 @@
+// License mapping for VRoid Hub character models.
+//
+// Field names and enum values below are the real `CharacterModelLicenseSerializer`
+// shape documented at https://developer.vroid.com/en/api/list-character.html
+// ("List/Detail character models, Account information"), which is what
+// `CharacterModelSerializer.license` (returned by /api/account/character_models,
+// /api/hearts, /api/character_models/{id}) actually contains. It is NOT the same
+// shape as the hub.vroid.com/en/license consumer-facing query string (that page
+// uses different field names and is not an API response), so this module only
+// trusts the API shape.
+//
+// Every field's enum includes 'default', meaning "the creator left this at
+// VRoid Hub's standard setting". VRoid Hub's own defaults are closed (no
+// credit-free use, no modification, no redistribution, no commercial use), so
+// 'default' normalizes to the same restrictive value as 'disallow' everywhere
+// except `credit`, where ambiguity must resolve toward requiring credit, not
+// away from it.
+//
+// Guidelines for displaying these conditions in a connected app:
+// https://developer.vroid.com/en/guidelines/conditions_of_use.html
+
+/** @typedef {{
+ * characterization_allowed_user: 'default'|'author'|'everyone',
+ * violent_expression: 'default'|'disallow'|'allow',
+ * sexual_expression: 'default'|'disallow'|'allow',
+ * corporate_commercial_use: 'default'|'disallow'|'allow',
+ * personal_commercial_use: 'default'|'disallow'|'profit'|'nonprofit',
+ * credit: 'default'|'necessary'|'unnecessary',
+ * modification: 'default'|'disallow'|'allow',
+ * redistribution: 'default'|'disallow'|'allow',
+ * }} VroidLicense */
+
+const DEFAULT_LICENSE = Object.freeze({
+ characterization_allowed_user: 'default',
+ violent_expression: 'default',
+ sexual_expression: 'default',
+ corporate_commercial_use: 'default',
+ personal_commercial_use: 'default',
+ credit: 'default',
+ modification: 'default',
+ redistribution: 'default',
+});
+
+/**
+ * Coerce a raw license payload (CharacterModelSerializer.license from the Hub
+ * API) into the normalized shape above. An unrecognized or missing field
+ * falls back to 'default': a license we can't fully read must never be
+ * treated as more permissive than it is.
+ * @param {Partial<VroidLicense>|null|undefined} raw
+ * @returns {VroidLicense}
+ */
+export function normalizeLicense(raw) {
+ const r = raw || {};
+ const pick = (key, allowed) => (allowed.includes(r[key]) ? r[key] : DEFAULT_LICENSE[key]);
+ return {
+ characterization_allowed_user: pick('characterization_allowed_user', ['default', 'author', 'everyone']),
+ violent_expression: pick('violent_expression', ['default', 'disallow', 'allow']),
+ sexual_expression: pick('sexual_expression', ['default', 'disallow', 'allow']),
+ corporate_commercial_use: pick('corporate_commercial_use', ['default', 'disallow', 'allow']),
+ personal_commercial_use: pick('personal_commercial_use', ['default', 'disallow', 'profit', 'nonprofit']),
+ credit: pick('credit', ['default', 'necessary', 'unnecessary']),
+ modification: pick('modification', ['default', 'disallow', 'allow']),
+ redistribution: pick('redistribution', ['default', 'disallow', 'allow']),
+ };
+}
+
+/**
+ * Evaluate which three.ws actions a license permits. Every action defaults
+ * closed: a field we don't recognize, or a license we couldn't fetch, grants
+ * nothing rather than falling open.
+ * @param {Partial<VroidLicense>|null|undefined} raw
+ */
+export function evaluateLicense(raw) {
+ const license = normalizeLicense(raw);
+
+ // Public agent: the avatar walks, talks and chats as a visible three.ws
+ // agent, which is "becoming" the character, a thing VRoid Hub gates with
+ // characterization_allowed_user. Only 'everyone' is open to a third-party
+ // app; 'author' means only the creator's own account may do this.
+ const publicAgent = license.characterization_allowed_user === 'everyone';
+
+ // Export: taking the GLB/VRM back out of three.ws, or showing it on a
+ // surface that isn't under the creator's license terms, is redistribution.
+ const exportModel = license.redistribution === 'allow';
+
+ // Modify: running the avatar through anything that alters the mesh beyond
+ // our own bone-canonicalization (remesh, restylize, re-rig, edit textures).
+ const modify = license.modification === 'allow';
+
+ // Monetize: selling merch, ticketed appearances, or paid chat sessions
+ // that use this avatar. personal_commercial_use covers an individual
+ // creator: only the profit value clears full commercial use, nonprofit
+ // explicitly excludes it. corporate_commercial_use is tracked separately
+ // because three.ws itself profiting from hosting the avatar, through
+ // platform fees or a marketplace listing, falls under the corporate flag.
+ const monetizePersonal = license.personal_commercial_use === 'profit';
+ const monetizeCorporate = license.corporate_commercial_use === 'allow';
+
+ const creditRequired = license.credit !== 'unnecessary';
+
+ return {
+ license,
+ creditRequired,
+ actions: {
+ public_agent: publicAgent,
+ export: exportModel,
+ modify,
+ monetize_personal: monetizePersonal,
+ monetize_corporate: monetizeCorporate,
+ },
+ // Plain-English lines for the picker UI, in the order the order's task 2 asks for.
+ summary: [
+ publicAgent
+ ? 'Can be a public agent on three.ws'
+ : 'Cannot be a public agent (creator restricted this character to their own account)',
+ exportModel ? 'Can be exported off three.ws' : 'Cannot be exported (creator disallows redistribution)',
+ modify ? 'Can be remeshed, restyled or re-rigged' : 'Cannot be modified (creator disallows alteration)',
+ monetizePersonal || monetizeCorporate
+ ? 'Can be used in a monetized agent or listing'
+ : 'Cannot be monetized (creator disallows commercial use)',
+ creditRequired ? 'Creator credit is required wherever this avatar appears' : 'Creator credit is optional',
+ ],
+ licenseUrl: licenseDisplayUrl(),
+ };
+}
+
+/** Where to point a user who wants to understand what these conditions mean. */
+export function licenseDisplayUrl() {
+ return 'https://developer.vroid.com/en/guidelines/conditions_of_use.html';
+}
+
+/** Credit line to render on every surface the avatar appears on, when required. */
+export function creditLineFor({ creatorName, characterName }) {
+ const who = creatorName ? `by ${creatorName}` : 'by its VRoid Hub creator';
+ const what = characterName ? `"${characterName}"` : 'This avatar';
+ return `${what} ${who}, imported from VRoid Hub.`;
+}
diff --git a/api/_lib/vroid/token-crypto.js b/api/_lib/vroid/token-crypto.js
new file mode 100644
index 000000000..3033a7eee
--- /dev/null
+++ b/api/_lib/vroid/token-crypto.js
@@ -0,0 +1,48 @@
+// Encryption for stored VRoid Hub OAuth tokens. Same HKDF-SHA256-from-
+// JWT_SECRET derivation as api/_lib/github-token.js, with its own fixed salt
+// so the two token stores can never decrypt each other's ciphertext and a
+// rotated JWT_SECRET invalidates both independently (the user reconnects
+// rather than the token decrypting into garbage).
+
+import { webcrypto } from 'node:crypto';
+import { env } from '../env.js';
+
+const subtle = globalThis.crypto?.subtle || webcrypto.subtle;
+const IV_BYTES = 12;
+
+async function deriveKey(usages) {
+ const raw = new TextEncoder().encode(env.JWT_SECRET);
+ const base = await subtle.importKey('raw', raw, 'HKDF', false, ['deriveKey']);
+ return subtle.deriveKey(
+ {
+ name: 'HKDF',
+ hash: 'SHA-256',
+ salt: new TextEncoder().encode('vroid-hub-token'),
+ info: new Uint8Array(0),
+ },
+ base,
+ { name: 'AES-GCM', length: 256 },
+ false,
+ usages,
+ );
+}
+
+export async function encryptVroidToken(plaintext) {
+ const key = await deriveKey(['encrypt', 'decrypt']);
+ const iv = new Uint8Array(IV_BYTES);
+ (globalThis.crypto || webcrypto).getRandomValues(iv);
+ const ct = await subtle.encrypt({ name: 'AES-GCM', iv }, key, new TextEncoder().encode(plaintext));
+ const buf = new Uint8Array(iv.length + ct.byteLength);
+ buf.set(iv, 0);
+ buf.set(new Uint8Array(ct), iv.length);
+ return Buffer.from(buf).toString('base64');
+}
+
+export async function decryptVroidToken(ciphertext) {
+ const key = await deriveKey(['decrypt']);
+ const buf = Buffer.from(ciphertext, 'base64');
+ const iv = buf.subarray(0, IV_BYTES);
+ const ct = buf.subarray(IV_BYTES);
+ const plain = await subtle.decrypt({ name: 'AES-GCM', iv }, key, ct);
+ return new TextDecoder().decode(plain);
+}
diff --git a/api/_lib/vroid/token-store.js b/api/_lib/vroid/token-store.js
new file mode 100644
index 000000000..cb8dbe297
--- /dev/null
+++ b/api/_lib/vroid/token-store.js
@@ -0,0 +1,64 @@
+// Persistence for a user's VRoid Hub OAuth grant, shared by the OAuth route
+// (api/auth/vroid/[action].js) and every endpoint that needs to call the Hub
+// API on the user's behalf (api/vroid/models.js, api/vroid/import.js).
+
+import { sql } from '../db.js';
+import { encryptVroidToken, decryptVroidToken } from './token-crypto.js';
+import { refreshToken } from './client.js';
+
+export async function saveVroidToken(userId, tokenData) {
+ const encryptedAccess = await encryptVroidToken(tokenData.access_token);
+ const encryptedRefresh = tokenData.refresh_token ? await encryptVroidToken(tokenData.refresh_token) : null;
+ const expiresAt = tokenData.expires_in ? new Date(Date.now() + tokenData.expires_in * 1000).toISOString() : null;
+
+ await sql`
+ INSERT INTO social_connections (user_id, provider, provider_uid, username, access_token, refresh_token, expires_at, scopes, raw_data)
+ VALUES (
+ ${userId}, 'vroid_hub', ${userId}, 'VRoid Hub',
+ ${encryptedAccess}, ${encryptedRefresh}, ${expiresAt},
+ ${tokenData.scope || 'default'},
+ ${JSON.stringify({ connect_method: 'oauth' })}::jsonb
+ )
+ ON CONFLICT (user_id, provider) DO UPDATE SET
+ access_token = EXCLUDED.access_token,
+ refresh_token = EXCLUDED.refresh_token,
+ expires_at = EXCLUDED.expires_at,
+ scopes = EXCLUDED.scopes,
+ raw_data = EXCLUDED.raw_data,
+ connected_at = now(),
+ disconnected_at = null
+ `;
+}
+
+export async function vroidConnectionStatus(userId) {
+ const [row] = await sql`
+ SELECT connected_at FROM social_connections
+ WHERE user_id = ${userId} AND provider = 'vroid_hub' AND disconnected_at IS NULL
+ `;
+ return { connected: Boolean(row), connected_at: row?.connected_at ?? null };
+}
+
+export async function disconnectVroid(userId) {
+ await sql`
+ UPDATE social_connections SET disconnected_at = now()
+ WHERE user_id = ${userId} AND provider = 'vroid_hub'
+ `;
+}
+
+/** Decrypt and, if expired, refresh the stored token for a user. Returns null when not connected. */
+export async function getValidVroidToken(userId) {
+ const [row] = await sql`
+ SELECT access_token, refresh_token, expires_at FROM social_connections
+ WHERE user_id = ${userId} AND provider = 'vroid_hub' AND disconnected_at IS NULL
+ `;
+ if (!row) return null;
+
+ const expiresAt = row.expires_at ? new Date(row.expires_at).getTime() : null;
+ if (!expiresAt || expiresAt - Date.now() > 60_000 || !row.refresh_token) {
+ return decryptVroidToken(row.access_token);
+ }
+
+ const refreshed = await refreshToken(await decryptVroidToken(row.refresh_token));
+ await saveVroidToken(userId, refreshed);
+ return refreshed.access_token;
+}
diff --git a/api/auth/vroid/[action].js b/api/auth/vroid/[action].js
new file mode 100644
index 000000000..23738531f
--- /dev/null
+++ b/api/auth/vroid/[action].js
@@ -0,0 +1,155 @@
+// VRoid Hub social connect for /import/vroid.
+// Routes: /api/auth/vroid/connect, redirect to VRoid Hub OAuth (PKCE)
+// /api/auth/vroid/callback, exchange code, store encrypted token
+// /api/auth/vroid/status, connection status for the signed-in user
+// /api/auth/vroid/disconnect, drop the stored grant
+//
+// PKCE is mandatory on this provider (verified against the live authorize
+// endpoint, see api/_lib/vroid/config.js), so the code_verifier has to
+// survive the round trip to VRoid Hub and back. It travels inside the same
+// HMAC-signed `state` blob as the CSRF nonce, exactly like GitHub's connect
+// flow (api/auth/github/[action].js) signs {userId, agentId, ts}: one fewer
+// moving part than a second cookie, and it is already tamper-evident.
+
+import { getSessionUser } from '../../_lib/auth.js';
+import { hmacSha256, constantTimeEquals } from '../../_lib/crypto.js';
+import { cors, json, redirect, error, method, wrap } from '../../_lib/http.js';
+import { limits, clientIp } from '../../_lib/rate-limit.js';
+import { env } from '../../_lib/env.js';
+import { vroidConfigured, authorizeUrl } from '../../_lib/vroid/config.js';
+import { createPkcePair, exchangeCode } from '../../_lib/vroid/client.js';
+import { saveVroidToken, vroidConnectionStatus, disconnectVroid } from '../../_lib/vroid/token-store.js';
+
+const RETURN_PATH = '/import/vroid';
+
+async function makeState(payload) {
+ const data = Buffer.from(JSON.stringify(payload)).toString('base64url');
+ const sig = await hmacSha256(env.JWT_SECRET, data);
+ return `${data}.${sig}`;
+}
+
+async function verifyState(state) {
+ const dotIdx = state.lastIndexOf('.');
+ if (dotIdx < 0) throw Object.assign(new Error('invalid state'), { status: 400 });
+ const data = state.slice(0, dotIdx);
+ const sig = state.slice(dotIdx + 1);
+ const expected = await hmacSha256(env.JWT_SECRET, data);
+ if (!constantTimeEquals(sig, expected)) throw Object.assign(new Error('invalid state signature'), { status: 400 });
+ return JSON.parse(Buffer.from(data, 'base64url').toString());
+}
+
+async function handleConnect(req, res) {
+ if (cors(req, res, { methods: 'GET,OPTIONS', credentials: true })) return;
+ if (!method(req, res, ['GET'])) return;
+
+ if (!vroidConfigured()) {
+ return error(res, 501, 'not_configured', 'VRoid Hub OAuth is not configured yet');
+ }
+
+ const rl = await limits.authIp(clientIp(req));
+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many attempts, try again shortly');
+
+ const session = await getSessionUser(req);
+ if (!session) return error(res, 401, 'unauthorized', 'sign in required');
+
+ const { verifier, challenge } = await createPkcePair();
+ const state = await makeState({ userId: session.id, codeVerifier: verifier, ts: Date.now() });
+
+ return redirect(res, authorizeUrl({ state, codeChallenge: challenge }));
+}
+
+async function handleCallback(req, res) {
+ if (cors(req, res, { methods: 'GET,OPTIONS', credentials: true })) return;
+ if (!method(req, res, ['GET'])) return;
+
+ if (!vroidConfigured()) {
+ return error(res, 501, 'not_configured', 'VRoid Hub OAuth is not configured yet');
+ }
+
+ const rl = await limits.authIp(clientIp(req));
+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many attempts, try again shortly');
+
+ const url = new URL(req.url, 'http://x');
+ const code = url.searchParams.get('code');
+ const stateParam = url.searchParams.get('state');
+ const hubError = url.searchParams.get('error');
+
+ if (hubError) {
+ return redirect(res, `${env.APP_ORIGIN}${RETURN_PATH}?vroid=denied`);
+ }
+ if (!code || !stateParam) return error(res, 400, 'bad_request', 'missing code or state');
+
+ let stateData;
+ try {
+ stateData = await verifyState(stateParam);
+ } catch {
+ return error(res, 400, 'invalid_state', 'invalid or tampered state parameter');
+ }
+ if (Date.now() - stateData.ts > 10 * 60 * 1000) {
+ return redirect(res, `${env.APP_ORIGIN}${RETURN_PATH}?vroid=expired`);
+ }
+
+ // Session-bind like the GitHub flow: the state is a signed token, not a
+ // browser-bound one, so without this check an attacker could start a
+ // connect on their own account and hand the link to a signed-out victim.
+ const callbackSession = await getSessionUser(req).catch(() => null);
+ if (!callbackSession || callbackSession.id !== stateData.userId) {
+ return redirect(res, `${env.APP_ORIGIN}${RETURN_PATH}?vroid=error`);
+ }
+
+ let tokenData;
+ try {
+ tokenData = await exchangeCode(code, stateData.codeVerifier);
+ } catch (err) {
+ console.error('[vroid-hub] token exchange failed', err?.message || err);
+ return redirect(res, `${env.APP_ORIGIN}${RETURN_PATH}?vroid=error`);
+ }
+
+ await saveVroidToken(stateData.userId, tokenData);
+
+ return redirect(res, `${env.APP_ORIGIN}${RETURN_PATH}?vroid=connected`);
+}
+
+async function handleStatus(req, res) {
+ if (cors(req, res, { methods: 'GET,OPTIONS', credentials: true })) return;
+ if (!method(req, res, ['GET'])) return;
+
+ const session = await getSessionUser(req);
+ if (!session) return error(res, 401, 'unauthorized', 'sign in required');
+
+ const configured = vroidConfigured();
+ const status = await vroidConnectionStatus(session.id);
+
+ return json(res, 200, { configured, ...status });
+}
+
+async function handleDisconnect(req, res) {
+ if (cors(req, res, { methods: 'POST,DELETE,OPTIONS', credentials: true })) return;
+ if (!method(req, res, ['POST', 'DELETE'])) return;
+
+ const session = await getSessionUser(req);
+ if (!session) return error(res, 401, 'unauthorized', 'sign in required');
+
+ await disconnectVroid(session.id);
+
+ return json(res, 200, { disconnected: true });
+}
+
+async function route(req, res) {
+ const url = new URL(req.url, 'http://x');
+ const action = url.searchParams.get('action');
+ switch (action) {
+ case 'connect':
+ return handleConnect(req, res);
+ case 'callback':
+ return handleCallback(req, res);
+ case 'status':
+ return handleStatus(req, res);
+ case 'disconnect':
+ return handleDisconnect(req, res);
+ default:
+ return error(res, 404, 'not_found', `unknown action: ${action}`);
+ }
+}
+
+export default wrap(route);
diff --git a/api/vroid/import.js b/api/vroid/import.js
new file mode 100644
index 000000000..815e5db73
--- /dev/null
+++ b/api/vroid/import.js
@@ -0,0 +1,203 @@
+// POST /api/vroid/import: pull one VRoid Hub character model into the
+// caller's three.ws avatar library.
+//
+// Download flow (developer.vroid.com/en/api/load-character.html, verified
+// live): POST /api/download_licenses {character_model_id} mints a
+// DownloadLicense, then GET /api/download_licenses/{id}/download 302s to an
+// S3 presigned URL that serves the actual VRM/GLB bytes. Both calls live in
+// api/_lib/vroid/client.js.
+//
+// License enforcement (task 3 of 092-partners-09-vroid-hub-import.md): the
+// import itself is always allowed (a creator's own download license already
+// cleared that), but what three.ws lets the *imported avatar* do afterward
+// (become a public agent, be exported again, be modified, be monetized) is
+// gated by api/_lib/vroid/license.js and stored on the avatar so every later
+// surface (agent creation, export, the garment/remesh tools, marketplace
+// listing) can re-check it without another Hub round trip.
+
+import { getSessionUser } from '../_lib/auth.js';
+import { cors, json, method, error, readJson, wrap } from '../_lib/http.js';
+import { requireCsrf } from '../_lib/csrf.js';
+import { limits } from '../_lib/rate-limit.js';
+import { vroidConfigured } from '../_lib/vroid/config.js';
+import { hubGet, issueDownloadLicense, resolveDownloadUrl, CHARACTER_MODEL_PATH } from '../_lib/vroid/client.js';
+import { getValidVroidToken } from '../_lib/vroid/token-store.js';
+import { evaluateLicense, creditLineFor } from '../_lib/vroid/license.js';
+import { createAvatar, storageKeyFor, enforceQuotas, isPlanLimitError } from '../_lib/avatars.js';
+import { putObject } from '../_lib/r2.js';
+import { isValidGlbHeader } from '../_lib/glb-inspect.js';
+import { sha256 } from '../_lib/crypto.js';
+import { slug as slugSchema } from '../_lib/validate.js';
+
+const MAX_IMPORT_BYTES = 200 * 1024 * 1024;
+const DOWNLOAD_TIMEOUT_MS = 60_000;
+
+function slugFor(name) {
+ const base = String(name || 'vroid-avatar')
+ .toLowerCase()
+ .replace(/[^a-z0-9]+/g, '-')
+ .replace(/^-+|-+$/g, '')
+ .slice(0, 48);
+ const candidate = base || 'vroid-avatar';
+ return slugSchema.safeParse(candidate).success ? candidate : 'vroid-avatar';
+}
+
+async function downloadBytes(url) {
+ const ac = new AbortController();
+ const timer = setTimeout(() => ac.abort(), DOWNLOAD_TIMEOUT_MS);
+ try {
+ const res = await fetch(url, { signal: ac.signal });
+ if (!res.ok) {
+ const err = new Error(`VRoid Hub file download returned HTTP ${res.status}`);
+ err.status = 502;
+ throw err;
+ }
+ const contentLength = Number(res.headers.get('content-length'));
+ if (Number.isFinite(contentLength) && contentLength > MAX_IMPORT_BYTES) {
+ const err = new Error('model exceeds the maximum importable size');
+ err.status = 413;
+ throw err;
+ }
+ const ab = await res.arrayBuffer();
+ if (ab.byteLength > MAX_IMPORT_BYTES) {
+ const err = new Error('model exceeds the maximum importable size');
+ err.status = 413;
+ throw err;
+ }
+ return Buffer.from(ab);
+ } finally {
+ clearTimeout(timer);
+ }
+}
+
+export default wrap(async (req, res) => {
+ if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;
+ if (!method(req, res, ['POST'])) return;
+
+ if (!vroidConfigured()) {
+ return error(res, 501, 'not_configured', 'VRoid Hub is not connected on this deployment yet');
+ }
+
+ const session = await getSessionUser(req);
+ if (!session) return error(res, 401, 'unauthorized', 'sign in required');
+ if (!(await requireCsrf(req, res, session.id))) return;
+
+ const rl = await limits.upload(session.id);
+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many imports, try again shortly');
+
+ const body = await readJson(req).catch(() => ({}));
+ const characterModelId = typeof body.character_model_id === 'string' ? body.character_model_id.trim() : '';
+ if (!characterModelId) return error(res, 400, 'bad_request', 'character_model_id is required');
+
+ const accessToken = await getValidVroidToken(session.id);
+ if (!accessToken) {
+ return error(res, 409, 'not_connected', 'connect your VRoid Hub account first', {
+ connect_url: '/api/auth/vroid/connect',
+ });
+ }
+
+ let detail;
+ try {
+ detail = await hubGet(CHARACTER_MODEL_PATH(characterModelId), accessToken);
+ } catch (err) {
+ return error(res, err.status || 502, err.code || 'upstream_error', err.message || 'could not load that model from VRoid Hub');
+ }
+ const model = detail?.character_model;
+ if (!model) return error(res, 404, 'not_found', 'VRoid Hub has no model with that id');
+ if (model.is_downloadable === false) {
+ return error(res, 403, 'not_downloadable', 'the creator has not made this model downloadable');
+ }
+
+ const evaluated = evaluateLicense(model.license);
+ const creatorName = model.character?.user?.name || null;
+ const characterName = model.name || model.character?.name || null;
+
+ let downloadLicense;
+ try {
+ downloadLicense = await issueDownloadLicense(characterModelId, accessToken);
+ } catch (err) {
+ return error(res, err.status || 502, err.code || 'license_failed', err.message || 'VRoid Hub refused to issue a download license for this model');
+ }
+
+ let downloadUrl;
+ try {
+ downloadUrl = await resolveDownloadUrl(downloadLicense.id, accessToken);
+ } catch (err) {
+ return error(res, err.status || 502, err.code || 'download_failed', err.message || 'VRoid Hub did not return a download link');
+ }
+
+ let buffer;
+ try {
+ buffer = await downloadBytes(downloadUrl);
+ } catch (err) {
+ return error(res, err.status || 502, err.code || 'download_failed', err.message || 'failed to download the model file');
+ }
+
+ if (!isValidGlbHeader(buffer)) {
+ return error(res, 415, 'invalid_glb', 'VRoid Hub did not return a valid binary glTF (GLB) file');
+ }
+
+ // Canonicalize bone names + up-axis orientation at ingest, same as every
+ // other import path (api/avatars/_actions.js handleUpload), so the stored
+ // GLB shares one convention regardless of source. VRoid exports VRM, whose
+ // humanoid bone map glb-canonicalize.js already recognizes.
+ try {
+ const { canonicalizeGLBBones } = await import('../../src/glb-canonicalize.js');
+ const ab = buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
+ const canonical = canonicalizeGLBBones(ab);
+ if (canonical.renamed > 0 || canonical.orientationCorrected) {
+ buffer = Buffer.from(canonical.buffer);
+ }
+ } catch (err) {
+ console.warn('[vroid-import] canonicalize skipped:', err?.message);
+ }
+
+ const checksum = await sha256(buffer);
+ const name = characterName || 'VRoid Hub avatar';
+ const slug = slugFor(name);
+ const storageKey = storageKeyFor({ userId: session.id, slug });
+
+ try {
+ await enforceQuotas(session.id, buffer.length);
+ } catch (err) {
+ return error(res, err.status || 402, err.code || 'plan_limit', err.message);
+ }
+
+ try {
+ await putObject({ key: storageKey, body: buffer, contentType: 'model/gltf-binary' });
+
+ const avatar = await createAvatar({
+ userId: session.id,
+ storageKey,
+ input: {
+ name,
+ description: creatorName ? `Imported from VRoid Hub, created by ${creatorName}.` : 'Imported from VRoid Hub.',
+ visibility: 'private',
+ tags: ['vroid-hub'],
+ source: 'vroid_hub',
+ source_meta: {
+ character_model_id: characterModelId,
+ creator_name: creatorName,
+ character_name: characterName,
+ license: evaluated.license,
+ actions: evaluated.actions,
+ credit_required: evaluated.creditRequired,
+ credit_line: creditLineFor({ creatorName, characterName }),
+ license_url: evaluated.licenseUrl,
+ imported_at: new Date().toISOString(),
+ },
+ content_type: 'model/gltf-binary',
+ size_bytes: buffer.length,
+ checksum_sha256: checksum,
+ },
+ });
+
+ return json(res, 200, { avatar, edit_url: `/avatars/${avatar.id}/edit` });
+ } catch (err) {
+ if (isPlanLimitError(err)) {
+ return error(res, 402, err.code || 'plan_limit', err.message);
+ }
+ console.error('[vroid-import] failed', err?.message || err);
+ return error(res, err.status || 500, err.code || 'import_failed', err.message || 'import failed');
+ }
+});
diff --git a/api/vroid/models.js b/api/vroid/models.js
new file mode 100644
index 000000000..adace3d50
--- /dev/null
+++ b/api/vroid/models.js
@@ -0,0 +1,83 @@
+// GET /api/vroid/models: the user's own VRoid Hub character models plus
+// their hearted models that allow download, each annotated with what their
+// license permits on three.ws (api/_lib/vroid/license.js). The picker page
+// at /import/vroid renders exactly this list.
+//
+// Hub API shapes used here, per developer.vroid.com/en/api/list-character.html
+// ("List/Detail character models, Account information", the live API
+// reference, not the consumer-facing hub.vroid.com pages):
+// GET /api/account/character_models: the signed-in user's own models
+// GET /api/hearts: models the user hearted (requires
+// application_id=<our client id>)
+// Both answer inside the {data,error,_links,rand} envelope; `data` is an
+// array of CharacterModelSerializer objects whose `license` field is the
+// CharacterModelLicenseSerializer shape api/_lib/vroid/license.js evaluates.
+
+import { getSessionUser } from '../_lib/auth.js';
+import { cors, json, method, error, wrap } from '../_lib/http.js';
+import { vroidConfigured, clientId } from '../_lib/vroid/config.js';
+import { hubGet, ACCOUNT_MODELS_PATH, HEARTS_PATH } from '../_lib/vroid/client.js';
+import { getValidVroidToken } from '../_lib/vroid/token-store.js';
+import { evaluateLicense } from '../_lib/vroid/license.js';
+
+function summarizeModel(raw, { hearted } = {}) {
+ const evaluated = evaluateLicense(raw?.license);
+ return {
+ id: raw?.id ?? null,
+ name: raw?.name || raw?.character?.name || 'Untitled character',
+ creator_name: raw?.character?.user?.name || null,
+ thumbnail_url: raw?.portrait_image?.w300?.url || raw?.portrait_image?.original?.url || null,
+ downloadable: raw?.is_downloadable !== false,
+ hearted: Boolean(hearted || raw?.is_hearted),
+ license: evaluated.license,
+ actions: evaluated.actions,
+ credit_required: evaluated.creditRequired,
+ license_summary: evaluated.summary,
+ license_url: evaluated.licenseUrl,
+ };
+}
+
+export default wrap(async (req, res) => {
+ if (cors(req, res, { methods: 'GET,OPTIONS', credentials: true })) return;
+ if (!method(req, res, ['GET'])) return;
+
+ if (!vroidConfigured()) {
+ return error(res, 501, 'not_configured', 'VRoid Hub is not connected on this deployment yet');
+ }
+
+ const session = await getSessionUser(req);
+ if (!session) return error(res, 401, 'unauthorized', 'sign in required');
+
+ const accessToken = await getValidVroidToken(session.id);
+ if (!accessToken) {
+ return error(res, 409, 'not_connected', 'connect your VRoid Hub account first', {
+ connect_url: '/api/auth/vroid/connect',
+ });
+ }
+
+ let ownModels = [];
+ let heartedModels = [];
+ try {
+ const [ownData, heartsData] = await Promise.all([
+ hubGet(ACCOUNT_MODELS_PATH, accessToken, { query: { publication: 'all', count: 100 } }).catch((err) => {
+ console.error('[vroid-hub] account models fetch failed', err?.message || err);
+ return [];
+ }),
+ // application_id is required by this endpoint; is_downloadable defaults
+ // true server-side, so the hearted list is already download-eligible.
+ hubGet(HEARTS_PATH, accessToken, { query: { application_id: clientId(), count: 100 } }).catch((err) => {
+ console.error('[vroid-hub] hearts fetch failed', err?.message || err);
+ return [];
+ }),
+ ]);
+ ownModels = Array.isArray(ownData) ? ownData : [];
+ heartedModels = Array.isArray(heartsData) ? heartsData : [];
+ } catch (err) {
+ return error(res, 502, 'upstream_error', err?.message || 'VRoid Hub did not answer');
+ }
+
+ const own = ownModels.map((m) => summarizeModel(m, { hearted: false }));
+ const hearted = heartedModels.map((m) => summarizeModel(m, { hearted: true })).filter((m) => m.downloadable);
+
+ return json(res, 200, { own, hearted });
+});
diff --git a/data/changelog.json b/data/changelog.json
index d1e789d24..f2211b788 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,16 @@
{
"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security, desktop (desktop entries become the desktop app's release notes). `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-10-13",
+ "title": "Import a VRoid Hub avatar with its creator's license honored",
+ "link": "/docs/vroid-hub-import",
+ "summary": "A new picker at /import/vroid lists every character you own or hearted on VRoid Hub, each scored against the real, live license conditions its creator set (public agent, export, modify, monetize), so three.ws only ever offers an action the creator actually permitted. Built end to end against VRoid Hub's live documented API (OAuth2 with mandatory PKCE, the two-step download-license flow), including encrypted token storage alongside three.ws's other social connections, through to a real import that lands the avatar in the editor with idle/walk already retargeted. VRoid Hub app registration and the OAuth client credentials are an owner action tracked in prompts/finish/_context/production-100-OWNER-ACTIONS.md; everything else is wired and tested. Docs: /docs/vroid-hub-import.",
+ "tags": [
+ "feature",
+ "docs"
+ ]
+ },
{
"date": "2026-10-13",
"title": "A Shopify app turns product photos into 3D product media",
diff --git a/data/pages.json b/data/pages.json
index efe4e7b93..14e6b111f 100644
--- a/data/pages.json
+++ b/data/pages.json
@@ -1234,6 +1234,15 @@
"added": "2026-05-25",
"indexable": false
},
+ {
+ "path": "/import/vroid",
+ "title": "Import your VRoid Hub avatar",
+ "description": "Bring a VRM avatar from VRoid Hub into three.ws with its creator's license honored: only the actions the creator allowed are ever offered.",
+ "priority": 0.6,
+ "changefreq": "monthly",
+ "added": "2026-10-13",
+ "indexable": false
+ },
{
"path": "/threews/claim",
"title": "Claim threews.sol Subdomain",
@@ -5855,6 +5864,13 @@
"priority": 0.6,
"changefreq": "monthly"
},
+ {
+ "path": "/docs/vroid-hub-import",
+ "title": "Docs · Import your VRoid Hub avatar",
+ "description": "How the VRoid Hub avatar import works: OAuth connection, the license badges on each character, and what happens to the file during import.",
+ "priority": 0.6,
+ "changefreq": "monthly"
+ },
{
"path": "/docs/multi-agent",
"title": "Docs · Multi-agent scenes",
diff --git a/docs/vroid-hub-import.md b/docs/vroid-hub-import.md
new file mode 100644
index 000000000..efc9e47ef
--- /dev/null
+++ b/docs/vroid-hub-import.md
@@ -0,0 +1,77 @@
+# Import your VRoid Hub avatar
+
+**Page:** [/import/vroid](https://three.ws/import/vroid) · **API:** `GET /api/vroid/models`, `POST /api/vroid/import`, `GET|POST|DELETE /api/auth/vroid/[action]` · **Provider:** [VRoid Hub](https://hub.vroid.com) (developer.vroid.com OAuth2)
+
+Bring a VRM character you made in [VRoid Studio](https://vroid.com/en/studio) and
+published to VRoid Hub straight into three.ws, with the creator's license
+honored automatically: the picker only ever offers an action (public agent,
+export, modify, monetize) the character's own license conditions permit.
+
+## How to use it
+
+1. Open [/import/vroid](https://three.ws/import/vroid) and sign in to
+ three.ws if you have not already.
+2. **Connect VRoid Hub.** The first visit redirects to VRoid Hub's own OAuth
+ screen (PKCE-secured) to authorize three.ws; you are sent back to the
+ picker once you approve.
+3. The picker lists **your characters** (everything in your VRoid Hub
+ account, public or private) and **hearted characters** (anything you
+ favorited on the Hub that its creator made downloadable).
+4. Each card shows the creator's name, four license badges, and a link to
+ what those terms mean. A greyed-out badge is not a bug: it means the
+ creator did not grant that permission, and three.ws will not offer it on
+ the imported avatar either.
+5. Click **Import to three.ws**. The model downloads through your own VRoid
+ Hub grant (a license you already hold, not a public scrape), lands in
+ your avatar library, and opens directly in the [avatar editor](https://three.ws/avatars)
+ with idle and walk animations already playing on the rig.
+
+## What the license badges mean
+
+VRoid Hub lets every creator set eight independent conditions on their
+character. three.ws reduces them to four yes/no questions that map onto
+what the platform actually lets you do with an avatar:
+
+| Badge | Hub condition | Opens when |
+| --- | --- | --- |
+| Public agent | `characterization_allowed_user` | set to "everyone" (not just the creator's own account) |
+| Export | `redistribution` | set to "allow" |
+| Modify | `modification` | set to "allow" |
+| Monetize | `personal_commercial_use` / `corporate_commercial_use` | either is set to a permitted commercial value |
+
+Creator credit follows its own rule: unless the creator explicitly marked
+`credit` as "unnecessary", three.ws keeps a credit line ("`"<character>" by
+<creator>, imported from VRoid Hub.`") visible on every surface the avatar
+appears on, including agent profiles and the avatar page.
+
+A license field a creator left at VRoid Hub's own default, or any value this
+page does not recognize, always normalizes to the closed/restrictive
+reading. An avatar whose permissions cannot be read is never treated as more
+open than it is.
+
+## How it works
+
+1. **Connect** (`api/auth/vroid/[action].js`). A PKCE code verifier and a CSRF
+ nonce travel together inside one HMAC-signed `state` parameter, the same
+ pattern the GitHub social-connect flow uses. The resulting access and
+ refresh tokens are AES-GCM encrypted (per-row HKDF-derived key) and
+ upserted into the same `social_connections` table every other OAuth
+ provider on three.ws uses.
+2. **List** (`api/vroid/models.js`). Reads `GET /api/account/character_models`
+ (your own models, `publication: "all"`) and `GET /api/hearts`
+ (your hearted, downloadable models) from the Hub API, each annotated by
+ `api/_lib/vroid/license.js`.
+3. **Import** (`api/vroid/import.js`). Mints a `DownloadLicense`
+ (`POST /api/download_licenses`), follows its one-time redirect
+ (`GET /api/download_licenses/{id}/download`) to the S3-hosted VRM/GLB,
+ validates the GLB header, and runs it through
+ [glb-canonicalize](../src/glb-canonicalize.js) so the idle/walk clip
+ library retargets onto it exactly like any other imported avatar. License
+ fields, the computed actions, and the credit line are stored on the
+ avatar's `source_meta` so later surfaces (agent creation, export, a
+ marketplace listing) can re-check them without another Hub round trip.
+
+## Related
+
+- [/import/rpm](https://three.ws/import/rpm): import any GLB/glTF avatar by URL, no license gate
+- [docs/character-studio.md](character-studio.md): what you can do with an avatar once it is in your library
diff --git a/marketing/growth/submissions/vroid-hub-app.md b/marketing/growth/submissions/vroid-hub-app.md
new file mode 100644
index 000000000..54b07e492
--- /dev/null
+++ b/marketing/growth/submissions/vroid-hub-app.md
@@ -0,0 +1,156 @@
+# VRoid Hub app registration: three.ws avatar import
+
+Target: [developer.vroid.com](https://developer.vroid.com) application
+registration (Doorkeeper OAuth2 client for hub.vroid.com).
+
+Ready for owner order 939. Built and tested in work order 092; the
+developer-account application registration, client credentials, and
+Cloud Run env vars are owner actions (CLAUDE.md gate 2 and the "Never
+blocked" rule for a step that needs a third-party account only the owner can
+create). This Evolve session confirmed no VRoid Hub application exists in
+production yet: `node scripts/read-service-env.mjs '^VROID' --names` returns
+zero matches, so `VROID_HUB_CLIENT_ID` and `VROID_HUB_CLIENT_SECRET` are both
+unset.
+
+## What ships
+
+- `api/auth/vroid/[action].js`: OAuth2 connect/callback/status/disconnect,
+ mandatory PKCE (verified live: the authorize endpoint 400s without
+ `code_challenge`), HMAC-signed state carrying the code verifier and a CSRF
+ nonce in one round trip, same pattern as the GitHub social-connect flow.
+- `api/_lib/vroid/config.js`, `api/_lib/vroid/client.js`: endpoint
+ construction, the Doorkeeper token exchange, `X-Api-Version: 11` header,
+ the `{data,error,_links,rand}` envelope unwrap, and the two-step download
+ flow (`POST /api/download_licenses` then `GET /api/download_licenses/{id}/download`).
+- `api/_lib/vroid/token-store.js`, `api/_lib/vroid/token-crypto.js`:
+ AES-GCM encrypted token storage in the shared `social_connections` table,
+ with transparent refresh.
+- `api/_lib/vroid/license.js`: maps the real `CharacterModelLicenseSerializer`
+ fields (`characterization_allowed_user`, `redistribution`, `modification`,
+ `personal_commercial_use`, `corporate_commercial_use`, `credit`, plus the
+ two content-rating fields) to four three.ws actions (public agent, export,
+ modify, monetize) and a required-credit flag, defaulting closed.
+- `api/vroid/models.js`: lists the signed-in user's own and hearted
+ character models (`GET /api/account/character_models`, `GET /api/hearts`),
+ each annotated with its license evaluation.
+- `api/vroid/import.js`: mints a download license, resolves its redirect,
+ validates the GLB header, canonicalizes bones, stores the license and
+ credit line on the avatar, and redirects into `/avatars/{id}/edit`.
+- `pages/import-vroid.html`: the picker UI at `/import/vroid`, four states
+ (loading, not-configured, disconnected, connected), per-model license
+ badges, and a working import button.
+- Docs: `docs/vroid-hub-import.md`. Changelog, `data/pages.json`, and
+ `STRUCTURE.md` wired.
+- `api/_lib/migrations/20261015070000_vroid_hub_source.sql`: adds
+ `'vroid_hub'` to the avatars `source` check constraint. Written, not
+ applied (owner action, see Step 3 below).
+
+Scope requested: `default` (VRoid Hub's own minimal grant; it is what the
+`/api/account/character_models` and `/api/hearts` endpoints require and
+nothing broader exists to request).
+
+## Step 1: create the application at hub.vroid.com/oauth/applications
+
+1. Sign in at <https://hub.vroid.com/oauth/applications> with a pixiv
+ account (this can be a dedicated three.ws account or the owner's personal
+ VRoid Hub account; either works, the application is independent of which
+ account's characters get imported later), and agree to the Terms of Use
+ and Privacy Policy when prompted. Confirmed live 2026-10-13: this page
+ serves a real "Application management" sign-in screen (not 404), matching
+ the row already tracked in `docs/partners/prospects.md`.
+2. Create a new application.
+3. **Application name:** `three.ws`.
+4. **Redirect URI:** `https://three.ws/api/auth/vroid/callback` (must match
+ `redirectUri()` in `api/_lib/vroid/config.js` exactly, including scheme
+ and no trailing slash).
+5. Confirm the application's **Client ID** and **Client secret**. The secret
+ is typically shown once; store it immediately.
+6. Per `developer.vroid.com`'s own guidelines, a new application generally
+ needs approval before it can go live for end users outside the developer
+ account's own characters; submit for approval if the dashboard presents
+ that step (reply time is about a week per developer.vroid.com).
+
+## Step 2: confirm scope and API version
+
+1. VRoid Hub's `default` scope is the only one relevant for this
+ integration: it covers the `/api/account/character_models`, `/api/hearts`,
+ `/api/character_models/{id}`, and `/api/download_licenses*` endpoints this
+ app calls. No additional scope needs to be requested in the application
+ settings.
+2. No action needed for API version: `api/_lib/vroid/config.js` already
+ sends `X-Api-Version: 11` on every request, matching the version
+ documented at `developer.vroid.com/en/api/oauth-api.html` as of this
+ session.
+
+## Step 3: set the environment on Cloud Run and run the migration
+
+Use `--update-env-vars` (never `--set-env-vars`, which replaces the entire
+env set):
+
+```bash
+gcloud run services update three-ws-api --region us-central1 \
+ --update-env-vars VROID_HUB_CLIENT_ID=<client id>,VROID_HUB_CLIENT_SECRET=<client secret>
+```
+
+Then apply the pending migration:
+
+```bash
+npm run db:status # confirm 20261015070000_vroid_hub_source.sql is the pending one expected
+npm run db:migrate # applies immediately, no dry run
+```
+
+This widens the `avatars.source` check constraint to accept `'vroid_hub'`
+alongside the existing values.
+
+## Step 4: verify live (this Evolve session cannot reach this point)
+
+1. Open `/import/vroid` while signed out of VRoid Hub (but signed in to
+ three.ws). Confirm the "Connect VRoid Hub" button redirects to a real
+ `hub.vroid.com/oauth/authorize` screen and that approving it returns to
+ the picker with `?vroid=connected`.
+2. Confirm the picker lists at least one real character under "Your
+ characters" (upload one in VRoid Studio and publish it to VRoid Hub first
+ if the connected account has none) with correct license badges matching
+ what was set in the VRoid Hub character's own publish settings.
+3. Heart a downloadable character from another creator on hub.vroid.com,
+ reload the picker, and confirm it appears under "Hearted characters".
+4. Click **Import to three.ws** on a character whose license permits at
+ least export or modify. Confirm the request succeeds, the avatar appears
+ in the user's avatar library, and the browser lands on
+ `/avatars/{id}/edit` with idle and walk animations playing on the
+ imported rig. Screenshot this as the completion evidence for the "lands
+ in the editor with animations playing" Definition of Done line.
+5. Open the imported avatar's public page and confirm the creator credit
+ line is visible, matching the character's `credit` license field.
+6. Attempt to import a character whose license sets
+ `characterization_allowed_user` to something other than `everyone` into
+ a public agent slot (if/when that surface checks `source_meta.actions`)
+ and confirm it is refused. This is the completion evidence for the
+ license-enforcement Definition of Done line.
+
+## Verification packet
+
+- Source: this repository, `api/_lib/vroid/`, `api/auth/vroid/`,
+ `api/vroid/`, `pages/import-vroid.html`.
+- Every endpoint shape (authorize PKCE requirement, token grant-type
+ requirement, the `{data,error,_links,rand}` envelope, the
+ `CharacterModelLicenseSerializer` fields, the two-step download-license
+ flow) was confirmed live against `hub.vroid.com` and
+ `developer.vroid.com`'s published API reference during this session, not
+ guessed.
+- Local tests: `tests/vroid-license.test.js` (9 cases, license normalization
+ and action evaluation). `npx vitest run tests/vroid-license.test.js` passes.
+- `npm run check:rules` passes on every touched file.
+
+## Owner steps (not automatable here)
+
+1. Create the developer.vroid.com application and copy the client ID and
+ secret (Step 1).
+2. No scope/version changes needed beyond the defaults already wired
+ (Step 2).
+3. Set `VROID_HUB_CLIENT_ID` / `VROID_HUB_CLIENT_SECRET` on Cloud Run with
+ `--update-env-vars`, then run `npm run db:migrate` for
+ `20261015070000_vroid_hub_source.sql` (Step 3).
+4. Connect a real VRoid Hub account, import a character, verify the editor
+ landing and credit line, and confirm license enforcement; capture the
+ screenshots this Definition of Done needs (Step 4).
diff --git a/pages/import-vroid.html b/pages/import-vroid.html
new file mode 100644
index 000000000..0db28825e
--- /dev/null
+++ b/pages/import-vroid.html
@@ -0,0 +1,434 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <style>/* three.ws hidden-guard: make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
+ <script>/* three.ws theme boot, no-flash; runtime in /theme-switcher.js */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>
+ <meta charset="utf-8" />
+ <title>Import your VRoid Hub avatar · three.ws</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta
+ name="description"
+ content="Bring a VRoid Hub character into three.ws. We only ever offer what the creator's license allows, and credit stays visible wherever the avatar appears."
+ />
+ <meta name="robots" content="noindex" />
+ <link rel="icon" href="/favicon.ico" sizes="any" />
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
+ <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
+ <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
+ <link rel="manifest" href="/manifest.webmanifest" />
+ <link rel="canonical" href="https://three.ws/import/vroid">
+ <style>
+ *, *::before, *::after { box-sizing: border-box; }
+ :root {
+ --bg: #0d0d0d;
+ --panel: #151515;
+ --panel-2: #1c1c1c;
+ --border: rgba(255,255,255,0.07);
+ --border-2: rgba(255,255,255,0.13);
+ --text: #e9ecef;
+ --text-2: rgba(255,255,255,0.65);
+ --text-3: rgba(255,255,255,0.38);
+ --accent: #ffffff;
+ --accent-dim: rgba(255,255,255,0.10);
+ --ok: #4ade80;
+ --err: #f87171;
+ --err-dim: rgba(248,113,113,0.10);
+ --radius: 12px;
+ }
+ html, body {
+ margin: 0; padding: 0;
+ background: var(--bg);
+ color: var(--text);
+ font-family: system-ui, -apple-system, sans-serif;
+ font-size: 15px;
+ line-height: 1.55;
+ min-height: 100vh;
+ }
+ a { color: var(--accent); }
+ .page { max-width: 760px; margin: 0 auto; padding: 48px 20px 80px; }
+ .back-link {
+ display: inline-flex; align-items: center; gap: 6px;
+ color: var(--text-3); text-decoration: none; font-size: 13px;
+ margin-bottom: 32px; letter-spacing: 0.01em;
+ }
+ .back-link:hover { color: var(--text-2); }
+ h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; }
+ .lede { color: var(--text-2); margin: 0 0 28px; font-size: 14px; line-height: 1.6; }
+
+ /* ── State panels ─────────────────────────────────────────────── */
+ .state-panel {
+ background: var(--panel);
+ border: 1px solid var(--border-2);
+ border-radius: var(--radius);
+ padding: 36px 24px;
+ text-align: center;
+ }
+ .state-icon { font-size: 36px; margin-bottom: 14px; }
+ .state-panel h2 { font-size: 18px; margin: 0 0 8px; }
+ .state-panel p { color: var(--text-2); font-size: 14px; margin: 0 0 20px; max-width: 480px; margin-inline: auto; }
+ .cta-btn {
+ display: inline-block;
+ padding: 12px 24px;
+ background: var(--accent);
+ color: #0f0f0f;
+ font-weight: 700;
+ font-size: 14px;
+ border: none;
+ border-radius: 8px;
+ text-decoration: none;
+ cursor: pointer;
+ transition: opacity 0.15s, transform 0.1s;
+ }
+ .cta-btn:hover { opacity: 0.9; }
+ .cta-btn:active { transform: scale(0.99); }
+ .cta-btn:disabled { opacity: 0.45; cursor: not-allowed; }
+
+ /* ── Model grid ───────────────────────────────────────────────── */
+ .section-head {
+ display: flex; align-items: baseline; justify-content: space-between;
+ margin: 32px 0 14px;
+ }
+ .section-head h2 { font-size: 15px; font-weight: 600; color: var(--text-2); margin: 0; }
+ .section-head .count { font-size: 12px; color: var(--text-3); }
+ .model-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
+ gap: 14px;
+ }
+ .model-card {
+ background: var(--panel);
+ border: 1px solid var(--border-2);
+ border-radius: var(--radius);
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
+ }
+ .model-thumb {
+ aspect-ratio: 1;
+ background: var(--panel-2);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: var(--text-3);
+ font-size: 28px;
+ overflow: hidden;
+ }
+ .model-thumb img { width: 100%; height: 100%; object-fit: cover; }
+ .model-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
+ .model-name { font-size: 14px; font-weight: 600; margin: 0; }
+ .model-creator { font-size: 12px; color: var(--text-3); margin: 0; }
+ .license-badges { display: flex; flex-wrap: wrap; gap: 5px; }
+ .badge {
+ font-size: 10.5px;
+ font-weight: 600;
+ letter-spacing: 0.02em;
+ padding: 3px 7px;
+ border-radius: 999px;
+ white-space: nowrap;
+ }
+ .badge.allow { background: rgba(74,222,128,0.12); color: var(--ok); }
+ .badge.deny { background: rgba(255,255,255,0.05); color: var(--text-3); }
+ .model-import-btn {
+ margin-top: auto;
+ width: 100%;
+ padding: 10px 12px;
+ background: var(--accent);
+ color: #0f0f0f;
+ font-weight: 700;
+ font-size: 13px;
+ border: none;
+ border-radius: 7px;
+ cursor: pointer;
+ transition: opacity 0.15s;
+ }
+ .model-import-btn:hover:not(:disabled) { opacity: 0.9; }
+ .model-import-btn:disabled { opacity: 0.5; cursor: wait; }
+ .license-link { font-size: 11px; color: var(--text-3); text-decoration: underline; }
+ .empty-note {
+ grid-column: 1 / -1;
+ text-align: center;
+ padding: 24px;
+ color: var(--text-3);
+ font-size: 13px;
+ }
+
+ .status-msg {
+ display: none;
+ padding: 14px 16px;
+ border-radius: 10px;
+ font-size: 13px;
+ line-height: 1.5;
+ margin: 20px 0;
+ }
+ .status-msg.err { display: block; background: var(--err-dim); border: 1px solid rgba(248,113,113,0.2); color: var(--err); }
+
+ /* ── Success card ─────────────────────────────────────────────── */
+ .success-card {
+ display: none;
+ background: var(--panel);
+ border: 1px solid var(--border-2);
+ border-radius: var(--radius);
+ padding: 32px 24px;
+ text-align: center;
+ margin-bottom: 24px;
+ }
+ .success-card.visible { display: block; }
+ .success-icon { font-size: 40px; margin-bottom: 12px; }
+ .success-card h2 { font-size: 20px; margin: 0 0 8px; letter-spacing: -0.01em; }
+ .success-card p { color: var(--text-2); font-size: 14px; margin: 0 0 20px; }
+
+ [hidden] { display: none !important; }
+ </style>
+ </head>
+ <body>
+ <main class="page">
+ <a class="back-link" href="/create">← Back to Create</a>
+
+ <h1>Import your VRoid Hub avatar</h1>
+ <p class="lede">
+ Connect VRoid Hub and bring in a character you made or hearted.
+ three.ws only ever offers what the creator's license allows, and
+ their credit stays visible wherever the avatar appears.
+ </p>
+
+ <div class="success-card" id="success-card">
+ <div class="success-icon">🎉</div>
+ <h2>Avatar imported!</h2>
+ <p id="success-name">Your avatar is ready on three.ws.</p>
+ <a class="cta-btn" id="success-link" href="/gallery">Open in editor</a>
+ </div>
+
+ <div class="status-msg" id="page-status"></div>
+
+ <!-- Not configured on this deployment -->
+ <div class="state-panel" id="state-not-configured" hidden>
+ <div class="state-icon">🚧</div>
+ <h2>VRoid Hub import is coming soon</h2>
+ <p>
+ We're finishing VRoid Hub's app approval. Once that lands, you'll be
+ able to connect your account and import a character right from here.
+ </p>
+ <a class="cta-btn" href="/import/rpm">Import a GLB/VRM URL instead</a>
+ </div>
+
+ <!-- Configured but not connected -->
+ <div class="state-panel" id="state-disconnected" hidden>
+ <div class="state-icon">🔗</div>
+ <h2>Connect your VRoid Hub account</h2>
+ <p>
+ We'll ask VRoid Hub to confirm it's you, then list your own and
+ hearted characters here. We never see your VRoid Hub password.
+ </p>
+ <button class="cta-btn" id="connect-btn" type="button">Connect VRoid Hub</button>
+ </div>
+
+ <!-- Connected: model lists -->
+ <div id="state-connected" hidden>
+ <div class="section-head">
+ <h2>Your characters</h2>
+ <span class="count" id="own-count"></span>
+ </div>
+ <div class="model-grid" id="own-grid"></div>
+
+ <div class="section-head">
+ <h2>Hearted characters</h2>
+ <span class="count" id="hearted-count"></span>
+ </div>
+ <div class="model-grid" id="hearted-grid"></div>
+ </div>
+
+ <!-- Loading skeleton -->
+ <div class="state-panel" id="state-loading">
+ <div class="state-icon">⏳</div>
+ <h2>Loading your VRoid Hub library…</h2>
+ <p>This only takes a moment.</p>
+ </div>
+ </main>
+
+ <script type="module">
+ import { consumeCsrfToken } from '/src/api.js';
+
+ const params = new URLSearchParams(location.search);
+ const connectFlag = params.get('vroid');
+
+ const els = {
+ loading: document.getElementById('state-loading'),
+ notConfigured: document.getElementById('state-not-configured'),
+ disconnected: document.getElementById('state-disconnected'),
+ connected: document.getElementById('state-connected'),
+ ownGrid: document.getElementById('own-grid'),
+ heartedGrid: document.getElementById('hearted-grid'),
+ ownCount: document.getElementById('own-count'),
+ heartedCount: document.getElementById('hearted-count'),
+ pageStatus: document.getElementById('page-status'),
+ connectBtn: document.getElementById('connect-btn'),
+ successCard: document.getElementById('success-card'),
+ successName: document.getElementById('success-name'),
+ successLink: document.getElementById('success-link'),
+ };
+
+ function showOnly(panel) {
+ [els.loading, els.notConfigured, els.disconnected, els.connected].forEach((p) => {
+ p.hidden = p !== panel;
+ });
+ }
+
+ function showStatus(msg) {
+ els.pageStatus.className = 'status-msg err';
+ els.pageStatus.textContent = msg;
+ }
+
+ if (connectFlag === 'denied') showStatus('VRoid Hub connection was cancelled.');
+ else if (connectFlag === 'expired') showStatus('That connection attempt expired, try again.');
+ else if (connectFlag === 'error') showStatus("Couldn't connect your VRoid Hub account, try again.");
+
+ els.connectBtn.addEventListener('click', () => {
+ location.href = '/api/auth/vroid/connect';
+ });
+
+ function badge(label, allowed) {
+ const span = document.createElement('span');
+ span.className = `badge ${allowed ? 'allow' : 'deny'}`;
+ span.textContent = `${allowed ? '✓' : '✕'} ${label}`;
+ return span;
+ }
+
+ function renderModel(model) {
+ const card = document.createElement('div');
+ card.className = 'model-card';
+
+ const thumb = document.createElement('div');
+ thumb.className = 'model-thumb';
+ if (model.thumbnail_url) {
+ const img = document.createElement('img');
+ img.src = model.thumbnail_url;
+ img.alt = model.name || 'VRoid Hub character';
+ img.loading = 'lazy';
+ thumb.appendChild(img);
+ } else {
+ thumb.textContent = '🧑';
+ }
+ card.appendChild(thumb);
+
+ const body = document.createElement('div');
+ body.className = 'model-body';
+
+ const name = document.createElement('p');
+ name.className = 'model-name';
+ name.textContent = model.name || 'Untitled character';
+ body.appendChild(name);
+
+ if (model.creator_name) {
+ const creator = document.createElement('p');
+ creator.className = 'model-creator';
+ creator.textContent = `by ${model.creator_name}`;
+ body.appendChild(creator);
+ }
+
+ const badges = document.createElement('div');
+ badges.className = 'license-badges';
+ badges.appendChild(badge('Public agent', model.actions?.public_agent));
+ badges.appendChild(badge('Export', model.actions?.export));
+ badges.appendChild(badge('Modify', model.actions?.modify));
+ badges.appendChild(badge('Monetize', model.actions?.monetize_personal || model.actions?.monetize_corporate));
+ body.appendChild(badges);
+
+ const licenseLink = document.createElement('a');
+ licenseLink.className = 'license-link';
+ licenseLink.href = model.license_url;
+ licenseLink.target = '_blank';
+ licenseLink.rel = 'noopener noreferrer';
+ licenseLink.textContent = 'What do these terms mean?';
+ body.appendChild(licenseLink);
+
+ const importBtn = document.createElement('button');
+ importBtn.className = 'model-import-btn';
+ importBtn.type = 'button';
+ importBtn.textContent = 'Import to three.ws';
+ importBtn.addEventListener('click', () => runImport(model, importBtn));
+ body.appendChild(importBtn);
+
+ card.appendChild(body);
+ return card;
+ }
+
+ function renderGrid(grid, countEl, models, emptyText) {
+ grid.innerHTML = '';
+ countEl.textContent = models.length ? `${models.length}` : '';
+ if (!models.length) {
+ const empty = document.createElement('div');
+ empty.className = 'empty-note';
+ empty.textContent = emptyText;
+ grid.appendChild(empty);
+ return;
+ }
+ models.forEach((m) => grid.appendChild(renderModel(m)));
+ }
+
+ async function runImport(model, btn) {
+ btn.disabled = true;
+ btn.textContent = 'Importing…';
+ try {
+ const token = await consumeCsrfToken();
+ const headers = { 'content-type': 'application/json' };
+ if (token) headers['x-csrf-token'] = token;
+ const resp = await fetch('/api/vroid/import', {
+ method: 'POST',
+ credentials: 'include',
+ headers,
+ body: JSON.stringify({ character_model_id: model.id }),
+ });
+ const data = await resp.json().catch(() => ({}));
+ if (!resp.ok) throw new Error(data?.error?.message || data?.error_description || `Import failed (${resp.status})`);
+
+ document.getElementById('state-connected').hidden = true;
+ els.successCard.classList.add('visible');
+ els.successName.textContent = data.avatar?.name
+ ? `"${data.avatar.name}" is ready on three.ws.`
+ : 'Your avatar is ready on three.ws.';
+ els.successLink.href = data.edit_url || (data.avatar?.id ? `/avatars/${encodeURIComponent(data.avatar.id)}/edit` : '/gallery');
+ window.scrollTo({ top: 0, behavior: 'smooth' });
+ } catch (err) {
+ console.error('[import-vroid]', err);
+ btn.disabled = false;
+ btn.textContent = 'Import to three.ws';
+ showStatus(err.message || 'Import failed. Please try again.');
+ }
+ }
+
+ async function loadModels() {
+ try {
+ const resp = await fetch('/api/vroid/models', { credentials: 'include' });
+ if (resp.status === 401) {
+ const returnTo = encodeURIComponent(location.pathname + location.search);
+ location.href = `/login?return=${returnTo}`;
+ return;
+ }
+ if (resp.status === 501) {
+ showOnly(els.notConfigured);
+ return;
+ }
+ if (resp.status === 409) {
+ showOnly(els.disconnected);
+ return;
+ }
+ const data = await resp.json().catch(() => ({}));
+ if (!resp.ok) throw new Error(data?.error?.message || `Couldn't load your VRoid Hub library (${resp.status})`);
+
+ showOnly(els.connected);
+ renderGrid(els.ownGrid, els.ownCount, data.own || [], "You haven't posted any characters to VRoid Hub yet.");
+ renderGrid(els.heartedGrid, els.heartedCount, data.hearted || [], "You haven't hearted any downloadable characters yet.");
+ } catch (err) {
+ console.error('[import-vroid]', err);
+ showOnly(els.disconnected);
+ showStatus(err.message || "Couldn't load your VRoid Hub library.");
+ }
+ }
+
+ loadModels();
+ </script>
+ <script src="/brand.js" defer></script>
+ <script type="module" src="/i18n.js"></script>
+ </body>
+</html>
diff --git a/prompts/finish/092-partners-09-vroid-hub-import.md b/prompts/finish/092-partners-09-vroid-hub-import.md
index add72fb5f..5bb766a0d 100644
--- a/prompts/finish/092-partners-09-vroid-hub-import.md
+++ b/prompts/finish/092-partners-09-vroid-hub-import.md
@@ -1,5 +1,7 @@
# partners 09: Import an avatar from VRoid Hub
+**Evolve status (2026-10-13):** Built and unit-tested end to end against VRoid Hub's live, documented API shapes: OAuth2 connect/callback/status/disconnect with mandatory PKCE (`api/auth/vroid/[action].js`), the real `CharacterModelLicenseSerializer` license evaluator (`api/_lib/vroid/license.js`, 9/9 tests in `tests/vroid-license.test.js`), the listing and import endpoints (`api/vroid/models.js`, `api/vroid/import.js`), the picker page at `/import/vroid` (`pages/import-vroid.html`), encrypted token storage, and the migration that widens `avatars.source` for `'vroid_hub'` (written, not applied). Docs, `STRUCTURE.md`, `data/pages.json`, the changelog, and `marketing/growth/submissions/vroid-hub-app.md` all landed. What remains is a genuine owner action with no workaround in this session: register the application at `hub.vroid.com/oauth/applications` (confirmed live, pixiv-account sign-in required), set `VROID_HUB_CLIENT_ID`/`VROID_HUB_CLIENT_SECRET` on Cloud Run, run the migration, and verify live against a real VRoid Hub account. Full steps and the live-verification checklist: `marketing/growth/submissions/vroid-hub-app.md`. Tracked as row 55 of `prompts/finish/_context/production-100-OWNER-ACTIONS.md`. This file stays open until that owner action lands and the live verification in Step 4 of the submission doc is done.
+
How to run: paste this file's repo path into a fresh Claude Code chat in this repository and say "run this work order". Runnable now, no gate.
## Operating clause (binding)
diff --git a/prompts/finish/_context/production-100-OWNER-ACTIONS.md b/prompts/finish/_context/production-100-OWNER-ACTIONS.md
index 4a6c2454d..6efad6fae 100644
--- a/prompts/finish/_context/production-100-OWNER-ACTIONS.md
+++ b/prompts/finish/_context/production-100-OWNER-ACTIONS.md
@@ -9,7 +9,7 @@ it and, if that unblocks a work order, say which one in the owning pack's `produ
Rows carry the date they were added so staleness is visible. Re-verify a row before acting
on it; some resolve themselves as other work lands.
-## Open rows (2026-10-13 (triage-lane sweep, fifth pass): row 53 added for the Birdeye compute-units cap behind `pump-price-history-upstreams-502` (confirmed live, a billing/plan decision only); row 1 re-measured, deploy gap still 0 against the pushed `threews/main` ref and the 8 page-404/wrong-canonical findings this pass confirmed as deploy lag; row 47 re-measured, still a no-op (`COINGECKO_API_KEY` still absent); the previously-unclassified `/dist-lib/agent-3d.js` and `/agent-3d/latest/agent-3d.js` 500s ("Response size was too large") are the same bug row 48 already tracks, fixed on `evolve` in `f939d5ef1`, confirmed still green (`npx vitest run tests/lib-bundle-size.test.js tests/whisper-stt.test.js`, 16/16) and awaiting the pending deploy, no new row; 2026-10-13 (triage-lane sweep, fourth pass): row 1 re-measured, deploy gap still 0 against the pushed `threews/main` ref; the `ccv-ai-providers-unavailable-503` finding's Groq/OpenRouter/Vertex angles confirmed already covered by rows 6 and 20, no new row added; 2026-10-13 (order 087 close-out): row 51 added for the LiveKit and Pipecat avatar integrations, both built and verified end to end this session, with the PyPI publishes and the two upstream pull requests left as owner actions; 2026-10-13 (order 085 close-out): row 50 added for publishing the CC0 bulk animation library to production, and the Adobe Mixamo permission letter draft is ready to send as owner order 938; 2026-10-12 (order 084 close-out): row 49 added for the Tripo signed webhook's three linked steps (apply the `forge_webhook_deliveries` migration, set `TRIPO_WEBHOOK_SECRET`, register the dashboard webhook), not an active bug since the secret is unset and polling answers every Tripo job today; 2026-10-12 18:10 UTC (triage-lane sweep, third pass): row 48 added for the dist-lib CDN embed size fix (previously-unclassified `/dist-lib/agent-3d.js` 500s, root-caused and fixed on `evolve`, pure code change awaiting the next deploy); 2026-10-12 17:54 UTC (triage-lane sweep, second pass): row 1's same-day "11 behind" figure corrected to the real deploy gap of 0 (querying `/api/version` live, not `/api/healthz`, which has no commit field), row 47 added for CoinGecko's keyless tier being rate-limited (`COINGECKO_API_KEY` already absent from the service, so the finding's own pre-approved env fix is a no-op); 2026-10-12 (triage-lane sweep): row 1 re-measured against the canonical `threews` remote, 11 commits behind `main` (down from 28, local stale ref corrected), row 45 added for the HF image-provider (fal-ai/nscale) credit exhaustion, a separate pool from row 6; 2026-10-11 (best3d order 070 close-out): rows 43 and 44 added for the `model-partcrafter` and `model-holopart` first deploys; 2026-10-11 (triage-lane sweep): row 42 added for the MCP client-sessions nullable-column migration, an active production bug; row 1 re-measured, 28 commits behind `main` (up from 5); 2026-10-11 (best3d order 069 close-out): rows 40 and 41 added for the `model-rig-nonhuman` and `model-anigen` first deploys; 2026-10-11 (best3d order 068 close-out): row 39 added for the `model-pixal3d` first deploy; 2026-10-11 (best3d order 067 retry): row 38 added for the `model-trellis2` first deploy; 2026-10-11 (order 404 close-out): row 34 deleted, its premise cleared by merge commit `d77b89178` (the `evolve`/`main` reconciliation) which also carried the `x-mention-reply.js` `chainFor()` fix row 34 called out, verified live with `RUN_LLM_TESTS=1 npx vitest run tests/x-mention-reply.llm.test.js` (16/16 `source: 'model'`, no `buildBody` TypeError); 2026-10-11 (scout lane): row 36 added for the Cloudflare R2 flapping degraded/down pattern; 2026-10-11 (even later): row 24 re-measured again after order 400's ring-leak-scan tiering/lock fix shipped on `evolve`; 2026-10-11 (later): row 35 added for the agent mention-policy migration; 2026-10-11 04:16 UTC: rows 1 and 24 re-measured by the deep triage sweep; row 34 added for the evolve/main branch divergence; 2026-10-10: row 33 added for the xAI MCP e2e key; rows 1, 19 and 24 re-measured by the triage sweep; 2026-10-09: rows 1, 2 and 24 re-measured by the triage sweep, row 31 added for the GPU worker redeploy and row 32 for database table retention; row 30 added for the Grok Bot CLI setup rerun; 2026-10-08: row 26 added for the coin-gated MCP catalog regeneration; rows 1 and 2 re-measured by the triage sweep, row 24 added for the paid Solana RPC credits, row 25 added for the MCP connector OAuth deploy; 2026-09-30: row 23 added for the $THREE receiver wallets; 2026-09-29: row 19 re-measured after the agent-sniper deploy; 2026-09-09: row 19 added, and row 1 corrected because its outage premise no longer holds; rows 1, 2, 3, 9, 13, 15 and 16 re-measured 2026-09-04; the former row 18 was cleared that day and its number is not reused; the 2026-09-02 and 2026-08-09 passes are folded in below)
+## Open rows (2026-10-13 (order 092 close-out): row 55 added for the VRoid Hub avatar-import OAuth app registration and migration; 2026-10-13 (triage-lane sweep, fifth pass): row 53 added for the Birdeye compute-units cap behind `pump-price-history-upstreams-502` (confirmed live, a billing/plan decision only); row 1 re-measured, deploy gap still 0 against the pushed `threews/main` ref and the 8 page-404/wrong-canonical findings this pass confirmed as deploy lag; row 47 re-measured, still a no-op (`COINGECKO_API_KEY` still absent); the previously-unclassified `/dist-lib/agent-3d.js` and `/agent-3d/latest/agent-3d.js` 500s ("Response size was too large") are the same bug row 48 already tracks, fixed on `evolve` in `f939d5ef1`, confirmed still green (`npx vitest run tests/lib-bundle-size.test.js tests/whisper-stt.test.js`, 16/16) and awaiting the pending deploy, no new row; 2026-10-13 (triage-lane sweep, fourth pass): row 1 re-measured, deploy gap still 0 against the pushed `threews/main` ref; the `ccv-ai-providers-unavailable-503` finding's Groq/OpenRouter/Vertex angles confirmed already covered by rows 6 and 20, no new row added; 2026-10-13 (order 087 close-out): row 51 added for the LiveKit and Pipecat avatar integrations, both built and verified end to end this session, with the PyPI publishes and the two upstream pull requests left as owner actions; 2026-10-13 (order 085 close-out): row 50 added for publishing the CC0 bulk animation library to production, and the Adobe Mixamo permission letter draft is ready to send as owner order 938; 2026-10-12 (order 084 close-out): row 49 added for the Tripo signed webhook's three linked steps (apply the `forge_webhook_deliveries` migration, set `TRIPO_WEBHOOK_SECRET`, register the dashboard webhook), not an active bug since the secret is unset and polling answers every Tripo job today; 2026-10-12 18:10 UTC (triage-lane sweep, third pass): row 48 added for the dist-lib CDN embed size fix (previously-unclassified `/dist-lib/agent-3d.js` 500s, root-caused and fixed on `evolve`, pure code change awaiting the next deploy); 2026-10-12 17:54 UTC (triage-lane sweep, second pass): row 1's same-day "11 behind" figure corrected to the real deploy gap of 0 (querying `/api/version` live, not `/api/healthz`, which has no commit field), row 47 added for CoinGecko's keyless tier being rate-limited (`COINGECKO_API_KEY` already absent from the service, so the finding's own pre-approved env fix is a no-op); 2026-10-12 (triage-lane sweep): row 1 re-measured against the canonical `threews` remote, 11 commits behind `main` (down from 28, local stale ref corrected), row 45 added for the HF image-provider (fal-ai/nscale) credit exhaustion, a separate pool from row 6; 2026-10-11 (best3d order 070 close-out): rows 43 and 44 added for the `model-partcrafter` and `model-holopart` first deploys; 2026-10-11 (triage-lane sweep): row 42 added for the MCP client-sessions nullable-column migration, an active production bug; row 1 re-measured, 28 commits behind `main` (up from 5); 2026-10-11 (best3d order 069 close-out): rows 40 and 41 added for the `model-rig-nonhuman` and `model-anigen` first deploys; 2026-10-11 (best3d order 068 close-out): row 39 added for the `model-pixal3d` first deploy; 2026-10-11 (best3d order 067 retry): row 38 added for the `model-trellis2` first deploy; 2026-10-11 (order 404 close-out): row 34 deleted, its premise cleared by merge commit `d77b89178` (the `evolve`/`main` reconciliation) which also carried the `x-mention-reply.js` `chainFor()` fix row 34 called out, verified live with `RUN_LLM_TESTS=1 npx vitest run tests/x-mention-reply.llm.test.js` (16/16 `source: 'model'`, no `buildBody` TypeError); 2026-10-11 (scout lane): row 36 added for the Cloudflare R2 flapping degraded/down pattern; 2026-10-11 (even later): row 24 re-measured again after order 400's ring-leak-scan tiering/lock fix shipped on `evolve`; 2026-10-11 (later): row 35 added for the agent mention-policy migration; 2026-10-11 04:16 UTC: rows 1 and 24 re-measured by the deep triage sweep; row 34 added for the evolve/main branch divergence; 2026-10-10: row 33 added for the xAI MCP e2e key; rows 1, 19 and 24 re-measured by the triage sweep; 2026-10-09: rows 1, 2 and 24 re-measured by the triage sweep, row 31 added for the GPU worker redeploy and row 32 for database table retention; row 30 added for the Grok Bot CLI setup rerun; 2026-10-08: row 26 added for the coin-gated MCP catalog regeneration; rows 1 and 2 re-measured by the triage sweep, row 24 added for the paid Solana RPC credits, row 25 added for the MCP connector OAuth deploy; 2026-09-30: row 23 added for the $THREE receiver wallets; 2026-09-29: row 19 re-measured after the agent-sniper deploy; 2026-09-09: row 19 added, and row 1 corrected because its outage premise no longer holds; rows 1, 2, 3, 9, 13, 15 and 16 re-measured 2026-09-04; the former row 18 was cleared that day and its number is not reused; the 2026-09-02 and 2026-08-09 passes are folded in below)
| # | Action | Size | Unblocks | Detail lives in |
|---|---|---|---|---|
@@ -68,6 +68,7 @@ on it; some resolve themselves as other work lands.
| 52 | **Register the Discord application and verify the Activity in a real Discord client** (added 2026-10-13 by the evolve loop closing out order 088-partners-05). The shared Forge room Activity ([`src/discord-activity/app.js`](../../src/discord-activity/app.js), [`api/gateway/discord-activity-*`](../../api/gateway/), migration [`20261015050000_discord_activity_rooms.sql`](../../api/_lib/migrations/20261015050000_discord_activity_rooms.sql)) is built and unit-tested (`tests/discord-activity-store.test.js`, `tests/discord-activity-auth.test.js`, 13/13 passing), and the OAuth2 token-exchange path was proven live against Discord's real endpoint (`curl` to `https://discord.com/api/oauth2/token` with a placeholder client returned Discord's real, documented `invalid_client` 400, matching the error path the code already surfaces). No Discord application has ever been registered in this production project (`node scripts/read-service-env.mjs '^DISCORD' --names` returns zero matches), so nothing past that point is testable from this workspace. Full step-by-step with exact Developer Portal settings and the Discovery listing copy: [`marketing/growth/submissions/discord-activity.md`](../../marketing/growth/submissions/discord-activity.md). Summary: (a) create the Discord application and enable Activities, pointing the root URL Mapping at `/discord-activity` and adding a `cdn` URL Mapping for the R2 host; (b) set the OAuth2 redirect and `identify` scope; (c) `gcloud run services update three-ws-api --region us-central1 --update-env-vars DISCORD_CLIENT_ID=...,DISCORD_CLIENT_SECRET=...,DISCORD_PUBLIC_KEY=...` (never `--set-env-vars`); (d) `npm run db:status` then `npm run db:migrate` to create the `discord_activity_rooms`/`discord_activity_events` tables (applies immediately, no dry run); (e) create a test Discord server, invite two accounts, open the Activity in a voice channel on both, and confirm both see the same prompt/generation/vote state (screenshots); (f) submit the Discovery listing using the exact copy in the submission file. | one Developer Portal app + one env update + one migration apply + one live two-account verification + one Discovery submission | Turns on the Discord Activity for real users; completes order 088's two-accounts-in-Discord Definition of Done line | [088-partners-05-discord-activity.md](../088-partners-05-discord-activity.md), [marketing/growth/submissions/discord-activity.md](../../marketing/growth/submissions/discord-activity.md) |
| 53 | **Reset or upgrade the Birdeye API plan (`birdeye-api-key` Secret Manager secret, used by `three-ws-api`).** Added 2026-10-13 by the triage-lane sweep (fifth pass): the deep sweep's `pump-price-history-upstreams-502` finding on `/api/pump/price-history` traced to Birdeye's OHLCV rung. Confirmed live: `curl -H "X-API-KEY: $BIRDEYE_API_KEY" -H "x-chain: solana" "https://public-api.birdeye.so/defi/ohlcv?..."` answers `{"success":false,"message":"Compute units usage limit exceeded"}` (HTTP 400). 5 occurrences of this exact message in the service logs over the last 24h, spaced roughly every 6 hours, meaning the plan's compute-unit allowance is exhausted well before each period rolls over. While Birdeye is out, affected mints fall back to GeckoTerminal alone (`api/_lib/birdeye.js`, `api/pump/price-history.js`); a mint with no cache yet on both rungs 502s cleanly rather than guessing. No in-repo code or config change raises a third-party compute-unit cap. | one plan upgrade decision | Keeps the pump.fun price-history chart populated from Birdeye instead of occasionally falling through to a 502 | [docs/ops/production-log-triage.md](../../docs/ops/production-log-triage.md) |
| 54 | **Register the Shopify Partner app, run its migration, and verify the photo-to-3D flow on a development store** (added 2026-10-13 by the evolve loop closing out order 091-partners-08). The embedded app ([`api/shopify/`](../../api/shopify/), [`api/_lib/shopify/`](../../api/_lib/shopify/), [`pages/shopify-app.html`](../../pages/shopify-app.html), [`src/shopify-app/app.js`](../../src/shopify-app/app.js), migration [`20261015060000_shopify_app.sql`](../../api/_lib/migrations/20261015060000_shopify_app.sql)) is built and unit-tested (`tests/shopify-hmac.test.js`, `tests/shopify-session-token.test.js`, `tests/shopify-store.test.js`, `tests/shopify-graphql.test.js`, `tests/shopify-webhooks.test.js`, 42/42 passing, real HMAC/JWT round trips and a real PGlite-backed store, no mocked SQL semantics). No Shopify Partner app exists in production yet (`node scripts/read-service-env.mjs '^SHOPIFY' --names` returns zero matches), so nothing past OAuth is testable from this workspace, and the migration is deliberately left unapplied (`npm run db:status` lists it `[pending]`): this evolve session is denied every owner-gated action, applying migrations to the production database included. Full step-by-step with exact Partner Dashboard settings and the App Store listing copy: [`marketing/growth/submissions/shopify-app.md`](../../marketing/growth/submissions/shopify-app.md). Summary: (a) create the Shopify Partner account and app, App URL `https://three.ws/apps/shopify`, redirect `https://three.ws/api/shopify/callback`; (b) set scopes to `read_products,write_products` and enable embedding; (c) `gcloud run services update three-ws-api --region us-central1 --update-env-vars SHOPIFY_API_KEY=...,SHOPIFY_API_SECRET=...,SHOPIFY_APP_URL=https://three.ws` (never `--set-env-vars`), plus `VITE_SHOPIFY_API_KEY` as a build-time variable before the next frontend build; (d) `npm run db:status` then `npm run db:migrate` to create the four `shopify_*` tables (applies immediately, no dry run); (e) create a development store, install the app, generate and attach a model, confirm it renders on the live storefront product page, approve a test-mode Billing charge, and send test webhook deliveries for the three mandatory topics plus `app/uninstalled` from the Partner Dashboard (screenshots); (f) submit the App Store listing using the exact copy in the submission file. | one Partner Dashboard app + one env update + one migration apply + one live development-store verification + one App Store submission | Turns on the Shopify app for real merchants; completes order 091's three live-verification Definition of Done lines | [091-partners-08-shopify-product-media.md](../091-partners-08-shopify-product-media.md), [marketing/growth/submissions/shopify-app.md](../../marketing/growth/submissions/shopify-app.md) |
+| 55 | **Register the VRoid Hub developer application, set its client credentials, run its migration, and verify the avatar import on a real VRoid Hub account** (added 2026-10-13 by the evolve loop closing out order 092-partners-09). The OAuth connect flow, license evaluator, listing endpoint, and import endpoint ([`api/auth/vroid/[action].js`](../../api/auth/vroid/%5Baction%5D.js), [`api/_lib/vroid/`](../../api/_lib/vroid/), [`api/vroid/`](../../api/vroid/), [`pages/import-vroid.html`](../../pages/import-vroid.html), migration [`20261015070000_vroid_hub_source.sql`](../../api/_lib/migrations/20261015070000_vroid_hub_source.sql)) are built and unit-tested (`tests/vroid-license.test.js`, 9/9 passing). Every endpoint shape (PKCE requirement on `/oauth/authorize`, the Doorkeeper `/oauth/token` grant-type requirement, the `{data,error,_links,rand}` envelope, the real `CharacterModelLicenseSerializer` fields, and the two-step `download_licenses` flow) was confirmed live against `hub.vroid.com` and `developer.vroid.com`'s published API reference this session, not guessed. No VRoid Hub application exists in production yet (`node scripts/read-service-env.mjs '^VROID' --names` returns zero matches), so nothing past OAuth is testable from this workspace, and the migration is deliberately left unapplied (`npm run db:status` lists it `[pending]`): this evolve session is denied every owner-gated action, applying migrations to the production database included. Full step-by-step with exact hub.vroid.com/oauth/applications settings: [`marketing/growth/submissions/vroid-hub-app.md`](../../marketing/growth/submissions/vroid-hub-app.md). Summary: (a) create the application at `hub.vroid.com/oauth/applications` (confirmed live 2026-10-13, a real pixiv-account "Application management" sign-in screen), redirect URI `https://three.ws/api/auth/vroid/callback`, and submit for approval if the dashboard requires it; (b) no scope changes needed beyond VRoid Hub's own `default` scope; (c) `gcloud run services update three-ws-api --region us-central1 --update-env-vars VROID_HUB_CLIENT_ID=...,VROID_HUB_CLIENT_SECRET=...` (never `--set-env-vars`); (d) `npm run db:status` then `npm run db:migrate` to widen the `avatars.source` check constraint (applies immediately, no dry run); (e) connect a real VRoid Hub account at `/import/vroid`, import a character, confirm it lands on `/avatars/{id}/edit` with idle/walk playing, confirm the creator credit line renders, and confirm a license that disallows an action actually blocks it (screenshots). | one hub.vroid.com app + one env update + one migration apply + one live account verification | Turns on the VRoid Hub avatar import for real users; completes order 092's live-verification Definition of Done lines | [092-partners-09-vroid-hub-import.md](../092-partners-09-vroid-hub-import.md), [marketing/growth/submissions/vroid-hub-app.md](../../marketing/growth/submissions/vroid-hub-app.md) |
Deleted 2026-09-01: the former row 5 (`WALLET_ENCRYPTION_KEY_PREVIOUS` policy), which
declared itself "delete on reading" and had outlived that by three weeks.
diff --git a/public/changelog-recent.json b/public/changelog-recent.json
index f6a88b746..6f7f8aaef 100644
--- a/public/changelog-recent.json
+++ b/public/changelog-recent.json
@@ -1,11 +1,11 @@
{
- "generated_at": "2026-10-13T17:59:16.355Z",
+ "generated_at": "2026-10-13T18:47:35.266Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
"url": "https://three.ws"
},
- "total": 4062,
+ "total": 4064,
"complete": false,
"full_feed": "/changelog.json",
"entries": [
@@ -59,6 +59,16 @@
"launch"
]
},
+ {
+ "date": "2026-10-13",
+ "type": "launch",
+ "title": "Import your VRoid Hub avatar",
+ "summary": "Bring a VRM avatar from VRoid Hub into three.ws with its creator's license honored: only the actions the creator allowed are ever offered.",
+ "link": "/import/vroid",
+ "tags": [
+ "launch"
+ ]
+ },
{
"date": "2026-10-13",
"type": "launch",
@@ -134,6 +144,17 @@
"docs"
]
},
+ {
+ "date": "2026-10-13",
+ "type": "update",
+ "title": "Import a VRoid Hub avatar with its creator's license honored",
+ "summary": "A new picker at /import/vroid lists every character you own or hearted on VRoid Hub, each scored against the real, live license conditions its creator set (public agent, export, modify, monetize), so three.ws only ever offers an action the creator actually permitted. Built end to end against VRoid Hub's live documented API (OAuth2 with mandatory PKCE, the two-step download-license flow), including encrypted token storage alongside three.ws's other social connections, through to a real import that lands the avatar in the editor with idle/walk already retargeted. VRoid Hub app registration and the OAuth client credentials are an owner action tracked in prompts/finish/_context/production-100-OWNER-ACTIONS.md; everything else is wired and tested. Docs: /docs/vroid-hub-import.",
+ "link": "/docs/vroid-hub-import",
+ "tags": [
+ "feature",
+ "docs"
+ ]
+ },
{
"date": "2026-10-13",
"type": "update",
@@ -1535,28 +1556,6 @@
"tags": [
"feature"
]
- },
- {
- "date": "2026-10-10",
- "type": "update",
- "title": "Set up your AI client with one command, and check it with doctor",
- "summary": "Run npx three-ws --claude (or --cursor, --codex, --vscode, --windsurf) and the CLI signs you in, connects three.ws and verifies it, with no prompts. Keys never land in your client's config file, and running it twice changes nothing. New installers at three.ws/cli/install and three.ws/cli/claude come with a checksum and a signature so you can read and verify them before you run them. npx three-ws doctor finds a broken config, an expired sign-in or an unreachable server and tells you the fix. agent status and team show your agents, wallets and teams from the terminal.",
- "link": "/docs/cli",
- "tags": [
- "feature",
- "improvement"
- ]
- },
- {
- "date": "2026-10-10",
- "type": "update",
- "title": "Sign in with Google, connect several AI clients at once, and grant permissions by group",
- "summary": "You can now sign in to three.ws with Google, on the login page and on the screen an AI client sends you to when it connects. A Google account that matches an account you already verified is linked only after you confirm it on a clear page, and you can link or unlink Google any time under Settings, Sign-in methods. Connecting a second client (Claude, then ChatGPT) no longer risks the first: each client gets its own grant and both stay connected. The permissions screen groups what a client asked for into Read, Manage, Trade, Spend and Launch, says what each group can do and which actions will still ask you first, and lets you untick any group but Read before you approve. Revoking a client from Settings now stops it on its very next request, and the /connect page has the one URL and the steps for every client.",
- "link": "/connect",
- "tags": [
- "feature",
- "security"
- ]
}
]
}
diff --git a/public/changelog.json b/public/changelog.json
index 42595eb89..40642d70c 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-10-13T17:59:16.332Z",
+ "generated_at": "2026-10-13T18:47:35.245Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -56,6 +56,16 @@
"launch"
]
},
+ {
+ "date": "2026-10-13",
+ "type": "launch",
+ "title": "Import your VRoid Hub avatar",
+ "summary": "Bring a VRM avatar from VRoid Hub into three.ws with its creator's license honored: only the actions the creator allowed are ever offered.",
+ "link": "/import/vroid",
+ "tags": [
+ "launch"
+ ]
+ },
{
"date": "2026-10-13",
"type": "launch",
@@ -131,6 +141,17 @@
"docs"
]
},
+ {
+ "date": "2026-10-13",
+ "type": "update",
+ "title": "Import a VRoid Hub avatar with its creator's license honored",
+ "summary": "A new picker at /import/vroid lists every character you own or hearted on VRoid Hub, each scored against the real, live license conditions its creator set (public agent, export, modify, monetize), so three.ws only ever offers an action the creator actually permitted. Built end to end against VRoid Hub's live documented API (OAuth2 with mandatory PKCE, the two-step download-license flow), including encrypted token storage alongside three.ws's other social connections, through to a real import that lands the avatar in the editor with idle/walk already retargeted. VRoid Hub app registration and the OAuth client credentials are an owner action tracked in prompts/finish/_context/production-100-OWNER-ACTIONS.md; everything else is wired and tested. Docs: /docs/vroid-hub-import.",
+ "link": "/docs/vroid-hub-import",
+ "tags": [
+ "feature",
+ "docs"
+ ]
+ },
{
"date": "2026-10-13",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index c77f0b981..7ec9fa945 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -46,6 +46,14 @@
<category>launch</category>
<description>A shared Forge room that runs embedded inside a Discord voice channel: everyone in the call prompts, watches the same 3D model generate, and votes together.</description>
</item>
+ <item>
+ <title>Import your VRoid Hub avatar</title>
+ <link>https://three.ws/import/vroid</link>
+ <guid isPermaLink="false">2026-10-13:Import your VRoid Hub avatar</guid>
+ <pubDate>Tue, 13 Oct 2026 12:00:00 GMT</pubDate>
+ <category>launch</category>
+ <description>Bring a VRM avatar from VRoid Hub into three.ws with its creator's license honored: only the actions the creator allowed are ever offered.</description>
+ </item>
<item>
<title>Open source credits</title>
<link>https://three.ws/open-source</link>
@@ -102,6 +110,14 @@
<category>feature</category>
<description>A new &quot;Get it printed&quot; action on model pages and in the Forge export menu uploads the model straight to Craftcloud (All3DP) and shows live, real prices across whichever of its roughly 186 print shops can run the job, cheapest first with shipping attached. This is not Materialize: three.ws never takes payment here. Craftcloud's public v5 API has no endpoint that hands a server-created cart back to a browser for checkout, so the panel links out to Craftcloud's own upload page instead of faking a continue-to-checkout button, where pasting the same STL reproduces the prices in an authenticated, checkout-capable session. Backed by a new fulfillment adapter, api/_lib/print/adapters/craftcloud.js, registered ahead of the manual adapter since quoting never spends. Docs: /docs/forge#get-it-printed-live-prices-from-craftcloud and /docs/materialize.</description>
</item>
+ <item>
+ <title>Import a VRoid Hub avatar with its creator's license honored</title>
+ <link>https://three.ws/docs/vroid-hub-import</link>
+ <guid isPermaLink="false">2026-10-13:Import a VRoid Hub avatar with its creator's license honored</guid>
+ <pubDate>Tue, 13 Oct 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>A new picker at /import/vroid lists every character you own or hearted on VRoid Hub, each scored against the real, live license conditions its creator set (public agent, export, modify, monetize), so three.ws only ever offers an action the creator actually permitted. Built end to end against VRoid Hub's live documented API (OAuth2 with mandatory PKCE, the two-step download-license flow), including encrypted token storage alongside three.ws's other social connections, through to a real import that lands the avatar in the editor with idle/walk already retargeted. VRoid Hub app registration and the OAuth client credentials are an owner action tracked in prompts/finish/_context/production-100-OWNER-ACTIONS.md; everything else is wired and tested. Docs: /docs/vroid-hub-import.</description>
+ </item>
<item>
<title>Open source credits: every dependency, model, and asset source three.ws runs on, in one place</title>
<link>https://three.ws/open-source</link>
diff --git a/public/features.json b/public/features.json
index 985be61f2..3c04a98a9 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-10-13T17:59:16.310Z",
+ "generated_at": "2026-10-13T18:47:35.231Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
@@ -1797,6 +1797,18 @@
"priority": 0.6,
"job": "make"
},
+ {
+ "path": "/import/vroid",
+ "title": "Import your VRoid Hub avatar",
+ "description": "Bring a VRM avatar from VRoid Hub into three.ws with its creator's license honored: only the actions the creator allowed are ever offered.",
+ "added": "2026-10-13",
+ "auth": null,
+ "indexable": false,
+ "tags": [],
+ "showcase": false,
+ "priority": 0.6,
+ "job": "make"
+ },
{
"path": "/threews/claim",
"title": "Claim threews.sol Subdomain",
@@ -8996,6 +9008,18 @@
"priority": 0.6,
"job": null
},
+ {
+ "path": "/docs/vroid-hub-import",
+ "title": "Docs · Import your VRoid Hub avatar",
+ "description": "How the VRoid Hub avatar import works: OAuth connection, the license badges on each character, and what happens to the file during import.",
+ "added": null,
+ "auth": null,
+ "indexable": true,
+ "tags": [],
+ "showcase": false,
+ "priority": 0.6,
+ "job": null
+ },
{
"path": "/docs/multi-agent",
"title": "Docs · Multi-agent scenes",
diff --git a/public/llms-full.txt b/public/llms-full.txt
index 77e3f7154..7c557939b 100644
--- a/public/llms-full.txt
+++ b/public/llms-full.txt
@@ -888,6 +888,13 @@ Indexable: no (excluded from sitemap)
Import any GLB or glTF avatar into three.ws and give it an agent brain.
+### Import your VRoid Hub avatar
+
+URL: https://three.ws/import/vroid
+Indexable: no (excluded from sitemap)
+
+Bring a VRM avatar from VRoid Hub into three.ws with its creator's license honored: only the actions the creator allowed are ever offered.
+
### Claim threews.sol Subdomain
URL: https://three.ws/threews/claim
@@ -4527,6 +4534,12 @@ URL: https://three.ws/docs/video-to-motion
Upload a video of a person and download the motion itself as a GLB, BVH, or FBX animation file, instead of a composited video. Preview on any rigged avatar, trim it, and save it to your animation library.
+### Docs · Import your VRoid Hub avatar
+
+URL: https://three.ws/docs/vroid-hub-import
+
+How the VRoid Hub avatar import works: OAuth connection, the license badges on each character, and what happens to the file during import.
+
### Docs · Multi-agent scenes
URL: https://three.ws/docs/multi-agent
diff --git a/public/llms.txt b/public/llms.txt
index 1b1370aa7..709f5f6b8 100644
--- a/public/llms.txt
+++ b/public/llms.txt
@@ -101,6 +101,6 @@ Machine-readable entry points. Fetch these instead of scraping HTML.
## Optional
-- [llms-full.txt](https://three.ws/llms-full.txt): Every public page (1009), grouped by section, with full descriptions.
+- [llms-full.txt](https://three.ws/llms-full.txt): Every public page (1010), grouped by section, with full descriptions.
- [Sitemap](https://three.ws/sitemap): The same index for people, with search.
- [sitemap.xml](https://three.ws/sitemap.xml): XML sitemap for crawlers, including every agent and avatar page.
diff --git a/public/sitemap/index.html b/public/sitemap/index.html
index b1a4dc6d5..c94fbd1d8 100644
--- a/public/sitemap/index.html
+++ b/public/sitemap/index.html
@@ -3,16 +3,16 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
-<title>Sitemap · three.ws</title>
-<meta name="description" content="Human-readable index of every page on three.ws." />
+<title data-i18n="sitemap_index.meta_title">Sitemap · three.ws</title>
+<meta name="description" content="Human-readable index of every page on three.ws." data-i18n-attr="content:sitemap_index.meta_description"/>
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1" />
<link rel="canonical" href="https://three.ws/sitemap" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="three.ws" />
<meta property="og:locale" content="en_US" />
<meta property="og:url" content="https://three.ws/sitemap" />
-<meta property="og:title" content="Sitemap · three.ws" />
-<meta property="og:description" content="Human-readable index of every page on three.ws." />
+<meta property="og:title" content="Sitemap · three.ws" data-i18n-attr="content:sitemap_index.meta_og_title"/>
+<meta property="og:description" content="Human-readable index of every page on three.ws." data-i18n-attr="content:sitemap_index.meta_og_description"/>
<meta property="og:image" content="https://three.ws/api/page-og?s=main&amp;t=Sitemap&amp;d=Human-readable+index+of+every+page+on+three.ws.&amp;p=%2Fsitemap" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
@@ -20,8 +20,8 @@
<meta property="og:image:alt" content="Sitemap - three.ws" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@trythreews" />
-<meta name="twitter:title" content="Sitemap · three.ws" />
-<meta name="twitter:description" content="Human-readable index of every page on three.ws." />
+<meta name="twitter:title" content="Sitemap · three.ws" data-i18n-attr="content:sitemap_index.meta_twitter_title"/>
+<meta name="twitter:description" content="Human-readable index of every page on three.ws." data-i18n-attr="content:sitemap_index.meta_twitter_description"/>
<meta name="twitter:image" content="https://three.ws/api/page-og?s=main&amp;t=Sitemap&amp;d=Human-readable+index+of+every+page+on+three.ws.&amp;p=%2Fsitemap" />
<script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"Sitemap","description":"Human-readable index of every page on three.ws.","url":"https://three.ws/sitemap","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap"}]}</script>
<link rel="alternate" type="application/xml" title="XML sitemap" href="/sitemap.xml" />
@@ -95,27 +95,27 @@
<header><div id="nav-container"></div></header>
<main class="sm-wrap">
<div class="sm-hero">
- <h1>Sitemap</h1>
- <p><span>1070</span> <span data-i18n="sitemap_index.pages_grouped">pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</span></p>
+ <h1 data-i18n="sitemap_index.sitemap">Sitemap</h1>
+ <p><span>1072</span> <span data-i18n="sitemap_index.pages_grouped">pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</span></p>
<div class="sm-formats">
- <a href="/everything"><code>/everything</code> · browse by goal, not by section</a>
- <a href="/sitemap.xml"><code>sitemap.xml</code> · for search engines</a>
- <a href="/llms.txt"><code>llms.txt</code> · for AI agents</a>
- <a href="/llms-full.txt"><code>llms-full.txt</code> · long form</a>
- <a href="/api/features.json"><code>features.json</code> · machine manifest</a>
- <a href="/changelog"><code>changelog</code> · what's new</a>
- <a href="/openapi.json"><code>openapi.json</code> · HTTP API</a>
+ <a href="/everything" data-i18n-html="sitemap_index.browse_by_goal_not_by_section"><code>/everything</code> · browse by goal, not by section</a>
+ <a href="/sitemap.xml" data-i18n-html="sitemap_index.for_search_engines"><code>sitemap.xml</code> · for search engines</a>
+ <a href="/llms.txt" data-i18n-html="sitemap_index.for_ai_agents"><code>llms.txt</code> · for AI agents</a>
+ <a href="/llms-full.txt" data-i18n-html="sitemap_index.long_form"><code>llms-full.txt</code> · long form</a>
+ <a href="/api/features.json" data-i18n-html="sitemap_index.machine_manifest"><code>features.json</code> · machine manifest</a>
+ <a href="/changelog" data-i18n-html="sitemap_index.what_s_new"><code>changelog</code> · what's new</a>
+ <a href="/openapi.json" data-i18n-html="sitemap_index.http_api"><code>openapi.json</code> · HTTP API</a>
</div>
</div>
<div class="sm-filter">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/></svg>
- <input id="sm-filter-input" type="search" placeholder="Filter 1070 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />
+ <input id="sm-filter-input" type="search" placeholder="Filter 1072 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />
<kbd id="sm-filter-kbd" aria-hidden="true">/</kbd>
</div>
<p class="sm-filter-count" role="status" aria-live="polite"><span id="sm-filter-count"></span><span id="sm-filter-hint" aria-hidden="true"></span></p>
<section class="sm-new" id="sm-new" aria-labelledby="sm-new-title">
- <h2 id="sm-new-title">Newest<a class="sm-new-more" href="/changelog">full changelog &rarr;</a></h2>
- <p class="sm-section-desc">The 9 most recently launched pages, straight to the live surface.</p>
+ <h2 id="sm-new-title" data-i18n-html="sitemap_index.newestfull_changelog">Newest<a class="sm-new-more" href="/changelog">full changelog &rarr;</a></h2>
+ <p class="sm-section-desc" data-i18n="sitemap_index.the_9_most_recently_launched_pages_straight">The 9 most recently launched pages, straight to the live surface.</p>
<ul class="sm-list">
<li>
<a href="/video-to-motion">
@@ -192,22 +192,22 @@
</ul>
</section>
<nav class="sm-toc" aria-label="Sections">
- <a href="#main">Main</a>
- <a href="#build">Build</a>
- <a href="#labs">Labs</a>
- <a href="#crypto">Crypto</a>
- <a href="#agent-tools">Agent Tools</a>
- <a href="#account">Account</a>
- <a href="#learn">Learn</a>
- <a href="#blog">Blog</a>
- <a href="#legal">Legal</a>
- <a href="#machine">Machine-readable</a>
- <a href="#news">News</a>
+ <a href="#main" data-i18n="sitemap_index.main">Main</a>
+ <a href="#build" data-i18n="sitemap_index.build">Build</a>
+ <a href="#labs" data-i18n="sitemap_index.labs">Labs</a>
+ <a href="#crypto" data-i18n="sitemap_index.crypto">Crypto</a>
+ <a href="#agent-tools" data-i18n="sitemap_index.agent_tools">Agent Tools</a>
+ <a href="#account" data-i18n="sitemap_index.account">Account</a>
+ <a href="#learn" data-i18n="sitemap_index.learn">Learn</a>
+ <a href="#blog" data-i18n="sitemap_index.blog">Blog</a>
+ <a href="#legal" data-i18n="sitemap_index.legal">Legal</a>
+ <a href="#machine" data-i18n="sitemap_index.machine_readable">Machine-readable</a>
+ <a href="#news" data-i18n="sitemap_index.news">News</a>
</nav>
<section class="sm-section" id="main">
<header>
<h2><span data-i18n="sitemap_index.section_main">Main</span><span class="sm-count" data-count>73</span></h2>
- <p class="sm-section-desc">Entry points into the product.</p>
+ <p class="sm-section-desc" data-i18n="sitemap_index.entry_points_into_the_product">Entry points into the product.</p>
</header>
<ul class="sm-list">
<li>
@@ -726,8 +726,8 @@
<section class="sm-section" id="build">
<header>
- <h2><span data-i18n="sitemap_index.section_build">Build</span><span class="sm-count" data-count>93</span></h2>
- <p class="sm-section-desc">Create and customize an agent.</p>
+ <h2><span data-i18n="sitemap_index.section_build">Build</span><span class="sm-count" data-count>94</span></h2>
+ <p class="sm-section-desc" data-i18n="sitemap_index.create_and_customize_an_agent">Create and customize an agent.</p>
</header>
<ul class="sm-list">
<li>
@@ -1199,6 +1199,13 @@
<span class="sm-desc" data-i18n="sitemap_index.d_import_rpm">Import any GLB or glTF avatar into three.ws and give it an agent brain.</span>
</a>
</li>
+ <li>
+ <a href="/import/vroid">
+ <span class="sm-title"><span data-i18n="sitemap_index.t_import_vroid">Import your VRoid Hub avatar</span><span class="sm-badge sm-badge-internal" data-i18n="sitemap_index.badge_internal">internal</span></span>
+ <span class="sm-path" translate="no">/import/vroid</span>
+ <span class="sm-desc" data-i18n="sitemap_index.d_import_vroid">Bring a VRM avatar from VRoid Hub into three.ws with its creator's license honored: only the actions the creator allowed are ever offered.</span>
+ </a>
+ </li>
<li>
<a href="/threews/claim">
<span class="sm-title"><span data-i18n="sitemap_index.t_threews_claim">Claim threews.sol Subdomain</span></span>
@@ -1387,7 +1394,7 @@
<section class="sm-section" id="labs">
<header>
<h2><span data-i18n="sitemap_index.section_labs">Labs</span><span class="sm-count" data-count>26</span></h2>
- <p class="sm-section-desc">Experimental features actively shipping. Expect fast iteration.</p>
+ <p class="sm-section-desc" data-i18n="sitemap_index.experimental_features_actively_shipping_expe">Experimental features actively shipping. Expect fast iteration.</p>
</header>
<ul class="sm-list">
<li>
@@ -1578,7 +1585,7 @@
<section class="sm-section" id="crypto">
<header>
<h2><span data-i18n="sitemap_index.section_crypto">Crypto</span><span class="sm-count" data-count>170</span></h2>
- <p class="sm-section-desc">On-chain features: pay-per-call, token launches, vanity wallets.</p>
+ <p class="sm-section-desc" data-i18n="sitemap_index.on_chain_features_pay_per_call_token">On-chain features: pay-per-call, token launches, vanity wallets.</p>
</header>
<ul class="sm-list">
<li>
@@ -2777,7 +2784,7 @@
<section class="sm-section" id="agent-tools">
<header>
<h2><span data-i18n="sitemap_index.section_agent-tools">Agent Tools</span><span class="sm-count" data-count>11</span></h2>
- <p class="sm-section-desc">Manage, talk to, and deploy individual agents.</p>
+ <p class="sm-section-desc" data-i18n="sitemap_index.manage_talk_to_and_deploy_individual_agents">Manage, talk to, and deploy individual agents.</p>
</header>
<ul class="sm-list">
<li>
@@ -2863,7 +2870,7 @@
<section class="sm-section" id="account">
<header>
<h2><span data-i18n="sitemap_index.section_account">Account</span><span class="sm-count" data-count>15</span></h2>
- <p class="sm-section-desc">Sign-in, dashboard, billing.</p>
+ <p class="sm-section-desc" data-i18n="sitemap_index.sign_in_dashboard_billing">Sign-in, dashboard, billing.</p>
</header>
<ul class="sm-list">
<li>
@@ -2976,8 +2983,8 @@
<section class="sm-section" id="learn">
<header>
- <h2><span data-i18n="sitemap_index.section_learn">Learn</span><span class="sm-count" data-count>504</span></h2>
- <p class="sm-section-desc">Docs, tutorials, and reference.</p>
+ <h2><span data-i18n="sitemap_index.section_learn">Learn</span><span class="sm-count" data-count>505</span></h2>
+ <p class="sm-section-desc" data-i18n="sitemap_index.docs_tutorials_and_reference">Docs, tutorials, and reference.</p>
</header>
<ul class="sm-list">
<li>
@@ -5423,6 +5430,13 @@
<span class="sm-desc" data-i18n="sitemap_index.d_docs_video_to_motion">Upload a video of a person and download the motion itself as a GLB, BVH, or FBX animation file, instead of a composited video. Preview on any rigged avatar, trim it, and save it to your animation library.</span>
</a>
</li>
+ <li>
+ <a href="/docs/vroid-hub-import">
+ <span class="sm-title"><span data-i18n="sitemap_index.t_docs_vroid_hub_import">Docs · Import your VRoid Hub avatar</span></span>
+ <span class="sm-path" translate="no">/docs/vroid-hub-import</span>
+ <span class="sm-desc" data-i18n="sitemap_index.d_docs_vroid_hub_import">How the VRoid Hub avatar import works: OAuth connection, the license badges on each character, and what happens to the file during import.</span>
+ </a>
+ </li>
<li>
<a href="/docs/multi-agent">
<span class="sm-title"><span data-i18n="sitemap_index.t_docs_multi_agent">Docs · Multi-agent scenes</span></span>
@@ -6514,7 +6528,7 @@
<section class="sm-section" id="blog">
<header>
<h2><span data-i18n="sitemap_index.section_blog">Blog</span><span class="sm-count" data-count>39</span></h2>
- <p class="sm-section-desc">Long-form announcements, launches, and writing from three.ws.</p>
+ <p class="sm-section-desc" data-i18n="sitemap_index.long_form_announcements_launches_and_writing">Long-form announcements, launches, and writing from three.ws.</p>
</header>
<ul class="sm-list">
<li>
@@ -6868,7 +6882,7 @@
<section class="sm-section" id="machine">
<header>
<h2><span data-i18n="sitemap_index.section_machine">Machine-readable</span><span class="sm-count" data-count>18</span></h2>
- <p class="sm-section-desc">Indexes and well-known files for crawlers and AI agents.</p>
+ <p class="sm-section-desc" data-i18n="sitemap_index.indexes_and_well_known_files_for_crawlers">Indexes and well-known files for crawlers and AI agents.</p>
</header>
<ul class="sm-list">
<li>
@@ -7003,7 +7017,7 @@
<section class="sm-section" id="news">
<header>
<h2><span data-i18n="sitemap_index.section_news">News</span><span class="sm-count" data-count>112</span></h2>
- <p class="sm-section-desc">Product launches, integrations, and announcements from three.ws.</p>
+ <p class="sm-section-desc" data-i18n="sitemap_index.product_launches_integrations_and_announceme">Product launches, integrations, and announcements from three.ws.</p>
</header>
<ul class="sm-list">
<li>
@@ -7794,10 +7808,10 @@
</section>
<div class="sm-empty" id="sm-empty" hidden>
<p><span data-i18n="sitemap_index.no_pages_match">No pages match</span> &ldquo;<span id="sm-empty-q"></span>&rdquo;.</p>
- <p class="sm-empty-hint">Try a shorter word, or search everything: global search covers agents, coins, and skills too.</p>
+ <p class="sm-empty-hint" data-i18n="sitemap_index.try_a_shorter_word_or_search_everything">Try a shorter word, or search everything: global search covers agents, coins, and skills too.</p>
<div class="sm-empty-actions">
- <button type="button" id="sm-empty-clear">Clear filter</button>
- <a id="sm-empty-search" href="/search">Search all of three.ws</a>
+ <button type="button" id="sm-empty-clear" data-i18n="sitemap_index.clear_filter">Clear filter</button>
+ <a id="sm-empty-search" href="/search" data-i18n="sitemap_index.search_all_of_three_ws">Search all of three.ws</a>
</div>
</div>
</main>
diff --git a/tests/vroid-license.test.js b/tests/vroid-license.test.js
new file mode 100644
index 000000000..f70acf051
--- /dev/null
+++ b/tests/vroid-license.test.js
@@ -0,0 +1,87 @@
+import { describe, it, expect } from 'vitest';
+
+import { normalizeLicense, evaluateLicense, creditLineFor } from '../api/_lib/vroid/license.js';
+
+describe('vroid license normalization', () => {
+ it('defaults every field closed when no license is present', () => {
+ const license = normalizeLicense(null);
+ expect(license.characterization_allowed_user).toBe('default');
+ expect(license.modification).toBe('default');
+ expect(license.redistribution).toBe('default');
+ expect(license.credit).toBe('default');
+ });
+
+ it('drops unrecognized enum values back to default rather than passing them through', () => {
+ const license = normalizeLicense({ modification: 'sure-why-not', credit: 'necessary' });
+ expect(license.modification).toBe('default');
+ expect(license.credit).toBe('necessary');
+ });
+});
+
+describe('vroid license to three.ws actions', () => {
+ it('grants nothing for a fully closed (all-default) license, and requires credit', () => {
+ const result = evaluateLicense(null);
+ expect(result.actions).toEqual({
+ public_agent: false,
+ export: false,
+ modify: false,
+ monetize_personal: false,
+ monetize_corporate: false,
+ });
+ expect(result.creditRequired).toBe(true);
+ expect(result.summary).toHaveLength(5);
+ });
+
+ it('opens exactly the actions a fully-permissive license allows', () => {
+ const result = evaluateLicense({
+ characterization_allowed_user: 'everyone',
+ redistribution: 'allow',
+ modification: 'allow',
+ personal_commercial_use: 'profit',
+ corporate_commercial_use: 'allow',
+ credit: 'unnecessary',
+ });
+ expect(result.actions).toEqual({
+ public_agent: true,
+ export: true,
+ modify: true,
+ monetize_personal: true,
+ monetize_corporate: true,
+ });
+ expect(result.creditRequired).toBe(false);
+ });
+
+ it('restricting characterization to the author only blocks public_agent, independent of other grants', () => {
+ const result = evaluateLicense({
+ characterization_allowed_user: 'author',
+ redistribution: 'allow',
+ modification: 'allow',
+ });
+ expect(result.actions.public_agent).toBe(false);
+ expect(result.actions.export).toBe(true);
+ expect(result.actions.modify).toBe(true);
+ });
+
+ it('personal_commercial_use=nonprofit does not open monetize_personal', () => {
+ const result = evaluateLicense({ personal_commercial_use: 'nonprofit' });
+ expect(result.actions.monetize_personal).toBe(false);
+ });
+
+ it('a license that explicitly marks credit unnecessary does not require it, but ambiguity does', () => {
+ expect(evaluateLicense({ credit: 'unnecessary' }).creditRequired).toBe(false);
+ expect(evaluateLicense({ credit: 'necessary' }).creditRequired).toBe(true);
+ expect(evaluateLicense({}).creditRequired).toBe(true);
+ });
+});
+
+describe('credit line copy', () => {
+ it('names the creator and character when known', () => {
+ expect(creditLineFor({ creatorName: 'Alex', characterName: 'Mika' })).toBe(
+ '"Mika" by Alex, imported from VRoid Hub.',
+ );
+ });
+
+ it('falls back to generic copy when creator/character are unknown', () => {
+ expect(creditLineFor({})).toBe('This avatar by its VRoid Hub creator, imported from VRoid Hub.');
+ });
+});
diff --git a/vercel.json b/vercel.json
index 46dd1754b..04d321077 100644
--- a/vercel.json
+++ b/vercel.json
@@ -3807,6 +3807,22 @@
"src": "/api/auth/github/disconnect",
"dest": "/api/auth/github/[action]?action=disconnect"
},
+ {
+ "src": "/api/auth/vroid/connect",
+ "dest": "/api/auth/vroid/[action]?action=connect"
+ },
+ {
+ "src": "/api/auth/vroid/callback",
+ "dest": "/api/auth/vroid/[action]?action=callback"
+ },
+ {
+ "src": "/api/auth/vroid/status",
+ "dest": "/api/auth/vroid/[action]?action=status"
+ },
+ {
+ "src": "/api/auth/vroid/disconnect",
+ "dest": "/api/auth/vroid/[action]?action=disconnect"
+ },
{
"src": "/api/auth/x/connect",
"dest": "/api/auth/x/[action]?action=connect"
@@ -6209,6 +6225,14 @@
"src": "/import/rpm/",
"dest": "/import-rpm.html"
},
+ {
+ "src": "/import/vroid",
+ "dest": "/import-vroid.html"
+ },
+ {
+ "src": "/import/vroid/",
+ "dest": "/import-vroid.html"
+ },
{
"src": "/create/video/?",
"dest": "/create/video.html"
diff --git a/vite.config.js b/vite.config.js
index 029a80e1b..019b0dd50 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -812,6 +812,7 @@ const appConfig = {
'avatar-studio': resolve(__dirname, 'pages/avatar-studio.html'),
'create-review': resolve(__dirname, 'pages/create-review.html'),
'import-rpm': resolve(__dirname, 'pages/import-rpm.html'),
+ 'import-vroid': resolve(__dirname, 'pages/import-vroid.html'),
marketplace: resolve(__dirname, 'pages/marketplace.html'),
'agent-market': resolve(__dirname, 'pages/agent-market.html'),
'marketplace-walk': resolve(__dirname, 'pages/marketplace-walk.html'),
@@ -1647,6 +1648,8 @@ const appConfig = {
'/create-review/': resolve(root, 'pages/create-review.html'),
'/import/rpm': resolve(root, 'pages/import-rpm.html'),
'/import/rpm/': resolve(root, 'pages/import-rpm.html'),
+ '/import/vroid': resolve(root, 'pages/import-vroid.html'),
+ '/import/vroid/': resolve(root, 'pages/import-vroid.html'),
'/dashboard': resolve(root, 'pages/dashboard-next/index.html'),
'/dashboard/': resolve(root, 'pages/dashboard-next/index.html'),
'/dashboard-classic': null,