Replace console.warn with the structured logger already imported and used
throughout server.ts, keeping the logging style consistent with other
warn calls in the file.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add getActiveSessionId callback to BotConfig interface
- Add tmi.d.ts module declaration (tmi.js 1.8.5 ships no TypeScript types)
- Import Client and ChatUserstate from tmi.js via named imports
- Replace connectIRC stub with real tmi.Client setup: identity, channel subscription, message handler
- Message handler resolves active session ID per-message and delegates to forwardCommand
- Add forwardCommand: routes press/present/vote/sentence to court API endpoints via fetch
- Update stop() to disconnect tmi.Client and null the field
- Add getActiveSessionId: async () => null stub to initTwitchBot env-var fallback config
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Delegates parseCommand to parseChatCommand from commands.ts after rate-limit
check, aligns ParsedCommand.params to required (matching CommandParseResult),
and adds bot.test.ts with 5 passing unit tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace hard-coded PAUSE_MS delays after generated turns with pauses
calculated from dialogue length at 200 characters-per-minute, firing
the next LLM call at 80% of display time (pre-fetch ratio) so the
response arrives just as the current line finishes rendering.
Also set the client typewriter to 200 CPM (from 48 chars/sec) so
server and renderer stay in sync.
- Add DISPLAY_CPM=200, PREFETCH_RATIO=0.8, displayPauseMs() to session-flow.ts
- Remove openingBetweenSides, witnessBetweenTurns, closingBetweenSides from PAUSE_MS
- Capture generateBudgetedTurn return value wherever a post-turn pause follows
- runRandomEvent now returns Promise<CourtTurn> so callers can pace by it
- Remove redundant pre-bailiff pause (witnessBetweenCycles covers witness gaps)
- public/app.js: TYPEWRITER_CHARS_PER_SECOND = 200 / 60
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the single hardcoded string per category in mockReply with module-level
MOCK_LINES / MOCK_LINES_DEFAULT pools (5-6 generic lines each) and a pickRandom
helper, eliminating repetitive output during live runs. Loosen the brittle test
assertion from a literal string match to a non-empty check.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace hardcoded old agent IDs ('chora', 'subrosa', 'thaum', 'praxis',
'mux', 'primus') with their AA character equivalents ('phoenix',
'edgeworth', 'maya', 'apollo', 'gumshoe', 'godot') across all test
files. Also updates orchestrator.test.ts to use participantsFromRoleAssignments(assignCourtRoles()) pattern and import.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Step-by-step TDD plan for replacing abstract agents with 13 Ace Attorney
characters, including transcript sampler, archetype pool casting, and
async prompt injection.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Captures the approved design for replacing abstract agents with 13 Ace
Attorney characters, including roster, role archetypes, runtime transcript
sampling, and prompt integration plan.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>