/* ===================================================================== 아바타 v3 리그 레지스트리 — 결정문 §8.5 "분기". 페르소나 코드 → 리노컷 리그. 세션용(linocutRigFor)은 오케스트레이터가 표정 시트를 판정한 페르소나만 켠다 — 2026-10-01 P1~P7 전원(결정문 §8.4.1). 목록에 없으면 null(기존 SVG). 빌드 플래그 VITE_AVATAR_V3=0 이면 항상 null(기본은 켜짐). ===================================================================== */ import type { LinocutRig } from "../linocutRig"; import { P1_LINOCUT_RIG } from "./p1Rig"; import { P2_LINOCUT_RIG } from "./p2Rig"; import { P3_LINOCUT_RIG } from "./p3Rig"; import { P4_LINOCUT_RIG } from "./p4Rig"; import { P5_LINOCUT_RIG } from "./p5Rig"; import { P6_LINOCUT_RIG } from "./p6Rig"; import { P7_LINOCUT_RIG } from "./p7Rig"; const LINOCUT_RIGS: Partial> = { P1: P1_LINOCUT_RIG, P2: P2_LINOCUT_RIG, P3: P3_LINOCUT_RIG, P4: P4_LINOCUT_RIG, P5: P5_LINOCUT_RIG, P6: P6_LINOCUT_RIG, P7: P7_LINOCUT_RIG, }; export function linocutRigFor(code: string | null | undefined): LinocutRig | null { if (import.meta.env.VITE_AVATAR_V3 === "0") return null; if (!code) return null; return LINOCUT_RIGS[code.toUpperCase()] ?? null; } /* Lab(AvatarLab.tsx)용 — 공통 파이프라인(scripts/export_rig.py)이 만드는 ./pN Rig.ts를 전부 모아 rig.persona로 색인한다. 세션 화면(linocutRigFor)과는 무관하다 — persona.json이 아직 없는 pNRig.ts가 생기는 즉시 Lab 선택지에 나타나지만, 세션에는 영향이 없다(세션은 위 LINOCUT_RIGS 목록만 본다). */ const labRigModules = import.meta.glob("./p*Rig.ts", { eager: true }) as Record>; export function labLinocutRigs(): Partial> { const out: Partial> = {}; for (const mod of Object.values(labRigModules)) { for (const exported of Object.values(mod)) { const rig = exported as Partial | null; if (rig && typeof rig === "object" && rig.schemaVersion === "vignette.avatar.v3.rig.v1" && typeof rig.persona === "string") { out[rig.persona.toUpperCase()] = rig as LinocutRig; } } } return out; }