SSOT 대시보드:
- 한신대 기술분석 PDF(19쪽) 정합성 분석 + 이번 세션 발견 섹션 추가
- 섹션 폴드아웃(접기)·상단 목차(드릴다운)·모두 펼치기/접기 — 내용 보존, 레이아웃만 정리
페르소나 반응 강화('저항·반응 조절' 핵심 차별):
- PersonaCard.triggers(역린) 필드 + CCD 핵심상처 파생 역린 블록
- L0에 무례·모욕·조롱 시 현실적 동맹 균열 반응 지침
버그·성능 수정(라이브/E2E로 포착):
- 게이트웨이 페르소나 격리: --append-system-prompt를 --system-prompt(교체)로 + --exclude-dynamic-system-prompt-sections (내담자 캐릭터 붕괴·개발맥락 누출 차단)
- RAG: 임베더 동기 로드(약 7-13초)를 _warm_rag_caches 백그라운드 warm으로(세션 생성 블로킹 회귀 수정)
- voice TTS RMS 데드힌트 제거, init_state OpennessParams 파라미터객체화
- 한국어 PII(날짜·금액·주소) 마스킹 보강
- 레이아웃 시각 게이트: 폼 컨트롤 값 스크롤 오탐 제외(7/7)
검증: 백엔드 84/84, E2E 42(데스크톱 27·모바일 11·아바타 4), 시각 게이트 7/7
83 lines
2 KiB
TypeScript
83 lines
2 KiB
TypeScript
import { useEffect, useRef, useState } from "react";
|
|
import type { AffectParams } from "./persona";
|
|
|
|
const NUMERIC_PARAM_KEYS = [
|
|
"eyelidDrop",
|
|
"eyeOpen",
|
|
"pupilScale",
|
|
"gazeAvert",
|
|
"headTilt",
|
|
"shoulderTurn",
|
|
"breathPeriod",
|
|
"breathAmp",
|
|
"auraOpacity",
|
|
"blinkMin",
|
|
"blinkMax",
|
|
"mouthCurve",
|
|
"mouthOpen",
|
|
"mouthWidth",
|
|
"mouthTension",
|
|
"browTilt",
|
|
"browLift",
|
|
"browPinch",
|
|
] as const satisfies readonly (keyof AffectParams)[];
|
|
|
|
export interface ExpressionTransitionFrame {
|
|
params: AffectParams;
|
|
progress: number;
|
|
active: boolean;
|
|
}
|
|
|
|
function easeOutCubic(t: number): number {
|
|
return 1 - Math.pow(1 - t, 3);
|
|
}
|
|
|
|
function interpolateParams(from: AffectParams, to: AffectParams, progress: number): AffectParams {
|
|
const eased = easeOutCubic(progress);
|
|
const next: AffectParams = { ...to };
|
|
for (const key of NUMERIC_PARAM_KEYS) {
|
|
next[key] = from[key] + (to[key] - from[key]) * eased;
|
|
}
|
|
return next;
|
|
}
|
|
|
|
export function useExpressionTransition(
|
|
target: AffectParams,
|
|
fadeInMs: number,
|
|
enabled: boolean,
|
|
): ExpressionTransitionFrame {
|
|
const [frame, setFrame] = useState<ExpressionTransitionFrame>({
|
|
params: target,
|
|
progress: 1,
|
|
active: false,
|
|
});
|
|
const currentRef = useRef(target);
|
|
|
|
useEffect(() => {
|
|
if (!enabled) {
|
|
currentRef.current = target;
|
|
setFrame({ params: target, progress: 1, active: false });
|
|
return;
|
|
}
|
|
|
|
let raf = 0;
|
|
const from = currentRef.current;
|
|
const duration = Math.max(80, fadeInMs);
|
|
const startedAt = performance.now();
|
|
|
|
const tick = (now: number) => {
|
|
const progress = Math.min(1, (now - startedAt) / duration);
|
|
const params = interpolateParams(from, target, progress);
|
|
currentRef.current = params;
|
|
setFrame({ params, progress, active: progress < 1 });
|
|
if (progress < 1) {
|
|
raf = requestAnimationFrame(tick);
|
|
}
|
|
};
|
|
|
|
raf = requestAnimationFrame(tick);
|
|
return () => cancelAnimationFrame(raf);
|
|
}, [enabled, fadeInMs, target]);
|
|
|
|
return frame;
|
|
}
|