라이어 게임: 토론 채팅을 게임 내내 열기, 설명은 별도 describe 액션으로

- chat은 확인 시간·설명 중(말하는 사람 포함)·토론·투표·정답 맞히기 내내 모두 쓸 수 있다
- 설명은 새 describe 액션(차례인 사람만, 80자). 채팅에 쓴 말은 설명으로 치지 않는다
- 자기 제시어 금지·고운 말 검사는 설명과 채팅 모두 그대로
- 컴퓨터 설명도 describe로 보내고, 모델이 켜져 있으면 "입력 중…" 뒤에 보낸다
- 화면: 채팅 입력칸을 항상 보이게, 설명 차례인 사람에게는 채팅 칸 안내 문구
- 문서(docs/games/liar.md)와 테스트 갱신

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-18 01:20:38 +09:00
parent e9bc366305
commit fcc79f05bc
10 changed files with 81 additions and 61 deletions

View File

@@ -226,8 +226,9 @@ export class BotDriver {
if (!def.validate(g.state, bot, decision.action, { now }).ok) continue; // the moment passed (phase changed); look again later
const brain = this.room.brain;
const say = decision.action as { type?: string; channel?: string; text?: string };
if (brain && say.type === 'chat' && brain.enabled()) {
this.typeLive(brain, bot, say as { type: 'chat'; channel: string; text: string }, decision.hint ?? null, names, g);
// 라이어 게임's description is typed like a chat line too ("입력 중…" before it appears).
if (brain && (say.type === 'chat' || say.type === 'describe') && brain.enabled()) {
this.typeLive(brain, bot, say as { type: 'chat' | 'describe'; channel: string; text: string }, decision.hint ?? null, names, g);
continue;
}
const err = this.room.run(bot, decision.action);
@@ -240,7 +241,7 @@ export class BotDriver {
* Live chat like a person: the model may say the planned line in the computer's own words, then "입력 중…" for the
* typing time, then it is sent (if it still may be: the phase can end meanwhile).
*/
private typeLive(brain: BotBrain, bot: string, chat: { type: 'chat'; channel: string; text: string }, hint: string | null, names: Record<string, string>, g: unknown): void {
private typeLive(brain: BotBrain, bot: string, chat: { type: 'chat' | 'describe'; channel: string; text: string }, hint: string | null, names: Record<string, string>, g: unknown): void {
this.liveBusy.add(bot);
const view = this.room.def.view(this.room.game!.state, bot) as { chat?: { channel: string; from: string; text: string }[] };
const recent = (view.chat ?? []).filter((m) => m.channel === chat.channel).slice(-8).map((m) => ({ from: names[m.from] ?? '누군가', text: m.text }));

View File

@@ -74,7 +74,7 @@ describe('라이어 게임 room flow with computers', () => {
const speaker = () => GAMES.liar!.view(state(), null).phase.speaker;
while (state().phase.kind === 'describe') {
if (speaker() === 'A') {
room.act('A', cs++, { type: 'chat', text: iAmLiar ? '저는 좋아하는 편이에요' : '음 다들 아실 거예요' });
room.act('A', cs++, { type: 'describe', text: iAmLiar ? '저는 좋아하는 편이에요' : '음 다들 아실 거예요' });
described++;
}
run(() => state().phase.kind !== 'describe' || speaker() === 'A');