pyrpckit 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. pyrpckit-0.1.0/.env.example +2 -0
  2. pyrpckit-0.1.0/.github/workflows/ci.yml +47 -0
  3. pyrpckit-0.1.0/.gitignore +65 -0
  4. pyrpckit-0.1.0/.pre-commit-config.yaml +18 -0
  5. pyrpckit-0.1.0/.python-version +1 -0
  6. pyrpckit-0.1.0/.tmp-pi-listen-readme.md +337 -0
  7. pyrpckit-0.1.0/AGENTS.md +35 -0
  8. pyrpckit-0.1.0/CLAUDE.md +1 -0
  9. pyrpckit-0.1.0/PKG-INFO +236 -0
  10. pyrpckit-0.1.0/README.md +226 -0
  11. pyrpckit-0.1.0/examples/README.md +31 -0
  12. pyrpckit-0.1.0/examples/basic.py +38 -0
  13. pyrpckit-0.1.0/examples/error_mapping.py +38 -0
  14. pyrpckit-0.1.0/examples/errors.py +45 -0
  15. pyrpckit-0.1.0/examples/features.py +42 -0
  16. pyrpckit-0.1.0/examples/notifications.py +46 -0
  17. pyrpckit-0.1.0/examples/schemas.py +49 -0
  18. pyrpckit-0.1.0/pyproject.toml +50 -0
  19. pyrpckit-0.1.0/pyrpckit/__init__.py +50 -0
  20. pyrpckit-0.1.0/pyrpckit/client/__init__.py +9 -0
  21. pyrpckit-0.1.0/pyrpckit/client/errors.py +17 -0
  22. pyrpckit-0.1.0/pyrpckit/client/transport.py +12 -0
  23. pyrpckit-0.1.0/pyrpckit/codegen/__init__.py +36 -0
  24. pyrpckit-0.1.0/pyrpckit/codegen/cli.py +78 -0
  25. pyrpckit-0.1.0/pyrpckit/codegen/ir.py +457 -0
  26. pyrpckit-0.1.0/pyrpckit/codegen/python.py +496 -0
  27. pyrpckit-0.1.0/pyrpckit/codegen/writer.py +27 -0
  28. pyrpckit-0.1.0/pyrpckit/decorators.py +133 -0
  29. pyrpckit-0.1.0/pyrpckit/dispatch.py +71 -0
  30. pyrpckit-0.1.0/pyrpckit/envelopes.py +58 -0
  31. pyrpckit-0.1.0/pyrpckit/errors.py +116 -0
  32. pyrpckit-0.1.0/pyrpckit/protocol.py +290 -0
  33. pyrpckit-0.1.0/pyrpckit/py.typed +0 -0
  34. pyrpckit-0.1.0/pyrpckit/schema/__init__.py +14 -0
  35. pyrpckit-0.1.0/pyrpckit/schema/json_schema.py +198 -0
  36. pyrpckit-0.1.0/pyrpckit/schema/openrpc.py +110 -0
  37. pyrpckit-0.1.0/pyrpckit/server.py +90 -0
  38. pyrpckit-0.1.0/scripts/__init__.py +0 -0
  39. pyrpckit-0.1.0/scripts/fastapi_showcase/__init__.py +0 -0
  40. pyrpckit-0.1.0/scripts/fastapi_showcase/call.py +15 -0
  41. pyrpckit-0.1.0/scripts/fastapi_showcase/generate.py +58 -0
  42. pyrpckit-0.1.0/scripts/fastapi_showcase/serve.py +14 -0
  43. pyrpckit-0.1.0/scripts/run_fastapi_showcase.sh +20 -0
  44. pyrpckit-0.1.0/showcase/README.md +16 -0
  45. pyrpckit-0.1.0/showcase/__init__.py +0 -0
  46. pyrpckit-0.1.0/showcase/app/README.md +75 -0
  47. pyrpckit-0.1.0/showcase/app/__init__.py +0 -0
  48. pyrpckit-0.1.0/showcase/app/api/__init__.py +22 -0
  49. pyrpckit-0.1.0/showcase/app/api/errors.py +6 -0
  50. pyrpckit-0.1.0/showcase/app/api/handler.py +22 -0
  51. pyrpckit-0.1.0/showcase/app/api/models.py +17 -0
  52. pyrpckit-0.1.0/showcase/app/server.py +29 -0
  53. pyrpckit-0.1.0/showcase/client/__init__.py +11 -0
  54. pyrpckit-0.1.0/showcase/client/client.py +22 -0
  55. pyrpckit-0.1.0/showcase/client/models.py +25 -0
  56. pyrpckit-0.1.0/showcase/client/namespaces/__init__.py +7 -0
  57. pyrpckit-0.1.0/showcase/client/namespaces/calculator.py +44 -0
  58. pyrpckit-0.1.0/showcase/client/transport.py +41 -0
  59. pyrpckit-0.1.0/showcase/ruff.toml +5 -0
  60. pyrpckit-0.1.0/showcase/spec/calculator.openrpc.json +294 -0
  61. pyrpckit-0.1.0/tests/__init__.py +0 -0
  62. pyrpckit-0.1.0/tests/codegen/__init__.py +0 -0
  63. pyrpckit-0.1.0/tests/codegen/conftest.py +51 -0
  64. pyrpckit-0.1.0/tests/codegen/test_cli.py +76 -0
  65. pyrpckit-0.1.0/tests/codegen/test_ir.py +96 -0
  66. pyrpckit-0.1.0/tests/codegen/test_python.py +133 -0
  67. pyrpckit-0.1.0/tests/codegen/test_roundtrip.py +122 -0
  68. pyrpckit-0.1.0/tests/conftest.py +89 -0
  69. pyrpckit-0.1.0/tests/showcase/__init__.py +0 -0
  70. pyrpckit-0.1.0/tests/showcase/test_fastapi_showcase.py +81 -0
  71. pyrpckit-0.1.0/tests/test_decorators.py +153 -0
  72. pyrpckit-0.1.0/tests/test_dispatch.py +92 -0
  73. pyrpckit-0.1.0/tests/test_errors.py +54 -0
  74. pyrpckit-0.1.0/tests/test_examples.py +17 -0
  75. pyrpckit-0.1.0/tests/test_json_schema.py +28 -0
  76. pyrpckit-0.1.0/tests/test_protocol.py +174 -0
  77. pyrpckit-0.1.0/tests/test_schema.py +140 -0
  78. pyrpckit-0.1.0/tests/test_server.py +207 -0
  79. pyrpckit-0.1.0/uv.lock +654 -0
@@ -0,0 +1,2 @@
1
+ # Copy this file to .env and fill in real values.
2
+ # .env is git-ignored and should never be committed.
@@ -0,0 +1,47 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ lint:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - name: Install uv
15
+ uses: astral-sh/setup-uv@v3
16
+
17
+ - name: Set up Python
18
+ run: uv python install
19
+
20
+ - name: Install dependencies
21
+ run: uv sync --all-groups
22
+
23
+ - name: Ruff check
24
+ run: uv run ruff check .
25
+
26
+ - name: Ruff format check
27
+ run: uv run ruff format --check .
28
+
29
+ test:
30
+ runs-on: ubuntu-latest
31
+ strategy:
32
+ matrix:
33
+ python-version: ["3.12", "3.13", "3.14"]
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+
37
+ - name: Install uv
38
+ uses: astral-sh/setup-uv@v3
39
+
40
+ - name: Set up Python ${{ matrix.python-version }}
41
+ run: uv python install ${{ matrix.python-version }}
42
+
43
+ - name: Install dependencies
44
+ run: uv sync --all-groups --python ${{ matrix.python-version }}
45
+
46
+ - name: Run tests
47
+ run: uv run --python ${{ matrix.python-version }} pytest
@@ -0,0 +1,65 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ dist/
13
+ downloads/
14
+ eggs/
15
+ .eggs/
16
+ lib/
17
+ lib64/
18
+ parts/
19
+ sdist/
20
+ var/
21
+ wheels/
22
+ *.egg-info/
23
+ .installed.cfg
24
+ *.egg
25
+ MANIFEST
26
+
27
+ # Unit test / coverage reports
28
+ htmlcov/
29
+ .tox/
30
+ .nox/
31
+ .coverage
32
+ .coverage.*
33
+ .cache
34
+ nosetests.xml
35
+ coverage.xml
36
+ *.cover
37
+ *.py,cover
38
+ .hypothesis/
39
+ .pytest_cache/
40
+
41
+ # Type checkers
42
+ .mypy_cache/
43
+ .dmypy.json
44
+ dmypy.json
45
+ .pyre/
46
+ .pytype/
47
+ .ruff_cache/
48
+
49
+ # Environments
50
+ .env
51
+ .venv
52
+ env/
53
+ venv/
54
+ ENV/
55
+ env.bak/
56
+ venv.bak/
57
+
58
+ # IDEs / editors
59
+ .vscode/
60
+ .idea/
61
+ *.swp
62
+
63
+ # OS
64
+ .DS_Store
65
+ Thumbs.db
@@ -0,0 +1,18 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v5.0.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ exclude: ^CLAUDE\.md$
7
+ - id: end-of-file-fixer
8
+ exclude: ^CLAUDE\.md$
9
+ - id: check-yaml
10
+ - id: check-toml
11
+ - id: check-added-large-files
12
+
13
+ - repo: https://github.com/astral-sh/ruff-pre-commit
14
+ rev: v0.6.9
15
+ hooks:
16
+ - id: ruff
17
+ args: [--fix]
18
+ - id: ruff-format
@@ -0,0 +1 @@
1
+ 3.14
@@ -0,0 +1,337 @@
1
+ [English](README.md) | [简体中文](README.zh-CN.md) | [日本語](README.ja.md) | [한국어](README.ko.md) | [Español](README.es.md) | [Français](README.fr.md) | [Português](README.pt-BR.md) | [हिन्दी](README.hi.md)
2
+
3
+ # pi-listen
4
+
5
+ <p align="center">
6
+ <img src="https://raw.githubusercontent.com/codexstar69/pi-listen/main/assets/banner.png" alt="pi-listen — Voice input for the Pi coding agent" width="100%" />
7
+ </p>
8
+
9
+ **Hold-to-talk voice input for [Pi](https://github.com/mariozechner/pi-coding-agent).** Cloud streaming via Deepgram or fully offline with local models.
10
+
11
+ [![npm version](https://img.shields.io/npm/v/@codexstar/pi-listen.svg)](https://www.npmjs.com/package/@codexstar/pi-listen)
12
+ [![license](https://img.shields.io/npm/l/@codexstar/pi-listen.svg)](https://github.com/codexstar69/pi-listen/blob/main/LICENSE)
13
+ [![author](https://img.shields.io/badge/author-@baanditeagle-1DA1F2?logo=x&logoColor=white)](https://x.com/baanditeagle)
14
+
15
+ > **v7.0.0 — World-class TTS UX** — pick models from `/voice-settings` Speak
16
+ > tab (no more JSON editing), auto-download on selection with progress, voice
17
+ > picker for every backend, first-run onboarding with smart-default
18
+ > recommendation by your system locale, and `ttsAutoSpeak: true` finally
19
+ > works — auto-speaks the agent's responses with code-block stripping and
20
+ > rate limiting. Diagnostic command `/voice-speak-info` shows everything.
21
+ > Resume-on-interrupt downloads. Plus all v6 features (14 local models from
22
+ > 25 MB Kitten Nano up, Deepgram Aura cloud, region-strict language matching,
23
+ > sentence-aware chunking). [Full changelog →](CHANGELOG.md)
24
+
25
+ ---
26
+
27
+ ## See How It Works
28
+
29
+ <p align="center">
30
+ <a href="https://github.com/codexstar69/pi-listen/blob/main/assets/pi-listen.mp4">
31
+ <img src="https://raw.githubusercontent.com/codexstar69/pi-listen/main/assets/banner.png" alt="Watch demo video" width="600" />
32
+ </a>
33
+ <br>
34
+ <em>Click to watch the demo video</em>
35
+ </p>
36
+
37
+ ---
38
+
39
+ ## Setup (2 minutes)
40
+
41
+ ### 1. Install the extension
42
+
43
+ ```bash
44
+ # In a regular terminal (not inside Pi)
45
+ pi install npm:@codexstar/pi-listen
46
+ ```
47
+
48
+ ### 2. Choose your backend
49
+
50
+ pi-listen supports two transcription backends:
51
+
52
+ | | Deepgram (cloud) | Local models (offline) |
53
+ |---|---|---|
54
+ | **How it works** | Live streaming — text appears as you speak | Batch mode — transcribes after you finish recording |
55
+ | **Setup** | API key required | No API key, models auto-download on first use |
56
+ | **Internet** | Required | Not required after model download |
57
+ | **Latency** | Real-time interim results | 2–10 seconds after recording stops |
58
+ | **Languages** | 56+ with live streaming | Depends on model (1–57 languages) |
59
+ | **Cost** | $200 free credit (lasts 6–12 months for most developers) | Free forever |
60
+
61
+ Run `/voice-settings` inside Pi to choose your backend and configure everything from one panel.
62
+
63
+ #### Option A: Deepgram (recommended for live streaming)
64
+
65
+ Sign up at [dpgr.am/pi-voice](https://dpgr.am/pi-voice) — $200 free credit, no card needed.
66
+
67
+ ```bash
68
+ export DEEPGRAM_API_KEY="your-key-here" # add to ~/.zshrc or ~/.bashrc
69
+ ```
70
+
71
+ #### Option B: Local models (fully offline)
72
+
73
+ No setup needed — run `/voice-settings`, switch backend to Local, and select a model. It downloads automatically.
74
+
75
+ > **Note:** Local models use batch mode — they transcribe after you finish recording, not while you speak. For live streaming as you speak, use Deepgram.
76
+
77
+ ### 3. Open Pi
78
+
79
+ On first launch, pi-listen checks your setup and tells you what's ready:
80
+ - Backend configured (Deepgram key or local model)
81
+ - Audio capture tool detected (sox, ffmpeg, or arecord)
82
+ - If everything checks out, voice activates immediately
83
+
84
+ ### Audio capture
85
+
86
+ pi-listen auto-detects your audio tool. No manual install needed if you already have sox or ffmpeg.
87
+
88
+ | Priority | Tool | Platforms | Install |
89
+ |----------|------|-----------|---------|
90
+ | 1 | **SoX** (`rec`) | macOS, Linux, Windows | `brew install sox` / `apt install sox` / `choco install sox` |
91
+ | 2 | **ffmpeg** | macOS, Linux, Windows | `brew install ffmpeg` / `apt install ffmpeg` |
92
+ | 3 | **arecord** | Linux only | Pre-installed (ALSA) |
93
+
94
+ ---
95
+
96
+ ## Settings Panel
97
+
98
+ All configuration lives in one place: `/voice-settings`. Four tabs cover everything you need.
99
+
100
+ ### General — backend, language, scope
101
+
102
+ <img src="https://raw.githubusercontent.com/codexstar69/pi-listen/main/assets/settings-general.png" alt="General settings — backend, model, language, scope, voice toggle" width="600" />
103
+
104
+ Toggle between Deepgram (cloud, live streaming) and Local (offline, batch mode). Change language, scope, and enable/disable voice — all with keyboard shortcuts.
105
+
106
+ ### Models — browse, search, install
107
+
108
+ <img src="https://raw.githubusercontent.com/codexstar69/pi-listen/main/assets/settings-models.png" alt="Models tab — browse 19 models with accuracy/speed ratings" width="600" />
109
+
110
+ Browse 19 models from Parakeet, Whisper, Moonshine, SenseVoice, and GigaAM. Each model shows accuracy and speed ratings (●●●●○/●●●●○), fitness badges, and download status. Fuzzy search to find models fast. Press Enter to activate and download.
111
+
112
+ ### Downloaded — manage installed models
113
+
114
+ <img src="https://raw.githubusercontent.com/codexstar69/pi-listen/main/assets/settings-downloaded.png" alt="Downloaded tab — manage installed models, activate or delete" width="600" />
115
+
116
+ See what's installed, total disk usage, and which model is active. Press Enter to activate, `x` to delete. Models from [Handy](https://github.com/cjpais/handy) are auto-detected and can be imported without re-downloading.
117
+
118
+ ### Device — hardware profile and dependencies
119
+
120
+ <img src="https://raw.githubusercontent.com/codexstar69/pi-listen/main/assets/settings-device.png" alt="Device tab — hardware profile, dependencies, disk space" width="600" />
121
+
122
+ See your hardware profile (RAM, CPU, GPU), dependency status (sherpa-onnx runtime), available disk space, and total downloaded models. Model recommendations are based on this profile.
123
+
124
+ ---
125
+
126
+ ## Usage
127
+
128
+ ### Keybindings
129
+
130
+ | Action | Key | Notes |
131
+ |--------|-----|-------|
132
+ | **Record to editor** | Hold `SPACE` (≥1.2s) | Release to finalize. Pre-records during warmup so you don't miss words. |
133
+ | **Toggle recording** | `Ctrl+Shift+V` | Works in all terminals — press to start, press again to stop. |
134
+ | **Clear editor** | `Escape` × 2 | Double-tap within 500ms to clear all text. |
135
+
136
+ ### How recording works
137
+
138
+ 1. **Hold SPACE** — warmup countdown appears, audio capture starts immediately (pre-recording)
139
+ 2. **Keep holding** — live transcription streams into the editor (Deepgram) or audio buffers (local)
140
+ 3. **Release SPACE** — recording continues for 1.5s (tail recording) to catch your last word, then finalizes
141
+ 4. Text appears in the editor, ready to send
142
+
143
+ ### Commands
144
+
145
+ | Command | Description |
146
+ |---------|-------------|
147
+ | `/voice-settings` | Settings panel — backend, models, language, scope, device |
148
+ | `/voice-models` | Settings panel (Models tab) |
149
+ | `/voice-speak <text>` | Speak text out loud (TTS) |
150
+ | `/voice-speak-test` | Speak a sample sentence |
151
+ | `/voice-speak-toggle` | Enable / disable TTS |
152
+ | `/voice-autosubmit` `[on|off]` | Toggle: STT text auto-sent to the agent |
153
+ | `/voice-speak-models` | Browse / install TTS voice models |
154
+ | `/voice-speak-info` | Diagnose TTS state |
155
+ | `/voice-help` | Keyboard + command reference (or press `F1`) |
156
+ | `/voice test` | Full diagnostics — audio tool, mic, API key |
157
+ | `/voice on` / `off` | Enable or disable voice |
158
+ | `/voice dictate` | Continuous dictation (no key hold) |
159
+ | `/voice stop` | Stop active recording or dictation |
160
+ | `/voice history` | Recent transcriptions |
161
+ | `/voice` | Toggle on/off |
162
+
163
+ ### v7.1 keyboard
164
+
165
+ While in the settings panel:
166
+
167
+ | Key | Action |
168
+ |-----|--------|
169
+ | `← →` | switch tab |
170
+ | `↑ ↓` | navigate row (skips group headings) |
171
+ | `↵` | select / activate |
172
+ | `esc` | back to main / close panel |
173
+ | `type` | filter (search) |
174
+ | `bksp` | clear last search char |
175
+
176
+ While an install widget or playback indicator is mounted (no overlay
177
+ in front):
178
+
179
+ | Key | Action |
180
+ |-----|--------|
181
+ | `esc` | cancel active install (most-recent first), then stop playback |
182
+ | `F1` | open help overlay (always available) |
183
+
184
+ ---
185
+
186
+ ## Local Models
187
+
188
+ 19 models across 5 families. Sorted by quality — best models first.
189
+
190
+ ### Top picks
191
+
192
+ | Model | Accuracy | Speed | Size | Languages | Notes |
193
+ |-------|----------|-------|------|-----------|-------|
194
+ | **Parakeet TDT v3** | ●●●●○ | ●●●●○ | 671 MB | 25 (auto-detect) | Best overall. WER 6.3%. |
195
+ | **Parakeet TDT v2** | ●●●●● | ●●●●○ | 661 MB | English | Best English. WER 6.0%. |
196
+ | **Whisper Turbo** | ●●●●○ | ●●○○○ | 1.0 GB | 57 | Broadest language support. |
197
+
198
+ ### Fast and lightweight
199
+
200
+ | Model | Accuracy | Speed | Size | Languages | Notes |
201
+ |-------|----------|-------|------|-----------|-------|
202
+ | **Moonshine v2 Tiny** | ●●○○○ | ●●●●● | 43 MB | English | 34ms latency. Raspberry Pi friendly. |
203
+ | **Moonshine Base** | ●●●○○ | ●●●●● | 287 MB | English | Handles accents well. |
204
+ | **SenseVoice Small** | ●●●○○ | ●●●●● | 228 MB | zh/en/ja/ko/yue | Best for CJK languages. |
205
+
206
+ ### Specialist
207
+
208
+ | Model | Accuracy | Speed | Size | Languages | Notes |
209
+ |-------|----------|-------|------|-----------|-------|
210
+ | **GigaAM v3** | ●●●●○ | ●●●●○ | 225 MB | Russian | 50% lower WER than Whisper on Russian. |
211
+ | **Whisper Medium** | ●●●●○ | ●●●○○ | 946 MB | 57 | Good accuracy, medium speed. |
212
+ | **Whisper Large v3** | ●●●●○ | ●○○○○ | 1.8 GB | 57 | Highest Whisper accuracy. Slow on CPU. |
213
+
214
+ Plus 8 language-specialized Moonshine v2 variants for Japanese, Korean, Arabic, Chinese, Ukrainian, Vietnamese, and Spanish.
215
+
216
+ ### How local models work
217
+
218
+ ```
219
+ Hold SPACE → audio captured to memory buffer
220
+
221
+ Release SPACE → buffer sent to sherpa-onnx (in-process)
222
+
223
+ ONNX inference on CPU (2–10 seconds)
224
+
225
+ Final transcript inserted into editor
226
+ ```
227
+
228
+ Models download automatically on first use. Downloads are resumable, verified after completion, and deduplicated (no double-downloads). The settings panel shows real-time download progress with speed and ETA.
229
+
230
+ Models from [Handy](https://github.com/cjpais/handy) (`~/Library/Application Support/com.pais.handy/models/`) are auto-detected and can be imported via symlink (zero disk duplication).
231
+
232
+ ---
233
+
234
+ ## Features
235
+
236
+ | Feature | Description |
237
+ |---------|-------------|
238
+ | **Dual backend** | Deepgram (cloud, live streaming) or local models (offline, batch) — switch in settings |
239
+ | **19 local models** | Parakeet, Whisper, Moonshine, SenseVoice, GigaAM — with accuracy/speed ratings |
240
+ | **Unified settings panel** | One overlay panel for all configuration — `/voice-settings` |
241
+ | **Device-aware recommendations** | Scores models against your hardware. Only best-in-class models get [recommended]. |
242
+ | **Enterprise download pipeline** | Pre-checks (disk, network, permissions), live progress with speed/ETA, post-verification |
243
+ | **Handy integration** | Auto-detects models from Handy app, imports via symlink |
244
+ | **Audio fallback chain** | Tries sox, ffmpeg, arecord in order |
245
+ | **Pre-recording** | Audio capture starts during warmup — you never miss the first word |
246
+ | **Tail recording** | Keeps recording 1.5s after release so your last word isn't clipped |
247
+ | **Live streaming** | Deepgram Nova 3 WebSocket — interim transcripts as you speak |
248
+ | **56+ languages** | Deepgram: 56+ with live streaming. Local: up to 57 depending on model. |
249
+ | **Continuous dictation** | `/voice dictate` for long-form input without holding keys |
250
+ | **Typing cooldown** | Space holds within 400ms of typing are ignored |
251
+ | **Sound feedback** | macOS system sounds for start, stop, and error events |
252
+ | **Cross-platform** | macOS, Windows, Linux — Kitty protocol + non-Kitty fallback |
253
+
254
+ ---
255
+
256
+ ## Architecture
257
+
258
+ ```
259
+ extensions/voice.ts Main extension — state machine, recording, UI, settings panel
260
+ extensions/voice/config.ts Config loading, saving, migration
261
+ extensions/voice/onboarding.ts First-run wizard, language picker
262
+ extensions/voice/deepgram.ts Deepgram URL builder, API key resolver
263
+ extensions/voice/local.ts Model catalog (19 models), in-process transcription
264
+ extensions/voice/device.ts Device profiling — RAM, GPU, CPU, container detection
265
+ extensions/voice/model-download.ts Download manager — resume, progress, verification, Handy import
266
+ extensions/voice/sherpa-engine.ts sherpa-onnx bindings — recognizer lifecycle, inference
267
+ extensions/voice/settings-panel.ts Settings panel — Component interface, overlay, 4 tabs
268
+ ```
269
+
270
+ ---
271
+
272
+ ## Configuration
273
+
274
+ Settings stored in Pi's settings files under the `voice` key:
275
+
276
+ | Scope | Path |
277
+ |-------|------|
278
+ | Global | `~/.pi/agent/settings.json` |
279
+ | Project | `<project>/.pi/settings.json` |
280
+
281
+ ```json
282
+ {
283
+ "voice": {
284
+ "version": 2,
285
+ "enabled": true,
286
+ "language": "en",
287
+ "backend": "local",
288
+ "localModel": "parakeet-v3",
289
+ "scope": "global",
290
+ "onboarding": { "completed": true, "schemaVersion": 2 }
291
+ }
292
+ }
293
+ ```
294
+
295
+ `DEEPGRAM_API_KEY` from your shell is used at runtime and is not copied back
296
+ into `~/.pi/agent/settings.json`. If you paste a key during onboarding, that is
297
+ an explicit save and it still goes to `~/.env.secrets` or `~/.zshrc`.
298
+
299
+ ---
300
+
301
+ ## Troubleshooting
302
+
303
+ Run `/voice test` inside Pi for full diagnostics.
304
+
305
+ | Problem | Solution |
306
+ |---------|----------|
307
+ | "DEEPGRAM_API_KEY not set" | [Get a key](https://dpgr.am/pi-voice) → `export DEEPGRAM_API_KEY="..."` in `~/.zshrc` |
308
+ | "No audio capture tool found" | `brew install sox` or `brew install ffmpeg` |
309
+ | Space doesn't activate voice | Run `/voice-settings` — voice may be disabled |
310
+ | Local model not transcribing | Check `/voice-settings` → Device tab for sherpa-onnx status |
311
+ | Download failed | Partial downloads auto-resume on retry. Check disk space in Device tab. |
312
+ | `dyld: Library not loaded: libsimdjson` on macOS | Homebrew Node ABI mismatch — run `brew reinstall node` or switch to version-managed Node (`mise`, `fnm`, `nvm`) |
313
+
314
+ ---
315
+
316
+ ## Security
317
+
318
+ - **Cloud STT** — audio is sent to Deepgram for transcription (Deepgram backend only)
319
+ - **Local STT** — audio never leaves your machine (local backend)
320
+ - **No telemetry** — pi-listen does not collect or transmit usage data
321
+ - **API key** — stored in env var or Pi settings, never logged
322
+
323
+ See [SECURITY.md](SECURITY.md) for vulnerability reporting.
324
+
325
+ ---
326
+
327
+ ## License
328
+
329
+ [MIT](LICENSE) © 2026 [@baanditeagle](https://x.com/baanditeagle)
330
+
331
+ ---
332
+
333
+ <p align="center">
334
+ <strong>Made by <a href="https://x.com/baanditeagle">@baanditeagle</a></strong>
335
+ <br><br>
336
+ <a href="https://abhishektiwari.co">Website</a> · <a href="https://x.com/baanditeagle">𝕏 Twitter</a> · <a href="https://github.com/codexstar69/pi-listen">GitHub</a> · <a href="https://www.npmjs.com/package/@codexstar/pi-listen">npm</a> · <a href="https://github.com/codexstar69/pi-listen/issues">Report a Bug</a> · <a href="https://github.com/mariozechner/pi-coding-agent">Pi CLI</a>
337
+ </p>
@@ -0,0 +1,35 @@
1
+ # AGENTS.md
2
+
3
+ Guidance for AI coding agents working in this repository.
4
+
5
+ ## Project
6
+
7
+ `pyrpckit` is a Python library, packaged for distribution on PyPI. It turns decorated
8
+ handler classes into a JSON-RPC 2.0 protocol: definition (`decorators.py`, `protocol.py`),
9
+ serving (`dispatch.py`, `server.py`), contract generation (`schema/`), and client
10
+ generation (`codegen/`). `client/` holds the runtime contract that generated clients
11
+ import.
12
+
13
+ ## Environment
14
+
15
+ - Dependency management: [uv](https://docs.astral.sh/uv/)
16
+ - Supported Python versions: 3.12–3.14
17
+ - Install dependencies: `uv sync --all-groups`
18
+
19
+ ## Workflow
20
+
21
+ - Lint: `uv run ruff check .`
22
+ - Format: `uv run ruff format .`
23
+ - Tests: `uv run pytest`
24
+ - Pre-commit hooks are configured in `.pre-commit-config.yaml`; install with `uv run pre-commit install`.
25
+
26
+ ## Conventions
27
+
28
+ - Library code lives in `pyrpckit/`; the public API is re-exported from `pyrpckit/__init__.py`.
29
+ - No module-level docstrings. Document a class or function only where the name is not enough.
30
+ - The library stays transport-agnostic: no HTTP, WebSocket, or framework dependencies.
31
+ - Generators read the OpenRPC document, never the `RpcProtocol` object, so a new target
32
+ language only needs an emitter beside `codegen/python.py` on top of `codegen/ir.py`.
33
+ - Generated code must pass `ruff check` and `ruff format` in the consuming repository.
34
+ - Tests live in `tests/` and mirror the package structure.
35
+ - Keep `pyproject.toml` as the single source of truth for metadata and tool config.
@@ -0,0 +1 @@
1
+ AGENTS.md