How acm-projects/agentic-detective works
Agentic Detective is a browser-based mystery game: players configure a case, investigate suspects through natural-language interrogation, collect clues, and make a final accusation under a timer. Its runtime separates case generation and game state from routed screens, clue/notification mechanics, and voice services. The README also describes stress, voice input, shared suspect portraits, save/community features, and minigames. Some of those branches are documented or indexed but their implementation details were not sampled, so their connections are limited to supported evidence.
Main entry points: useGameStore.ts Game state · App.tsx Route shell · Interrogate.tsx Suspect interviews · NewGame.tsx New case setup
Components 23
Game experience
- Route shell
src/App.tsx - New case setup
src/NewGame.tsx - Case loading
src/LoadingScreen.tsx - Investigation desk
src/desk/DeskMessage.tsx - Suspect interviews
src/Interrogate.tsx - Final accusation
src/Accuse.tsx - Case report
src/CaseReportScreen.tsx - Suspect roster
src/Suspects.tsx - Shared cases
src/Community.tsx
Mystery and state
- Game state
src/useGameStore.ts - Case generation
src/caseFile.ts - Portrait renderer
src/components/SuspectPortrait.tsx
Evidence and tools
- Clue book
src/ClueBook.tsx - Clue scheduler state
src/store/useNotificationStore.ts - Notification scheduler
src/services/useNotificationScheduler.ts - Clue minigames
src/components/minigames - Saved games
src/components/savegamelist/SavedGamesList.tsx
AI and voice
- Model service
src/services/ai.ts - Speech synthesis
src/services/ttsService.ts - Voice input
src/services/speechToText.ts
Other components
- Player
- ElevenLabs
- LLM provider
Connections 31
- Player → Route shell: plays
- Route shell → New case setup: routes to
src/App.tsx - Route shell → Case loading: routes to
src/App.tsx - Route shell → Investigation desk: routes to
src/App.tsx - Route shell → Suspect interviews: routes to
src/App.tsx - Route shell → Final accusation: routes to
src/App.tsx - Route shell → Case report: routes to
src/App.tsx - Route shell → Clue book: routes to
src/App.tsx - Route shell → Suspect roster: routes to
src/App.tsx - New case setup → Game state: sets up
src/NewGame.tsx - New case setup → Saved games: shows saves
src/NewGame.tsx - New case setup → Shared cases: offers sharing
src/NewGame.tsx - Case loading → New case setup: continues to
src/LoadingScreen.tsx - Game state → Case generation: generates case
src/useGameStore.ts - Case generation → Model service: calls model
src/caseFile.ts - Model service → LLM provider: requests completion
- Game state → Model service: calls for replies
src/useGameStore.ts - Game state → Speech synthesis: requests speech
src/useGameStore.ts - Speech synthesis → ElevenLabs: streams audio
src/services/ttsService.ts - Suspect interviews → Game state: reads and updates
src/Interrogate.tsx - Suspect interviews → Voice input: captures questions
src/Interrogate.tsx - Suspect interviews → Portrait renderer: renders suspect
src/Interrogate.tsx - Suspect interviews → Notification scheduler: drives schedule
src/Interrogate.tsx - Notification scheduler → Clue scheduler state: ticks and purges
src/services/useNotificationScheduler.ts - Clue book → Game state: reads case state
src/ClueBook.tsx - Clue book → Clue scheduler state: reads clues
src/ClueBook.tsx - Clue scheduler state → Game state: posts progress
src/store/useNotificationStore.ts - Clue scheduler state → Clue minigames: opens games
src/components/minigames/MinigameModal.tsx - Final accusation → Game state: submits accusation
src/Accuse.tsx - Case report → Game state: reads case result
src/CaseReportScreen.tsx - Suspect roster → Game state: reads suspects
src/Suspects.tsx