@@ -5,38 +5,19 @@ Pragmatic layered architecture: CLI → Core → Adapters.
55## Layered Architecture
66
77```
8- ┌─────────────────────────────────────────────────┐
9- │ CLI Layer (Typer) │
10- │ ┌───────────┐ ┌─────────┐ ┌──────────┐ │
11- │ │ app.py │ │ setup │ │ config │ │
12- │ └─────┬─────┘ └────┬────┘ └────┬─────┘ │
13- │ │ │ │ │
14- │ └─────────────┴────────────┘ │
15- └────────────────────┬────────────────────────────┘
16- │ depends on
17- ↓
18- ┌─────────────────────────────────────────────────┐
19- │ Core Layer (Business Logic) │
20- │ ┌──────────────┐ ┌──────────────────┐ │
21- │ │ styles.py │ │ orchestration │ │
22- │ └──────────────┘ └──────────────────┘ │
23- └────────────────────┬────────────────────────────┘
24- │ depends on
25- ↓
26- ┌─────────────────────────────────────────────────┐
27- │ Adapters Layer (External I/O) │
28- │ ┌───────┐ ┌──────────┐ ┌──────┐ ┌────────┐│
29- │ │ audio │ │ whisper │ │ llm │ │clipboard││
30- │ └───────┘ └──────────┘ └──────┘ └────────┘│
31- └─────────────────────────────────────────────────┘
32- │
33- ↓
34- ┌───────────────────────────┐
35- │ External Dependencies │
36- │ • OpenAI APIs │
37- │ • sounddevice │
38- │ • pyperclip │
39- └───────────────────────────┘
8+ CLI Layer (Typer)
9+ ├─ app.py, commands/
10+ ├─ Orchestrates workflows
11+ └─ Calls ↓
12+
13+ Core Layer
14+ └─ styles.py (TranscriptionStyle enum)
15+
16+ Adapters Layer (I/O)
17+ ├─ audio/ (sounddevice, scipy)
18+ ├─ whisper/ (OpenAI API)
19+ ├─ llm/ (PydanticAI)
20+ └─ clipboard/ (pyperclip)
4021```
4122
4223## Dependency Rule
@@ -55,40 +36,37 @@ Benefits: Clean separation, easy testing, framework independence.
5536
5637User interaction and terminal UI.
5738
58- ** Key responsibilities :**
39+ ** Responsibilities :**
5940- Parse arguments (Typer)
6041- Display output (Rich)
61- - Orchestrate workflows
42+ - Orchestrate workflows (calls adapters)
6243- Bridge sync CLI to async backend
6344
64- ** Main files :** ` cli/app.py ` , ` cli/commands/ `
45+ ** Files :** ` cli/app.py ` , ` cli/commands/record.py ` , ` cli/commands/config.py `
6546
6647### Core Layer
6748
68- Business logic and domain models.
49+ Domain models only .
6950
70- ** Key responsibilities:**
71- - Define domain models (TranscriptionStyle)
72- - Business rules (when to format/translate)
73- - Pure logic, no I/O
74- - Framework-agnostic
51+ ** Responsibilities:**
52+ - Define TranscriptionStyle enum
7553
76- ** Main files :** ` core/styles.py `
54+ ** Files :** ` core/styles.py `
7755
78- ** Dependencies :** Standard library, Pydantic types only
56+ ** Note :** Currently minimal. Orchestration happens in CLI layer (pragmatic choice for small app).
7957
8058### Adapters Layer
8159
82- All external I/O and integrations .
60+ All external I/O.
8361
84- ** Key responsibilities :**
62+ ** Responsibilities :**
8563- Audio recording (sounddevice)
8664- WAV file I/O (scipy)
87- - Whisper API (httpx )
65+ - Whisper API (AsyncOpenAI )
8866- LLM formatting (PydanticAI)
8967- Clipboard (pyperclip)
9068
91- ** Main files :** ` adapters/audio/ ` , ` adapters/whisper/ ` , ` adapters/llm/ ` , ` adapters/clipboard/ `
69+ ** Files :** ` adapters/audio/recorder.py ` , ` adapters/whisper/client.py ` , ` adapters/llm/formatter.py ` , ` adapters/clipboard/manager.py `
9270
9371## Data Flow
9472
@@ -138,13 +116,10 @@ User runs: shh config set default_style casual
138116 ├─ Validate key exists
139117 └─ Validate value is valid enum
140118
141- 2. Config Layer (settings.py)
142- ├─ Load existing config
143- ├─ Update setting
144- └─ Save to JSON file
145-
146- 3. Config Layer (storage.py)
147- └─ Write JSON to platform-specific path
119+ 2. Config (settings.py)
120+ ├─ Load existing config from JSON
121+ ├─ Update setting with validation
122+ └─ Save to platform-specific path
148123```
149124
150125## Configuration Architecture
0 commit comments