@codexstar/pi-listen 1.0.4
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.
- package/LICENSE +21 -0
- package/README.md +283 -0
- package/daemon.py +517 -0
- package/docs/API.md +273 -0
- package/docs/ARCHITECTURE.md +114 -0
- package/docs/backends.md +196 -0
- package/docs/plans/2026-03-12-pi-voice-master-plan.md +613 -0
- package/docs/plans/2026-03-12-pi-voice-model-aware-execution-plan.md +256 -0
- package/docs/plans/2026-03-12-pi-voice-onboarding-remediation-plan.md +391 -0
- package/docs/plans/pi-voice-model-aware-review.md +196 -0
- package/docs/plans/pi-voice-model-detection-qa-plan.md +226 -0
- package/docs/plans/pi-voice-model-detection-research.md +483 -0
- package/docs/plans/pi-voice-onboarding-ux-plan.md +388 -0
- package/docs/plans/pi-voice-release-validation-plan.md +386 -0
- package/docs/plans/pi-voice-remaining-implementation-plan.md +524 -0
- package/docs/plans/pi-voice-review-findings.md +227 -0
- package/docs/plans/pi-voice-technical-remediation-plan.md +613 -0
- package/docs/qa-matrix.md +69 -0
- package/docs/qa-results.md +357 -0
- package/docs/troubleshooting.md +265 -0
- package/extensions/voice/config.ts +206 -0
- package/extensions/voice/diagnostics.ts +212 -0
- package/extensions/voice/install.ts +62 -0
- package/extensions/voice/onboarding.ts +315 -0
- package/extensions/voice.ts +1149 -0
- package/package.json +48 -0
- package/scripts/setup-macos.sh +374 -0
- package/scripts/setup-windows.ps1 +271 -0
- package/transcribe.py +497 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
# pi-voice model-aware onboarding execution plan
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Upgrade `pi-voice` from backend-aware onboarding to **model-aware onboarding** so the system can:
|
|
6
|
+
|
|
7
|
+
- detect when a backend is installed
|
|
8
|
+
- detect when a specific model is already available locally
|
|
9
|
+
- prefer already-installed local models when reasonable
|
|
10
|
+
- avoid unnecessary redownload/setup prompts
|
|
11
|
+
- clearly separate:
|
|
12
|
+
- ready now
|
|
13
|
+
- backend installed but model missing
|
|
14
|
+
- download required
|
|
15
|
+
- cloud/API path
|
|
16
|
+
|
|
17
|
+
This plan builds on the onboarding/runtime foundation already implemented in the repo.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Current status
|
|
22
|
+
|
|
23
|
+
### Already complete in repo
|
|
24
|
+
- first-run onboarding on interactive `session_start`
|
|
25
|
+
- API vs Local decision flow
|
|
26
|
+
- backend/model/scope selection
|
|
27
|
+
- config migration and onboarding state
|
|
28
|
+
- daemon correctness fixes
|
|
29
|
+
- `/voice doctor` and `/voice reconfigure`
|
|
30
|
+
- runtime/info/test improvements
|
|
31
|
+
- docs + QA artifacts + automated tests
|
|
32
|
+
|
|
33
|
+
### Started in this phase
|
|
34
|
+
- added model-readiness metadata to `transcribe.py --list-backends`
|
|
35
|
+
- added model-aware recommendation tests and provisioning tests
|
|
36
|
+
- started wiring installed-model preferences into TypeScript diagnostics/onboarding
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Workstreams
|
|
41
|
+
|
|
42
|
+
## Workstream A — detection contract (Python)
|
|
43
|
+
|
|
44
|
+
### Objective
|
|
45
|
+
Expose per-model readiness metadata from backend discovery.
|
|
46
|
+
|
|
47
|
+
### Deliverables
|
|
48
|
+
- `installed_models` in `--list-backends` JSON output
|
|
49
|
+
- `install_detection` metadata for each backend
|
|
50
|
+
- conservative detection heuristics by backend
|
|
51
|
+
|
|
52
|
+
### Files
|
|
53
|
+
- `transcribe.py`
|
|
54
|
+
|
|
55
|
+
### Status
|
|
56
|
+
- **in progress / partially implemented**
|
|
57
|
+
|
|
58
|
+
### Backend strategy
|
|
59
|
+
- **faster-whisper**: Hugging Face cache repo detection
|
|
60
|
+
- **whisper-cpp**: direct model file path detection
|
|
61
|
+
- **deepgram**: API-based, no local model download
|
|
62
|
+
- **moonshine**: heuristic / low-confidence cache detection
|
|
63
|
+
- **parakeet**: Hugging Face or NeMo cache heuristic
|
|
64
|
+
|
|
65
|
+
### Acceptance criteria
|
|
66
|
+
- `python3 transcribe.py --list-backends` includes per-backend `installed_models`
|
|
67
|
+
- missing caches do not crash detection
|
|
68
|
+
- conservative heuristics prefer underclaiming over false positives
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Workstream B — diagnostics and recommendation engine (TypeScript)
|
|
73
|
+
|
|
74
|
+
### Objective
|
|
75
|
+
Consume the richer Python metadata and prefer already-installed models when appropriate.
|
|
76
|
+
|
|
77
|
+
### Deliverables
|
|
78
|
+
- extended `BackendAvailability` type
|
|
79
|
+
- recommendation logic that prefers ready-now local models
|
|
80
|
+
- support helpers for installed-model queries
|
|
81
|
+
|
|
82
|
+
### Files
|
|
83
|
+
- `extensions/voice/diagnostics.ts`
|
|
84
|
+
|
|
85
|
+
### Status
|
|
86
|
+
- **in progress / partially implemented**
|
|
87
|
+
|
|
88
|
+
### Acceptance criteria
|
|
89
|
+
- recommendation changes when installed-model metadata changes
|
|
90
|
+
- recommendation reasons mention already-installed models where relevant
|
|
91
|
+
- tests cover installed vs missing model cases
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Workstream C — onboarding UX
|
|
96
|
+
|
|
97
|
+
### Objective
|
|
98
|
+
Surface installed-model awareness in backend and model selection.
|
|
99
|
+
|
|
100
|
+
### Deliverables
|
|
101
|
+
- backend labels like `2 installed models`
|
|
102
|
+
- model labels like:
|
|
103
|
+
- `small (recommended, installed)`
|
|
104
|
+
- `medium (installed)`
|
|
105
|
+
- `large-v3-turbo`
|
|
106
|
+
- summary copy that tells the user whether the path is ready now or still requires setup
|
|
107
|
+
|
|
108
|
+
### Files
|
|
109
|
+
- `extensions/voice/onboarding.ts`
|
|
110
|
+
|
|
111
|
+
### Status
|
|
112
|
+
- **in progress / partially implemented**
|
|
113
|
+
|
|
114
|
+
### Acceptance criteria
|
|
115
|
+
- onboarding makes existing assets visible
|
|
116
|
+
- user can still override recommendations
|
|
117
|
+
- local path does not feel like a forced redownload when models already exist
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Workstream D — provisioning short-circuiting
|
|
122
|
+
|
|
123
|
+
### Objective
|
|
124
|
+
Avoid unnecessary install guidance when selected model is already available.
|
|
125
|
+
|
|
126
|
+
### Deliverables
|
|
127
|
+
- provisioning plan becomes model-aware
|
|
128
|
+
- ready state only when backend/model/recording prerequisites are satisfied
|
|
129
|
+
- missing-model path is distinguished from missing-backend path
|
|
130
|
+
|
|
131
|
+
### Files
|
|
132
|
+
- `extensions/voice/install.ts`
|
|
133
|
+
- `extensions/voice.ts`
|
|
134
|
+
|
|
135
|
+
### Status
|
|
136
|
+
- **in progress / partially implemented**
|
|
137
|
+
|
|
138
|
+
### Acceptance criteria
|
|
139
|
+
- installed selected model => no redundant install guidance
|
|
140
|
+
- backend installed but model missing => targeted guidance
|
|
141
|
+
- doctor/test/info reflect the distinction accurately
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Workstream E — product surfaces and docs
|
|
146
|
+
|
|
147
|
+
### Objective
|
|
148
|
+
Make the new behavior visible everywhere users will look.
|
|
149
|
+
|
|
150
|
+
### Deliverables
|
|
151
|
+
- `/voice backends` includes installed-model context where useful
|
|
152
|
+
- `/voice doctor`, `/voice test`, `/voice info` show model readiness
|
|
153
|
+
- docs updated to explain installed-model detection behavior and caveats
|
|
154
|
+
|
|
155
|
+
### Files
|
|
156
|
+
- `extensions/voice.ts`
|
|
157
|
+
- `README.md`
|
|
158
|
+
- `docs/backends.md`
|
|
159
|
+
- `docs/troubleshooting.md`
|
|
160
|
+
- `docs/qa-results.md`
|
|
161
|
+
|
|
162
|
+
### Status
|
|
163
|
+
- **not started / partial prep done**
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Workstream F — QA and release hardening
|
|
168
|
+
|
|
169
|
+
### Objective
|
|
170
|
+
Validate model-aware onboarding end-to-end.
|
|
171
|
+
|
|
172
|
+
### Deliverables
|
|
173
|
+
- updated QA matrix/results
|
|
174
|
+
- automated test coverage for model-aware logic
|
|
175
|
+
- manual/RPC-assisted smoke evidence for:
|
|
176
|
+
- fresh onboarding
|
|
177
|
+
- partial legacy config
|
|
178
|
+
- remind-me-later + reconfigure
|
|
179
|
+
- project-scope save
|
|
180
|
+
- installed-model path
|
|
181
|
+
- missing-model path
|
|
182
|
+
|
|
183
|
+
### Files
|
|
184
|
+
- `tests/transcribe-metadata.test.ts`
|
|
185
|
+
- `tests/model-selection.test.ts`
|
|
186
|
+
- `tests/install.test.ts`
|
|
187
|
+
- `docs/qa-results.md`
|
|
188
|
+
|
|
189
|
+
### Status
|
|
190
|
+
- **in progress**
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Execution order
|
|
195
|
+
|
|
196
|
+
### Phase 1 — finish Python detection contract
|
|
197
|
+
1. finalize `installed_models` heuristics
|
|
198
|
+
2. verify `--list-backends` shape
|
|
199
|
+
3. keep conservative fallback behavior
|
|
200
|
+
|
|
201
|
+
### Phase 2 — finish TypeScript integration
|
|
202
|
+
4. complete installed-model-aware recommendation logic
|
|
203
|
+
5. finish onboarding labels and summary copy
|
|
204
|
+
6. finish provisioning short-circuit logic
|
|
205
|
+
|
|
206
|
+
### Phase 3 — surface behavior in commands/docs
|
|
207
|
+
7. upgrade `/voice backends`, `/voice doctor`, `/voice test`, `/voice info`
|
|
208
|
+
8. update docs and QA results
|
|
209
|
+
|
|
210
|
+
### Phase 4 — final verification
|
|
211
|
+
9. run `bun run check`
|
|
212
|
+
10. run manual/RPC-assisted smoke checks for installed-model-aware flows
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Verification commands
|
|
217
|
+
|
|
218
|
+
### Automated
|
|
219
|
+
- `bun run check`
|
|
220
|
+
- `python3 transcribe.py --list-backends`
|
|
221
|
+
- targeted Bun tests:
|
|
222
|
+
- `bun test tests/transcribe-metadata.test.ts`
|
|
223
|
+
- `bun test tests/model-selection.test.ts`
|
|
224
|
+
- `bun test tests/install.test.ts`
|
|
225
|
+
|
|
226
|
+
### Manual / RPC-assisted
|
|
227
|
+
- fresh first-run onboarding prompt
|
|
228
|
+
- local path shows installed/missing model labels
|
|
229
|
+
- reconfigure path saves project scope correctly
|
|
230
|
+
- doctor separates current repair from recommendation
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Team usage
|
|
235
|
+
|
|
236
|
+
### Teammates already assigned
|
|
237
|
+
- `plan-lead` → remaining implementation plan
|
|
238
|
+
- `model-researcher` → backend/model detection heuristics
|
|
239
|
+
- `qa-lead` → QA/release checklist
|
|
240
|
+
|
|
241
|
+
### How to use teammates during implementation
|
|
242
|
+
- use a teammate for docs refresh while main code work continues
|
|
243
|
+
- use a teammate for QA artifact drafting once command outputs stabilize
|
|
244
|
+
- use a teammate reviewer pass before final signoff
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Definition of done
|
|
249
|
+
|
|
250
|
+
This phase is done when:
|
|
251
|
+
- onboarding explicitly shows when a model is already available
|
|
252
|
+
- recommendation logic prefers installed models where sensible
|
|
253
|
+
- provisioning skips redundant install guidance for already-ready paths
|
|
254
|
+
- doctor/test/info/backends reflect model-aware state accurately
|
|
255
|
+
- docs explain the behavior and caveats
|
|
256
|
+
- verification passes and QA evidence is captured
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
# pi-voice onboarding remediation plan
|
|
2
|
+
|
|
3
|
+
## Objective
|
|
4
|
+
|
|
5
|
+
Turn `pi-voice` from a promising power-user extension into a world-class Pi package with a polished, enterprise-grade first-run experience.
|
|
6
|
+
|
|
7
|
+
Because Pi packages do not appear to offer a dedicated interactive install hook, the package should treat **first interactive `session_start`** as the onboarding moment. Installation should become:
|
|
8
|
+
|
|
9
|
+
1. package installed,
|
|
10
|
+
2. first Pi session starts,
|
|
11
|
+
3. extension detects that voice is not configured,
|
|
12
|
+
4. extension launches a guided terminal onboarding flow,
|
|
13
|
+
5. extension provisions or validates dependencies,
|
|
14
|
+
6. extension runs a verification check,
|
|
15
|
+
7. extension leaves the user in a known-good state.
|
|
16
|
+
|
|
17
|
+
## Current-state gaps
|
|
18
|
+
|
|
19
|
+
### UX gaps
|
|
20
|
+
- No first-run onboarding exists today. `extensions/voice.ts` simply loads config and starts the daemon on `session_start`.
|
|
21
|
+
- `/voice setup` is a narrow backend/model picker, not a complete onboarding journey.
|
|
22
|
+
- The current setup flow does **not** start with the user’s real decision: **cloud API vs local download**.
|
|
23
|
+
- There is no capability scan summary, no privacy/cost explanation, no model recommendation, no install progress UI, and no success confirmation flow.
|
|
24
|
+
- The user must already know to run `/voice setup`, install SoX manually, and understand backend tradeoffs.
|
|
25
|
+
|
|
26
|
+
### Product gaps
|
|
27
|
+
- Configuration is too thin: `enabled`, `language`, `backend`, and `model` are not enough for a polished product.
|
|
28
|
+
- No onboarding versioning or migration marker exists, so the extension cannot safely re-run setup when UX changes.
|
|
29
|
+
- No distinction exists between:
|
|
30
|
+
- onboarding completed,
|
|
31
|
+
- dependencies missing,
|
|
32
|
+
- misconfigured backend,
|
|
33
|
+
- backend intentionally cloud/local,
|
|
34
|
+
- user skipped setup.
|
|
35
|
+
- The package has no README, install guide, troubleshooting guide, or compatibility matrix.
|
|
36
|
+
|
|
37
|
+
### Technical gaps
|
|
38
|
+
- `session_start` eagerly calls `ensureDaemon(config)` before setup is confirmed.
|
|
39
|
+
- The daemon socket is global (`/tmp/pi-voice-daemon.sock`), which can cause collisions across projects or multiple Pi sessions.
|
|
40
|
+
- `transcribeAudio()` sends daemon requests without explicitly passing `backend`/`model`, so a pre-existing daemon may keep using stale settings.
|
|
41
|
+
- `/voice setup` writes only global settings today; it does not offer global vs project scope.
|
|
42
|
+
- There is no installer orchestration layer for Python packages, Homebrew packages, env vars, or model warmup.
|
|
43
|
+
- There is no structured diagnostics engine for “what is broken and how do we fix it automatically?”
|
|
44
|
+
|
|
45
|
+
## Target experience
|
|
46
|
+
|
|
47
|
+
On the first interactive session after install, the user should see a clean onboarding flow with these steps:
|
|
48
|
+
|
|
49
|
+
1. **Welcome**
|
|
50
|
+
- What pi-voice does.
|
|
51
|
+
- What will be configured.
|
|
52
|
+
- Approximate time.
|
|
53
|
+
|
|
54
|
+
2. **Choose operating mode**
|
|
55
|
+
- **API mode**: fastest setup, cloud transcription, API key required.
|
|
56
|
+
- **Download mode**: local/private, dependency installation, model choice required.
|
|
57
|
+
|
|
58
|
+
3. **Smart recommendation**
|
|
59
|
+
- Detect OS, Python, Homebrew, CPU, network, existing packages, env vars.
|
|
60
|
+
- Recommend a default backend/model with a one-line reason.
|
|
61
|
+
|
|
62
|
+
4. **Guided configuration**
|
|
63
|
+
- API path: provider, API key detection/input, model choice, privacy/cost note.
|
|
64
|
+
- Local path: backend choice, model size, latency/accuracy tradeoff, disk/CPU expectations.
|
|
65
|
+
|
|
66
|
+
5. **Provisioning**
|
|
67
|
+
- Install missing dependencies automatically where possible.
|
|
68
|
+
- Show cancellable progress UI.
|
|
69
|
+
- Offer fallback commands if auto-install is not allowed.
|
|
70
|
+
|
|
71
|
+
6. **Validation**
|
|
72
|
+
- Mic check.
|
|
73
|
+
- Backend check.
|
|
74
|
+
- Optional test recording + transcription.
|
|
75
|
+
|
|
76
|
+
7. **Completion**
|
|
77
|
+
- Show ready state, configured mode, shortcuts, and a “re-run setup” command.
|
|
78
|
+
|
|
79
|
+
That should feel like a polished product setup wizard, not a developer-only slash command.
|
|
80
|
+
|
|
81
|
+
## Proposed architecture
|
|
82
|
+
|
|
83
|
+
### 1) Versioned voice config schema
|
|
84
|
+
Expand the current `voice` config into a versioned schema with explicit onboarding state.
|
|
85
|
+
|
|
86
|
+
Suggested shape:
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"voice": {
|
|
91
|
+
"version": 2,
|
|
92
|
+
"enabled": true,
|
|
93
|
+
"language": "en",
|
|
94
|
+
"mode": "local",
|
|
95
|
+
"backend": "faster-whisper",
|
|
96
|
+
"model": "small",
|
|
97
|
+
"scope": "global",
|
|
98
|
+
"onboarding": {
|
|
99
|
+
"completed": true,
|
|
100
|
+
"completedAt": "2026-03-12T...Z",
|
|
101
|
+
"schemaVersion": 2,
|
|
102
|
+
"source": "first-run",
|
|
103
|
+
"lastValidatedAt": "2026-03-12T...Z"
|
|
104
|
+
},
|
|
105
|
+
"local": {
|
|
106
|
+
"autoInstall": true,
|
|
107
|
+
"warmDaemonOnStart": true
|
|
108
|
+
},
|
|
109
|
+
"cloud": {
|
|
110
|
+
"provider": "deepgram",
|
|
111
|
+
"apiKeyEnv": "DEEPGRAM_API_KEY"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
This gives the extension enough structure to support migrations, validation, and enterprise-grade UX.
|
|
118
|
+
|
|
119
|
+
### 2) Separate concerns inside the extension
|
|
120
|
+
Refactor the single large `extensions/voice.ts` file into focused modules.
|
|
121
|
+
|
|
122
|
+
Recommended structure:
|
|
123
|
+
|
|
124
|
+
- `extensions/voice.ts` or `extensions/voice/index.ts` — thin entrypoint
|
|
125
|
+
- `extensions/voice/config.ts` — schema, loading, saving, migration, scope handling
|
|
126
|
+
- `extensions/voice/onboarding.ts` — first-run flow orchestration
|
|
127
|
+
- `extensions/voice/ui.ts` — reusable TUI components and option lists
|
|
128
|
+
- `extensions/voice/diagnostics.ts` — environment scan and validation
|
|
129
|
+
- `extensions/voice/install.ts` — dependency provisioning and command runners
|
|
130
|
+
- `extensions/voice/runtime.ts` — recording, transcription, daemon integration
|
|
131
|
+
- `extensions/voice/btw.ts` — BTW side-conversation feature
|
|
132
|
+
|
|
133
|
+
This is required before polishing UX; the current single-file layout is too dense for safe iteration.
|
|
134
|
+
|
|
135
|
+
### 3) Capability scan + recommendation engine
|
|
136
|
+
Build a diagnostic layer that returns a structured environment report before onboarding makes recommendations.
|
|
137
|
+
|
|
138
|
+
Inputs:
|
|
139
|
+
- `python3` availability
|
|
140
|
+
- SoX / `rec`
|
|
141
|
+
- Homebrew availability
|
|
142
|
+
- current backend availability from `transcribe.py --list-backends`
|
|
143
|
+
- env vars like `DEEPGRAM_API_KEY`
|
|
144
|
+
- maybe available RAM / CPU class / Apple Silicon detection
|
|
145
|
+
|
|
146
|
+
Outputs:
|
|
147
|
+
- recommended mode
|
|
148
|
+
- recommended backend
|
|
149
|
+
- recommended model
|
|
150
|
+
- blocking issues
|
|
151
|
+
- fixable issues
|
|
152
|
+
- commands required for remediation
|
|
153
|
+
|
|
154
|
+
### 4) First-run onboarding trigger
|
|
155
|
+
On `session_start`, the extension should:
|
|
156
|
+
- load and migrate config,
|
|
157
|
+
- skip onboarding in non-interactive mode,
|
|
158
|
+
- skip onboarding if already completed and still valid,
|
|
159
|
+
- otherwise show onboarding UI,
|
|
160
|
+
- only start the daemon after configuration is valid.
|
|
161
|
+
|
|
162
|
+
This replaces the current eager daemon startup behavior.
|
|
163
|
+
|
|
164
|
+
## Implementation phases
|
|
165
|
+
|
|
166
|
+
### Phase 0 — stabilize current behavior
|
|
167
|
+
Goal: remove correctness risks before adding more UX.
|
|
168
|
+
|
|
169
|
+
Changes:
|
|
170
|
+
- Pass `backend` and `model` explicitly in daemon transcribe requests.
|
|
171
|
+
- Ensure daemon config reloads when saved config differs from loaded daemon state.
|
|
172
|
+
- Stop using one hard-coded global socket path; derive a safer user/session-specific socket path.
|
|
173
|
+
- Prevent automatic daemon startup before onboarding/validation succeeds.
|
|
174
|
+
|
|
175
|
+
Files:
|
|
176
|
+
- `extensions/voice.ts`
|
|
177
|
+
- `daemon.py`
|
|
178
|
+
|
|
179
|
+
Priority: **P0**
|
|
180
|
+
|
|
181
|
+
### Phase 1 — config and diagnostics foundation
|
|
182
|
+
Goal: create the substrate required for polished onboarding.
|
|
183
|
+
|
|
184
|
+
Changes:
|
|
185
|
+
- Introduce versioned config schema and migration helpers.
|
|
186
|
+
- Add a diagnostics engine that returns structured install/readiness state.
|
|
187
|
+
- Add save helpers for both global and project scope.
|
|
188
|
+
- Record onboarding completion/version.
|
|
189
|
+
|
|
190
|
+
Files:
|
|
191
|
+
- new `extensions/voice/config.ts`
|
|
192
|
+
- new `extensions/voice/diagnostics.ts`
|
|
193
|
+
- trim `extensions/voice.ts`
|
|
194
|
+
|
|
195
|
+
Priority: **P0**
|
|
196
|
+
|
|
197
|
+
### Phase 2 — world-class onboarding TUI
|
|
198
|
+
Goal: deliver the actual guided experience.
|
|
199
|
+
|
|
200
|
+
Flow:
|
|
201
|
+
- welcome screen
|
|
202
|
+
- choose **API** or **Download**
|
|
203
|
+
- show recommendation card
|
|
204
|
+
- choose backend/provider
|
|
205
|
+
- choose model/profile
|
|
206
|
+
- choose config scope (global vs project)
|
|
207
|
+
- confirm summary
|
|
208
|
+
|
|
209
|
+
Implementation notes:
|
|
210
|
+
- Use `ctx.ui.custom()` with `SelectList`, bordered layout, and clear footer hints.
|
|
211
|
+
- Keep a consistent visual system across steps.
|
|
212
|
+
- Add timeout-free, deliberate, keyboard-first navigation.
|
|
213
|
+
- Support “Back”, “Cancel”, and “Skip for now”.
|
|
214
|
+
- If skipped, set explicit incomplete state and show a persistent lightweight reminder, not a blocking modal every turn.
|
|
215
|
+
|
|
216
|
+
Files:
|
|
217
|
+
- new `extensions/voice/onboarding.ts`
|
|
218
|
+
- new `extensions/voice/ui.ts`
|
|
219
|
+
- `extensions/voice.ts`
|
|
220
|
+
|
|
221
|
+
Priority: **P0**
|
|
222
|
+
|
|
223
|
+
### Phase 3 — provisioning engine
|
|
224
|
+
Goal: make setup actually succeed, not just save preferences.
|
|
225
|
+
|
|
226
|
+
API mode:
|
|
227
|
+
- detect existing `DEEPGRAM_API_KEY`
|
|
228
|
+
- if absent, ask for it or provide precise setup instructions
|
|
229
|
+
- validate with a lightweight connectivity/provider check
|
|
230
|
+
|
|
231
|
+
Download mode:
|
|
232
|
+
- detect/install SoX
|
|
233
|
+
- detect/install Python package dependencies per backend
|
|
234
|
+
- offer backend-specific installation plans
|
|
235
|
+
- optionally pre-load model or warm daemon
|
|
236
|
+
- show progress and explicit failures with recovery suggestions
|
|
237
|
+
|
|
238
|
+
Important principle:
|
|
239
|
+
- Enterprise-grade means **automatic where safe, explicit where not**.
|
|
240
|
+
- If auto-install fails, the extension should capture stderr and render an actionable next-step screen.
|
|
241
|
+
|
|
242
|
+
Files:
|
|
243
|
+
- new `extensions/voice/install.ts`
|
|
244
|
+
- `transcribe.py`
|
|
245
|
+
- `daemon.py`
|
|
246
|
+
- `package.json` for scripts and packaging metadata
|
|
247
|
+
|
|
248
|
+
Priority: **P1**
|
|
249
|
+
|
|
250
|
+
### Phase 4 — post-onboarding runtime polish
|
|
251
|
+
Goal: make the configured experience feel premium every day.
|
|
252
|
+
|
|
253
|
+
Changes:
|
|
254
|
+
- Better status text than `MIC` / `REC` / `STT...`; include backend or mode when helpful.
|
|
255
|
+
- Add `/voice doctor` for full diagnostics and auto-fix suggestions.
|
|
256
|
+
- Add `/voice reconfigure` as the canonical onboarding re-entry point.
|
|
257
|
+
- Add `/voice test` upgrade: record, transcribe, and summarize readiness in one view.
|
|
258
|
+
- Improve empty-editor hold-to-talk discoverability with a first-success toast and help text.
|
|
259
|
+
- Persist last-known-good daemon/backend status.
|
|
260
|
+
|
|
261
|
+
Files:
|
|
262
|
+
- `extensions/voice.ts`
|
|
263
|
+
- `extensions/voice/runtime.ts`
|
|
264
|
+
- `extensions/voice/diagnostics.ts`
|
|
265
|
+
|
|
266
|
+
Priority: **P1**
|
|
267
|
+
|
|
268
|
+
### Phase 5 — package, docs, and release hardening
|
|
269
|
+
Goal: make the package credible and supportable.
|
|
270
|
+
|
|
271
|
+
Changes:
|
|
272
|
+
- Add `README.md` with:
|
|
273
|
+
- value proposition
|
|
274
|
+
- first-run behavior
|
|
275
|
+
- cloud vs local comparison
|
|
276
|
+
- supported backends/models
|
|
277
|
+
- install requirements
|
|
278
|
+
- troubleshooting
|
|
279
|
+
- Add `docs/` pages for backend matrix and operational behavior.
|
|
280
|
+
- Add screenshots/GIF for package gallery metadata.
|
|
281
|
+
- Update `package.json` metadata and files list to include docs/README.
|
|
282
|
+
- Add changelog and release checklist.
|
|
283
|
+
|
|
284
|
+
Files:
|
|
285
|
+
- new `README.md`
|
|
286
|
+
- new `docs/backends.md`
|
|
287
|
+
- new `docs/troubleshooting.md`
|
|
288
|
+
- `package.json`
|
|
289
|
+
|
|
290
|
+
Priority: **P1**
|
|
291
|
+
|
|
292
|
+
## File-level change list
|
|
293
|
+
|
|
294
|
+
### `extensions/voice.ts`
|
|
295
|
+
- Reduce to extension wiring and command registration.
|
|
296
|
+
- Call config migration and onboarding gate on `session_start`.
|
|
297
|
+
- Defer daemon startup until readiness confirmed.
|
|
298
|
+
- Route `/voice setup` to the new onboarding flow.
|
|
299
|
+
- Add `/voice doctor` and `/voice reconfigure`.
|
|
300
|
+
|
|
301
|
+
### `daemon.py`
|
|
302
|
+
- Support explicit backend/model consistency checks.
|
|
303
|
+
- Consider richer status payload for UI/doctor flow.
|
|
304
|
+
- Use safer socket naming strategy.
|
|
305
|
+
|
|
306
|
+
### `transcribe.py`
|
|
307
|
+
- Expand backend metadata with recommendation hints, install strategy, and maybe estimated resource tiers.
|
|
308
|
+
- Add machine-readable diagnostics output beyond `--list-backends` if needed.
|
|
309
|
+
|
|
310
|
+
### `package.json`
|
|
311
|
+
- Add `README.md` to `files`.
|
|
312
|
+
- Add scripts for `typecheck`, Python smoke validation, and tests.
|
|
313
|
+
- Potentially add gallery image/video metadata.
|
|
314
|
+
|
|
315
|
+
### New docs
|
|
316
|
+
- `README.md`
|
|
317
|
+
- `docs/backends.md`
|
|
318
|
+
- `docs/troubleshooting.md`
|
|
319
|
+
- `docs/plans/...` (this file)
|
|
320
|
+
|
|
321
|
+
## Testing strategy
|
|
322
|
+
|
|
323
|
+
### Automated
|
|
324
|
+
TypeScript:
|
|
325
|
+
- config migration tests
|
|
326
|
+
- onboarding decision logic tests
|
|
327
|
+
- diagnostics parser tests
|
|
328
|
+
- command routing tests
|
|
329
|
+
|
|
330
|
+
Python:
|
|
331
|
+
- backend metadata smoke tests
|
|
332
|
+
- daemon command contract tests
|
|
333
|
+
- config-specific load/transcribe path tests
|
|
334
|
+
|
|
335
|
+
Integration:
|
|
336
|
+
- first-run with no config
|
|
337
|
+
- first-run with API key present
|
|
338
|
+
- first-run with local backend already installed
|
|
339
|
+
- skipped onboarding then reconfigure
|
|
340
|
+
- stale daemon with mismatched model
|
|
341
|
+
|
|
342
|
+
### Manual verification matrix
|
|
343
|
+
- macOS Apple Silicon with faster-whisper available
|
|
344
|
+
- no SoX installed
|
|
345
|
+
- no Python backend installed
|
|
346
|
+
- Deepgram API key present / absent
|
|
347
|
+
- project-local scope vs global scope
|
|
348
|
+
- interactive TUI mode vs non-interactive mode
|
|
349
|
+
|
|
350
|
+
### Acceptance criteria
|
|
351
|
+
- Fresh install leads to a guided flow without requiring `/voice setup`.
|
|
352
|
+
- User is explicitly asked **API or download** before backend/model details.
|
|
353
|
+
- At least one happy path completes end-to-end and verifies with a real test transcription.
|
|
354
|
+
- Failed provisioning produces actionable remediation, not silent degradation.
|
|
355
|
+
- Re-running setup is safe and deterministic.
|
|
356
|
+
- Docs are sufficient for a new user to understand tradeoffs before enabling voice.
|
|
357
|
+
|
|
358
|
+
## Rollout priorities
|
|
359
|
+
|
|
360
|
+
### Must ship first
|
|
361
|
+
1. P0 stabilization fixes
|
|
362
|
+
2. Config schema + diagnostics foundation
|
|
363
|
+
3. First-run onboarding with API vs download decision
|
|
364
|
+
|
|
365
|
+
### Should ship next
|
|
366
|
+
4. Automated provisioning
|
|
367
|
+
5. `/voice doctor` and upgraded validation flow
|
|
368
|
+
6. README + troubleshooting docs
|
|
369
|
+
|
|
370
|
+
### Nice-to-have after that
|
|
371
|
+
7. More providers than Deepgram
|
|
372
|
+
8. richer model recommendations based on hardware
|
|
373
|
+
9. onboarding screenshots/video for package gallery
|
|
374
|
+
|
|
375
|
+
## Recommended execution order
|
|
376
|
+
|
|
377
|
+
1. Refactor for modularity.
|
|
378
|
+
2. Fix daemon/config correctness issues.
|
|
379
|
+
3. Add diagnostics layer.
|
|
380
|
+
4. Add first-run onboarding gate.
|
|
381
|
+
5. Add install/provisioning actions.
|
|
382
|
+
6. Add validation flow.
|
|
383
|
+
7. Add docs and release hardening.
|
|
384
|
+
|
|
385
|
+
## Final recommendation
|
|
386
|
+
|
|
387
|
+
Do **not** start with visual polish alone. The right order is:
|
|
388
|
+
|
|
389
|
+
**correctness -> diagnostics -> onboarding -> provisioning -> docs**.
|
|
390
|
+
|
|
391
|
+
If those are shipped in that order, `pi-voice` can feel like a premium enterprise extension instead of an expert-only prototype.
|