# lg-epitech/yapd architecture

> Architecture diagram of the GitHub repository lg-epitech/yapd, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lg-epitech/yapd
- Repository: https://github.com/lg-epitech/yapd

## Overview

yapd is a macOS daemon that turns completed Claude Code and Codex sessions into prioritized spoken summaries, then listens for interruptions and routes follow-ups back to the originating session. The graph follows the documented flow and sampled ownership: the daemon receives hook events, prepares updates, and delegates playback/conversation; conversation sends follow-ups through relays. README-described provider and speech capabilities are included, but unsampled internals are linked only where the source or documentation supports the relationship.

Main entry points: [`src/Conversation.ts`](https://github.com/lg-epitech/yapd/blob/master/src/Conversation.ts) (Spoken conversation), [`src/Daemon.ts`](https://github.com/lg-epitech/yapd/blob/master/src/Daemon.ts) (Update coordinator), [`src/Relay.ts`](https://github.com/lg-epitech/yapd/blob/master/src/Relay.ts) (Relay selection), [`src/Audio.ts`](https://github.com/lg-epitech/yapd/blob/master/src/Audio.ts) (Audio playback)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Event intake"]
  node_main["CLI and wiring<br/>[main.ts]"]
  node_hook["Agent hooks<br/>[Hook.ts]"]
  node_server["Local event server<br/>[Server.ts]"]
  node_daemon["Update coordinator<br/>[Daemon.ts]"]
  node_project["Project naming<br/>[Project.ts]"]
  node_inbox["Priority inbox<br/>[Inbox.ts]"]
end

subgraph group_summary["Summaries and speech"]
  node_condenser["Turn summarizer<br/>[Condenser.ts]"]
  node_model["Provider model<br/>[Model.ts]"]
  node_provider["Provider commands<br/>[Provider.ts]"]
end

subgraph group_conversation["Voice interaction"]
  node_conversation["Spoken conversation<br/>[Conversation.ts]"]
  node_voice["Speech synthesis<br/>[Voice.ts]"]
  node_audio["Audio playback<br/>[Audio.ts]"]
  node_helper["Native audio helper<br/>[Helper.ts]"]
  node_vad["Voice detection<br/>[Vad.ts]"]
  node_endpointer["Speech endpointing<br/>[Endpointer.ts]"]
  node_transcriber["Speech transcription<br/>[Transcriber.ts]"]
  node_responder["Interruption responder<br/>[Responder.ts]"]
end

subgraph group_integrations["Agent integrations"]
  node_relay["Relay selection<br/>[Relay.ts]"]
  node_claude["Claude relay<br/>[ClaudeCode.ts]"]
  node_codex["Codex relay<br/>[Codex.ts]"]
  node_codexserver["Codex app server<br/>[CodexServer.ts]"]
  node_t3code["T3 Code relay<br/>[T3Code.ts]"]
end

node_agent(("Coding agent"))
node_user(("User"))
node_kokoro["Kokoro runtime"]
node_whisper["Whisper runtime"]

node_agent -->|"emits events"| node_hook
node_hook -->|"posts events"| node_server
node_main -->|"starts"| node_server
node_main -->|"runs"| node_daemon
node_server -->|"dispatches events"| node_daemon
node_daemon -->|"names project"| node_project
node_daemon -->|"queues updates"| node_inbox
node_daemon -->|"prepares summary"| node_condenser
node_condenser -->|"requests summary"| node_model
node_model -->|"selects command"| node_provider
node_daemon -->|"speaks updates"| node_conversation
node_conversation -->|"renders speech"| node_voice
node_voice -->|"synthesizes locally"| node_kokoro
node_conversation -->|"plays audio"| node_audio
node_audio -->|"streams audio"| node_helper
node_user -->|"interrupts speech"| node_audio
node_audio -->|"provides microphone frames"| node_vad
node_conversation -->|"segments speech"| node_endpointer
node_conversation -->|"transcribes speech"| node_transcriber
node_transcriber -->|"runs locally"| node_whisper
node_conversation -->|"interprets interruption"| node_responder
node_conversation -->|"sends follow-up"| node_relay
node_relay -->|"dispatches"| node_claude
node_relay -->|"dispatches"| node_codex
node_relay -->|"dispatches"| node_t3code
node_codex -.->|"uses persistent server"| node_codexserver
node_claude -->|"wakes session"| node_agent
node_codex -->|"queues message"| node_agent
node_t3code -->|"dispatches to thread"| node_agent

click node_main "https://github.com/lg-epitech/yapd/blob/master/src/main.ts"
click node_hook "https://github.com/lg-epitech/yapd/blob/master/src/Hook.ts"
click node_server "https://github.com/lg-epitech/yapd/blob/master/src/Server.ts"
click node_daemon "https://github.com/lg-epitech/yapd/blob/master/src/Daemon.ts"
click node_project "https://github.com/lg-epitech/yapd/blob/master/src/Project.ts"
click node_inbox "https://github.com/lg-epitech/yapd/blob/master/src/Inbox.ts"
click node_condenser "https://github.com/lg-epitech/yapd/blob/master/src/Condenser.ts"
click node_model "https://github.com/lg-epitech/yapd/blob/master/src/Model.ts"
click node_provider "https://github.com/lg-epitech/yapd/blob/master/src/Provider.ts"
click node_conversation "https://github.com/lg-epitech/yapd/blob/master/src/Conversation.ts"
click node_voice "https://github.com/lg-epitech/yapd/blob/master/src/Voice.ts"
click node_audio "https://github.com/lg-epitech/yapd/blob/master/src/Audio.ts"
click node_helper "https://github.com/lg-epitech/yapd/blob/master/src/Helper.ts"
click node_vad "https://github.com/lg-epitech/yapd/blob/master/src/Vad.ts"
click node_endpointer "https://github.com/lg-epitech/yapd/blob/master/src/Endpointer.ts"
click node_transcriber "https://github.com/lg-epitech/yapd/blob/master/src/Transcriber.ts"
click node_responder "https://github.com/lg-epitech/yapd/blob/master/src/Responder.ts"
click node_relay "https://github.com/lg-epitech/yapd/blob/master/src/Relay.ts"
click node_claude "https://github.com/lg-epitech/yapd/blob/master/src/ClaudeCode.ts"
click node_codex "https://github.com/lg-epitech/yapd/blob/master/src/Codex.ts"
click node_codexserver "https://github.com/lg-epitech/yapd/blob/master/src/CodexServer.ts"
click node_t3code "https://github.com/lg-epitech/yapd/blob/master/src/T3Code.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_hook,node_server,node_daemon,node_project,node_inbox,node_user toneBlue
class node_condenser,node_model,node_provider toneAmber
class node_conversation,node_voice,node_audio,node_helper,node_vad,node_endpointer,node_transcriber,node_responder toneMint
class node_relay,node_claude,node_codex,node_codexserver,node_t3code toneRose
class node_agent,node_kokoro,node_whisper toneIndigo
```

## Components

### Event intake

- [CLI and wiring](https://github.com/lg-epitech/yapd/blob/master/src/main.ts): `src/main.ts`
- [Agent hooks](https://github.com/lg-epitech/yapd/blob/master/src/Hook.ts): `src/Hook.ts`
- [Local event server](https://github.com/lg-epitech/yapd/blob/master/src/Server.ts): `src/Server.ts`
- [Update coordinator](https://github.com/lg-epitech/yapd/blob/master/src/Daemon.ts): `src/Daemon.ts`
- [Project naming](https://github.com/lg-epitech/yapd/blob/master/src/Project.ts): `src/Project.ts`
- [Priority inbox](https://github.com/lg-epitech/yapd/blob/master/src/Inbox.ts): `src/Inbox.ts`

### Summaries and speech

- [Turn summarizer](https://github.com/lg-epitech/yapd/blob/master/src/Condenser.ts): `src/Condenser.ts`
- [Provider model](https://github.com/lg-epitech/yapd/blob/master/src/Model.ts): `src/Model.ts`
- [Provider commands](https://github.com/lg-epitech/yapd/blob/master/src/Provider.ts): `src/Provider.ts`

### Voice interaction

- [Spoken conversation](https://github.com/lg-epitech/yapd/blob/master/src/Conversation.ts): `src/Conversation.ts`
- [Speech synthesis](https://github.com/lg-epitech/yapd/blob/master/src/Voice.ts): `src/Voice.ts`
- [Audio playback](https://github.com/lg-epitech/yapd/blob/master/src/Audio.ts): `src/Audio.ts`
- [Native audio helper](https://github.com/lg-epitech/yapd/blob/master/src/Helper.ts): `src/Helper.ts`
- [Voice detection](https://github.com/lg-epitech/yapd/blob/master/src/Vad.ts): `src/Vad.ts`
- [Speech endpointing](https://github.com/lg-epitech/yapd/blob/master/src/Endpointer.ts): `src/Endpointer.ts`
- [Speech transcription](https://github.com/lg-epitech/yapd/blob/master/src/Transcriber.ts): `src/Transcriber.ts`
- [Interruption responder](https://github.com/lg-epitech/yapd/blob/master/src/Responder.ts): `src/Responder.ts`

### Agent integrations

- [Relay selection](https://github.com/lg-epitech/yapd/blob/master/src/Relay.ts): `src/Relay.ts`
- [Claude relay](https://github.com/lg-epitech/yapd/blob/master/src/ClaudeCode.ts): `src/ClaudeCode.ts`
- [Codex relay](https://github.com/lg-epitech/yapd/blob/master/src/Codex.ts): `src/Codex.ts`
- [Codex app server](https://github.com/lg-epitech/yapd/blob/master/src/CodexServer.ts): `src/CodexServer.ts`
- [T3 Code relay](https://github.com/lg-epitech/yapd/blob/master/src/T3Code.ts): `src/T3Code.ts`

### Other components

- **Coding agent**
- **User**
- **Kokoro runtime**
- **Whisper runtime**

## Connections

- Coding agent → Agent hooks: emits events
- Agent hooks → Local event server: posts events
- CLI and wiring → Local event server: starts
- CLI and wiring → Update coordinator: runs
- Local event server → Update coordinator: dispatches events
- Update coordinator → Project naming: names project
- Update coordinator → Priority inbox: queues updates
- Update coordinator → Turn summarizer: prepares summary
- Turn summarizer → Provider model: requests summary
- Provider model → Provider commands: selects command
- Update coordinator → Spoken conversation: speaks updates
- Spoken conversation → Speech synthesis: renders speech
- Speech synthesis → Kokoro runtime: synthesizes locally
- Spoken conversation → Audio playback: plays audio
- Audio playback → Native audio helper: streams audio
- User → Audio playback: interrupts speech
- Audio playback → Voice detection: provides microphone frames
- Spoken conversation → Speech endpointing: segments speech
- Spoken conversation → Speech transcription: transcribes speech
- Speech transcription → Whisper runtime: runs locally
- Spoken conversation → Interruption responder: interprets interruption
- Spoken conversation → Relay selection: sends follow-up
- Relay selection → Claude relay: dispatches
- Relay selection → Codex relay: dispatches
- Relay selection → T3 Code relay: dispatches
- Codex relay → Codex app server: uses persistent server
- Claude relay → Coding agent: wakes session
- Codex relay → Coding agent: queues message
- T3 Code relay → Coding agent: dispatches to thread
