@drakulavich/kesha-voice-kit 1.29.1 → 1.31.0
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/NOTICES.md +1 -1
- package/README.md +1 -1
- package/completions/kesha.bash +1 -1
- package/completions/kesha.fish +0 -1
- package/completions/kesha.zsh +3 -1
- package/docs/diagnostic-logs.md +36 -3
- package/model-plan.json +130 -0
- package/package.json +4 -3
- package/src/cli/action-result.ts +2 -1
- package/src/cli/command-session.ts +22 -0
- package/src/cli/completions.ts +4 -2
- package/src/cli/dispatch.ts +37 -5
- package/src/cli/init.ts +10 -8
- package/src/cli/install.ts +20 -13
- package/src/cli/main.ts +70 -44
- package/src/cli/mcp.ts +2 -0
- package/src/cli/options.ts +79 -0
- package/src/cli/record.ts +12 -4
- package/src/cli/say.ts +105 -42
- package/src/cli/stats.ts +9 -4
- package/src/cli/support-bundle.ts +3 -3
- package/src/cli.ts +1 -1
- package/src/diagnostic-log.ts +2 -9
- package/src/doctor.ts +61 -3
- package/src/engine/describe.ts +227 -0
- package/src/engine/events.ts +249 -0
- package/src/engine-health.ts +14 -14
- package/src/engine-install.ts +138 -100
- package/src/engine-targets.ts +3 -3
- package/src/engine.ts +278 -387
- package/src/error-utils.ts +4 -1
- package/src/fluid-asr-cache.ts +3 -3
- package/src/fluid-roots.ts +9 -4
- package/src/format.ts +11 -5
- package/src/install-lock.ts +55 -20
- package/src/install-plan.ts +76 -7
- package/src/kokoro-ane.ts +70 -7
- package/src/language-routing.ts +37 -0
- package/src/lib.ts +17 -9
- package/src/log.ts +2 -0
- package/src/mcp/audio-output.ts +2 -2
- package/src/mcp/tools.ts +7 -5
- package/src/mcp/voices.ts +3 -37
- package/src/paths.ts +2 -2
- package/src/process-tree.ts +62 -12
- package/src/progress.ts +34 -2
- package/src/shell-artifacts.ts +4 -3
- package/src/state-paths.ts +84 -0
- package/src/stats.ts +2 -10
- package/src/status.ts +40 -30
- package/src/synth.ts +99 -95
- package/src/transcribe.ts +28 -25
- package/src/voice-inventory.ts +51 -0
- package/src/voice-routing.ts +97 -6
- package/tsconfig.json +1 -1
- package/src/error-codes.ts +0 -45
package/NOTICES.md
CHANGED
|
@@ -19,7 +19,7 @@ see [speechbrain/lang-id-voxlingua107-ecapa](https://huggingface.co/speechbrain/
|
|
|
19
19
|
### Silero VAD v5 (opt-in: `kesha install --vad`)
|
|
20
20
|
|
|
21
21
|
Voice activity detection. MIT. Authored by [Silero Team](https://github.com/snakers4/silero-vad).
|
|
22
|
-
Pinned to the `v6.2.1` tag.
|
|
22
|
+
Pinned to a commit (the `v6.2.1` tag's target at the time of pinning).
|
|
23
23
|
|
|
24
24
|
## Models downloaded by `kesha install --tts`
|
|
25
25
|
|
package/README.md
CHANGED
|
@@ -158,7 +158,7 @@ All of these install the Bun CLI wrapper; engine + models still download explici
|
|
|
158
158
|
- [Use cases](docs/use-cases.md) — copy-paste recipes (transcribe a meeting, speak from OpenClaw, run offline, move the cache).
|
|
159
159
|
- [Product positioning](docs/product-positioning.md) — supported workflows, non-goals, maturity labels, platform matrix.
|
|
160
160
|
- [Changelog](CHANGELOG.md) — every release, with the behaviour changes spelled out.
|
|
161
|
-
- **Diagnostics:** `kesha doctor`, `kesha support-bundle` (redacted `.tar.gz` for issues), and `kesha logs` produce local, content-free diagnostics — see [docs/diagnostic-logs.md](docs/diagnostic-logs.md). Every failure prints a stable `error [CODE]: …` line and a documented [process exit code](docs/errors.md#process-exit-codes).
|
|
161
|
+
- **Diagnostics:** `kesha doctor`, `kesha support-bundle` (redacted `.tar.gz` for issues), and `kesha logs` produce local, content-free diagnostics — see [docs/diagnostic-logs.md](docs/diagnostic-logs.md). One variable, `KESHA_HOME`, moves everything Kesha writes (models, logs, stats) into a directory of your choice — see [where Kesha keeps its files](docs/diagnostic-logs.md#where-kesha-keeps-its-files). Every failure prints a stable `error [CODE]: …` line and a documented [process exit code](docs/errors.md#process-exit-codes).
|
|
162
162
|
- **Scripting & CI:** `--json` (or `--toon`) for machine-readable output, `--include-errors` (with either) to get per-file failures on stdout alongside the results, `--quiet`/`-q` to silence progress, and `--no-color` (or `NO_COLOR=1`) for plain logs. Colors switch off automatically when `CI=true`.
|
|
163
163
|
- **Privacy / Local Stats:** Stats are **off by default** and fully local. Opt in with `kesha stats enable` to record content-free operational metrics in a local SQLite database — never networked, never storing audio, transcripts, text, or paths. Full commands & lifecycle: [docs/local-stats.md](docs/local-stats.md).
|
|
164
164
|
|
package/completions/kesha.bash
CHANGED
package/completions/kesha.fish
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# fish completion for kesha.
|
|
2
|
-
complete -c kesha -f
|
|
3
2
|
complete -c kesha -n '__fish_use_subcommand' -a 'completions' -d 'Print shell completion script for bash, zsh, or fish'
|
|
4
3
|
complete -c kesha -n '__fish_use_subcommand' -a 'doctor' -d 'Collect support diagnostics without changing local state'
|
|
5
4
|
complete -c kesha -n '__fish_use_subcommand' -a 'init' -d 'Interactive setup guide for Kesha features'
|
package/completions/kesha.zsh
CHANGED
|
@@ -40,6 +40,7 @@ _kesha() {
|
|
|
40
40
|
'--no-color[Disable ANSI colors (also via NO_COLOR=1; auto-off when CI=true)]'
|
|
41
41
|
else
|
|
42
42
|
_describe -t commands 'kesha command' commands
|
|
43
|
+
_files
|
|
43
44
|
fi
|
|
44
45
|
return
|
|
45
46
|
fi
|
|
@@ -155,7 +156,8 @@ _kesha() {
|
|
|
155
156
|
'--vad[Force Silero VAD preprocessing (kesha install --vad first). Without this, VAD auto-engages on audio ≥ 120s.]' \
|
|
156
157
|
'--no-vad[Force full-file ASR for short/medium files; long audio fails early. Incompatible with --speakers]' \
|
|
157
158
|
'--quiet[Suppress progress output; print only results and errors]' \
|
|
158
|
-
'--no-color[Disable ANSI colors (also via NO_COLOR=1; auto-off when CI=true)]'
|
|
159
|
+
'--no-color[Disable ANSI colors (also via NO_COLOR=1; auto-off when CI=true)]' \
|
|
160
|
+
'*:audio file:_files'
|
|
159
161
|
;;
|
|
160
162
|
esac
|
|
161
163
|
}
|
package/docs/diagnostic-logs.md
CHANGED
|
@@ -43,9 +43,11 @@ stage names, exit codes, duration numbers, and stable error codes.
|
|
|
43
43
|
|
|
44
44
|
When enabled, `kesha install`, `kesha <audio>`, and `kesha say` record command
|
|
45
45
|
lifecycle events such as `command.start`, `input.audio`, `input.missing`,
|
|
46
|
-
`engine.exit`,
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
`engine.exit`, `engine.debug` (the Engine's own `KESHA_DEBUG` timeline, carrying
|
|
47
|
+
its event name and typed fields but never its message text), and `command.finish`.
|
|
48
|
+
These events use only counts, booleans, format extensions, duration milliseconds,
|
|
49
|
+
and bucket labels. In the default `retain-on-failure` mode, successful runs still
|
|
50
|
+
leave no log file behind.
|
|
49
51
|
|
|
50
52
|
Diagnostic logs must not store:
|
|
51
53
|
|
|
@@ -75,6 +77,37 @@ Set `KESHA_LOG_DIR` to override the directory. The active file is
|
|
|
75
77
|
`kesha.ndjson`; rotated files are named `kesha.1.ndjson`, `kesha.2.ndjson`, and
|
|
76
78
|
so on.
|
|
77
79
|
|
|
80
|
+
## Where Kesha keeps its files
|
|
81
|
+
|
|
82
|
+
Kesha writes to four places. Each resolves by the same rule: its own variable
|
|
83
|
+
when set, otherwise the path under `KESHA_HOME` when that is set, otherwise the
|
|
84
|
+
platform default. `KESHA_HOME` uses one layout on every platform, so a test run,
|
|
85
|
+
a CI job or a second profile needs exactly one variable to leave your real
|
|
86
|
+
models, logs and Stats untouched. Nothing is moved when you set it: a fresh
|
|
87
|
+
`KESHA_HOME` starts with an empty cache, and `kesha install` fills it. Two roots FluidAudio owns stay outside it on darwin-arm64: the Kokoro ANE bundles and voice packs under `~/.cache/fluidaudio`, and its Silero VAD copy under `~/Library/Application Support/FluidAudio`; `status --disk` reports both as external roots, and `kesha install --tts` stages into the first regardless of `KESHA_HOME`.
|
|
88
|
+
|
|
89
|
+
| What | Default (macOS / Windows / Linux) | Under `KESHA_HOME` | Own variable |
|
|
90
|
+
|---|---|---|---|
|
|
91
|
+
| Model cache: engine, models, `recordings/` | `~/.cache/kesha` everywhere | `<home>/cache` | `KESHA_CACHE_DIR` |
|
|
92
|
+
| Diagnostic log directory | `~/Library/Logs/kesha` / `%LOCALAPPDATA%\kesha\logs` / `$XDG_STATE_HOME/kesha/logs` | `<home>/logs` | `KESHA_LOG_DIR` |
|
|
93
|
+
| Stats DB | `~/Library/Application Support/kesha/stats.sqlite` / `%APPDATA%\kesha\stats.sqlite` / `$XDG_DATA_HOME/kesha/stats.sqlite` | `<home>/stats.sqlite` | `KESHA_STATS_DB` |
|
|
94
|
+
| MCP audio (`kesha mcp` synthesis output) | `<tmpdir>/kesha-mcp` | `<home>/mcp-audio` | none |
|
|
95
|
+
|
|
96
|
+
`kesha status --json` and `kesha doctor --json` report every path together with
|
|
97
|
+
the rule that decided it (`default`, `KESHA_HOME`, or the variable name), so an
|
|
98
|
+
isolated run can be verified from one command:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
KESHA_HOME=/tmp/kesha-ci kesha status --json | jq .paths
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
An empty variable counts as unset; a relative path is resolved against the
|
|
105
|
+
working directory when the command starts. The engine itself reads only
|
|
106
|
+
`KESHA_CACHE_DIR`, so the CLI hands it the resolved cache root under that name
|
|
107
|
+
whenever `KESHA_HOME` decided it. FluidAudio's own Silero VAD copy under
|
|
108
|
+
`~/Library/Application Support/FluidAudio` is placed by FluidAudio and stays
|
|
109
|
+
outside `KESHA_HOME`; `kesha status --disk` lists it as an external root.
|
|
110
|
+
|
|
78
111
|
The first implementation rotates at 10 MB and keeps 5 rotated files. `kesha logs
|
|
79
112
|
reset` deletes Kesha log files but preserves the selected mode.
|
|
80
113
|
|
package/model-plan.json
CHANGED
|
@@ -34,6 +34,136 @@
|
|
|
34
34
|
{ "relPath": "models/vosk-ru/bert/model.onnx", "sizeBytes": 654361598 },
|
|
35
35
|
{ "relPath": "models/vosk-ru/bert/vocab.txt", "sizeBytes": 1780720 }
|
|
36
36
|
],
|
|
37
|
+
"aneEn": [
|
|
38
|
+
{ "relPath": "KokoroAlbert.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
39
|
+
{ "relPath": "KokoroAlbert.mlmodelc/coremldata.bin", "sizeBytes": 433 },
|
|
40
|
+
{ "relPath": "KokoroAlbert.mlmodelc/metadata.json", "sizeBytes": 2480 },
|
|
41
|
+
{ "relPath": "KokoroAlbert.mlmodelc/model.mil", "sizeBytes": 101485 },
|
|
42
|
+
{ "relPath": "KokoroAlbert.mlmodelc/weights/weight.bin", "sizeBytes": 5718848 },
|
|
43
|
+
{ "relPath": "KokoroPostAlbert.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
44
|
+
{ "relPath": "KokoroPostAlbert.mlmodelc/coremldata.bin", "sizeBytes": 556 },
|
|
45
|
+
{ "relPath": "KokoroPostAlbert.mlmodelc/metadata.json", "sizeBytes": 4171 },
|
|
46
|
+
{ "relPath": "KokoroPostAlbert.mlmodelc/model.mil", "sizeBytes": 60047 },
|
|
47
|
+
{ "relPath": "KokoroPostAlbert.mlmodelc/weights/weight.bin", "sizeBytes": 13806464 },
|
|
48
|
+
{ "relPath": "KokoroAlignment.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
49
|
+
{ "relPath": "KokoroAlignment.mlmodelc/coremldata.bin", "sizeBytes": 484 },
|
|
50
|
+
{ "relPath": "KokoroAlignment.mlmodelc/metadata.json", "sizeBytes": 3021 },
|
|
51
|
+
{ "relPath": "KokoroAlignment.mlmodelc/model.mil", "sizeBytes": 8194 },
|
|
52
|
+
{ "relPath": "KokoroAlignment.mlmodelc/weights/weight.bin", "sizeBytes": 4128 },
|
|
53
|
+
{ "relPath": "KokoroProsody.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
54
|
+
{ "relPath": "KokoroProsody.mlmodelc/coremldata.bin", "sizeBytes": 421 },
|
|
55
|
+
{ "relPath": "KokoroProsody.mlmodelc/metadata.json", "sizeBytes": 2721 },
|
|
56
|
+
{ "relPath": "KokoroProsody.mlmodelc/model.mil", "sizeBytes": 79705 },
|
|
57
|
+
{ "relPath": "KokoroProsody.mlmodelc/weights/weight.bin", "sizeBytes": 8454272 },
|
|
58
|
+
{ "relPath": "KokoroNoise_v2.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
59
|
+
{ "relPath": "KokoroNoise_v2.mlmodelc/coremldata.bin", "sizeBytes": 440 },
|
|
60
|
+
{ "relPath": "KokoroNoise_v2.mlmodelc/metadata.json", "sizeBytes": 3020 },
|
|
61
|
+
{ "relPath": "KokoroNoise_v2.mlmodelc/model.mil", "sizeBytes": 93152 },
|
|
62
|
+
{ "relPath": "KokoroNoise_v2.mlmodelc/weights/weight.bin", "sizeBytes": 4580160 },
|
|
63
|
+
{ "relPath": "KokoroVocoder.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
64
|
+
{ "relPath": "KokoroVocoder.mlmodelc/coremldata.bin", "sizeBytes": 626 },
|
|
65
|
+
{ "relPath": "KokoroVocoder.mlmodelc/metadata.json", "sizeBytes": 4392 },
|
|
66
|
+
{ "relPath": "KokoroVocoder.mlmodelc/model.mil", "sizeBytes": 309130 },
|
|
67
|
+
{ "relPath": "KokoroVocoder.mlmodelc/weights/weight.bin", "sizeBytes": 48889920 },
|
|
68
|
+
{ "relPath": "KokoroTail.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
69
|
+
{ "relPath": "KokoroTail.mlmodelc/coremldata.bin", "sizeBytes": 392 },
|
|
70
|
+
{ "relPath": "KokoroTail.mlmodelc/metadata.json", "sizeBytes": 1872 },
|
|
71
|
+
{ "relPath": "KokoroTail.mlmodelc/model.mil", "sizeBytes": 7014 },
|
|
72
|
+
{ "relPath": "KokoroTail.mlmodelc/weights/weight.bin", "sizeBytes": 81088 },
|
|
73
|
+
{ "relPath": "vocab.json", "sizeBytes": 1416 },
|
|
74
|
+
{ "relPath": "af_heart.bin", "sizeBytes": 522240 }
|
|
75
|
+
],
|
|
76
|
+
"kokoroG2p": [
|
|
77
|
+
{ "relPath": "G2PEncoder.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
78
|
+
{ "relPath": "G2PEncoder.mlmodelc/coremldata.bin", "sizeBytes": 398 },
|
|
79
|
+
{ "relPath": "G2PEncoder.mlmodelc/metadata.json", "sizeBytes": 2034 },
|
|
80
|
+
{ "relPath": "G2PEncoder.mlmodelc/model.mil", "sizeBytes": 20392 },
|
|
81
|
+
{ "relPath": "G2PEncoder.mlmodelc/weights/weight.bin", "sizeBytes": 694592 },
|
|
82
|
+
{ "relPath": "G2PDecoder.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
83
|
+
{ "relPath": "G2PDecoder.mlmodelc/coremldata.bin", "sizeBytes": 545 },
|
|
84
|
+
{ "relPath": "G2PDecoder.mlmodelc/metadata.json", "sizeBytes": 3064 },
|
|
85
|
+
{ "relPath": "G2PDecoder.mlmodelc/model.mil", "sizeBytes": 19737 },
|
|
86
|
+
{ "relPath": "G2PDecoder.mlmodelc/weights/weight.bin", "sizeBytes": 828030 },
|
|
87
|
+
{ "relPath": "g2p_vocab.json", "sizeBytes": 1665 },
|
|
88
|
+
{ "relPath": "us_lexicon_cache.json", "sizeBytes": 10444631 }
|
|
89
|
+
],
|
|
90
|
+
"aneVoices": [
|
|
91
|
+
{ "relPath": "af_alloy.bin", "sizeBytes": 522240 },
|
|
92
|
+
{ "relPath": "af_aoede.bin", "sizeBytes": 522240 },
|
|
93
|
+
{ "relPath": "af_bella.bin", "sizeBytes": 522240 },
|
|
94
|
+
{ "relPath": "af_jessica.bin", "sizeBytes": 522240 },
|
|
95
|
+
{ "relPath": "af_kore.bin", "sizeBytes": 522240 },
|
|
96
|
+
{ "relPath": "af_nicole.bin", "sizeBytes": 522240 },
|
|
97
|
+
{ "relPath": "af_nova.bin", "sizeBytes": 522240 },
|
|
98
|
+
{ "relPath": "af_river.bin", "sizeBytes": 522240 },
|
|
99
|
+
{ "relPath": "af_sarah.bin", "sizeBytes": 522240 },
|
|
100
|
+
{ "relPath": "af_sky.bin", "sizeBytes": 522240 },
|
|
101
|
+
{ "relPath": "am_adam.bin", "sizeBytes": 522240 },
|
|
102
|
+
{ "relPath": "am_echo.bin", "sizeBytes": 522240 },
|
|
103
|
+
{ "relPath": "am_eric.bin", "sizeBytes": 522240 },
|
|
104
|
+
{ "relPath": "am_fenrir.bin", "sizeBytes": 522240 },
|
|
105
|
+
{ "relPath": "am_liam.bin", "sizeBytes": 522240 },
|
|
106
|
+
{ "relPath": "am_michael.bin", "sizeBytes": 522240 },
|
|
107
|
+
{ "relPath": "am_onyx.bin", "sizeBytes": 522240 },
|
|
108
|
+
{ "relPath": "am_puck.bin", "sizeBytes": 522240 },
|
|
109
|
+
{ "relPath": "am_santa.bin", "sizeBytes": 522240 },
|
|
110
|
+
{ "relPath": "bm_lewis.bin", "sizeBytes": 522240 },
|
|
111
|
+
{ "relPath": "em_alex.bin", "sizeBytes": 522240 },
|
|
112
|
+
{ "relPath": "ff_siwis.bin", "sizeBytes": 522240 },
|
|
113
|
+
{ "relPath": "hm_omega.bin", "sizeBytes": 522240 },
|
|
114
|
+
{ "relPath": "im_nicola.bin", "sizeBytes": 522240 },
|
|
115
|
+
{ "relPath": "jm_kumo.bin", "sizeBytes": 522240 },
|
|
116
|
+
{ "relPath": "pm_alex.bin", "sizeBytes": 522240 }
|
|
117
|
+
],
|
|
118
|
+
"aneZh": [
|
|
119
|
+
{ "relPath": "KokoroAlbert.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
120
|
+
{ "relPath": "KokoroAlbert.mlmodelc/coremldata.bin", "sizeBytes": 433 },
|
|
121
|
+
{ "relPath": "KokoroAlbert.mlmodelc/metadata.json", "sizeBytes": 2480 },
|
|
122
|
+
{ "relPath": "KokoroAlbert.mlmodelc/model.mil", "sizeBytes": 101485 },
|
|
123
|
+
{ "relPath": "KokoroAlbert.mlmodelc/weights/weight.bin", "sizeBytes": 5718848 },
|
|
124
|
+
{ "relPath": "KokoroPostAlbert.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
125
|
+
{ "relPath": "KokoroPostAlbert.mlmodelc/coremldata.bin", "sizeBytes": 556 },
|
|
126
|
+
{ "relPath": "KokoroPostAlbert.mlmodelc/metadata.json", "sizeBytes": 4171 },
|
|
127
|
+
{ "relPath": "KokoroPostAlbert.mlmodelc/model.mil", "sizeBytes": 60047 },
|
|
128
|
+
{ "relPath": "KokoroPostAlbert.mlmodelc/weights/weight.bin", "sizeBytes": 13806464 },
|
|
129
|
+
{ "relPath": "KokoroAlignment.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
130
|
+
{ "relPath": "KokoroAlignment.mlmodelc/coremldata.bin", "sizeBytes": 484 },
|
|
131
|
+
{ "relPath": "KokoroAlignment.mlmodelc/metadata.json", "sizeBytes": 3021 },
|
|
132
|
+
{ "relPath": "KokoroAlignment.mlmodelc/model.mil", "sizeBytes": 8194 },
|
|
133
|
+
{ "relPath": "KokoroAlignment.mlmodelc/weights/weight.bin", "sizeBytes": 4128 },
|
|
134
|
+
{ "relPath": "KokoroProsody.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
135
|
+
{ "relPath": "KokoroProsody.mlmodelc/coremldata.bin", "sizeBytes": 422 },
|
|
136
|
+
{ "relPath": "KokoroProsody.mlmodelc/metadata.json", "sizeBytes": 2721 },
|
|
137
|
+
{ "relPath": "KokoroProsody.mlmodelc/model.mil", "sizeBytes": 79705 },
|
|
138
|
+
{ "relPath": "KokoroProsody.mlmodelc/weights/weight.bin", "sizeBytes": 8454272 },
|
|
139
|
+
{ "relPath": "KokoroNoise_v2.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
140
|
+
{ "relPath": "KokoroNoise_v2.mlmodelc/coremldata.bin", "sizeBytes": 440 },
|
|
141
|
+
{ "relPath": "KokoroNoise_v2.mlmodelc/metadata.json", "sizeBytes": 3091 },
|
|
142
|
+
{ "relPath": "KokoroNoise_v2.mlmodelc/model.mil", "sizeBytes": 93152 },
|
|
143
|
+
{ "relPath": "KokoroNoise_v2.mlmodelc/weights/weight.bin", "sizeBytes": 4580160 },
|
|
144
|
+
{ "relPath": "KokoroVocoder.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
145
|
+
{ "relPath": "KokoroVocoder.mlmodelc/coremldata.bin", "sizeBytes": 627 },
|
|
146
|
+
{ "relPath": "KokoroVocoder.mlmodelc/metadata.json", "sizeBytes": 4392 },
|
|
147
|
+
{ "relPath": "KokoroVocoder.mlmodelc/model.mil", "sizeBytes": 309127 },
|
|
148
|
+
{ "relPath": "KokoroVocoder.mlmodelc/weights/weight.bin", "sizeBytes": 48889920 },
|
|
149
|
+
{ "relPath": "KokoroTail.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
150
|
+
{ "relPath": "KokoroTail.mlmodelc/coremldata.bin", "sizeBytes": 392 },
|
|
151
|
+
{ "relPath": "KokoroTail.mlmodelc/metadata.json", "sizeBytes": 1872 },
|
|
152
|
+
{ "relPath": "KokoroTail.mlmodelc/model.mil", "sizeBytes": 7014 },
|
|
153
|
+
{ "relPath": "KokoroTail.mlmodelc/weights/weight.bin", "sizeBytes": 81088 },
|
|
154
|
+
{ "relPath": "vocab.json", "sizeBytes": 1796 },
|
|
155
|
+
{ "relPath": "voices/zf_001.bin", "sizeBytes": 522240 },
|
|
156
|
+
{ "relPath": "voices/zm_050.bin", "sizeBytes": 522240 },
|
|
157
|
+
{ "relPath": "g2pw/g2pw.mlmodelc/analytics/coremldata.bin", "sizeBytes": 243 },
|
|
158
|
+
{ "relPath": "g2pw/g2pw.mlmodelc/coremldata.bin", "sizeBytes": 515 },
|
|
159
|
+
{ "relPath": "g2pw/g2pw.mlmodelc/metadata.json", "sizeBytes": 3717 },
|
|
160
|
+
{ "relPath": "g2pw/g2pw.mlmodelc/model.mil", "sizeBytes": 245446 },
|
|
161
|
+
{ "relPath": "g2pw/g2pw.mlmodelc/weights/weight.bin", "sizeBytes": 159294962 }
|
|
162
|
+
],
|
|
163
|
+
"aneZhG2p": [
|
|
164
|
+
{ "relPath": "g2p/pinyin_phrases.bin", "sizeBytes": 9552083 },
|
|
165
|
+
{ "relPath": "g2p/pinyin_single.bin", "sizeBytes": 480169 }
|
|
166
|
+
],
|
|
37
167
|
"diarize": [
|
|
38
168
|
{ "relPath": "models/diarize/SortformerNvidiaLow_v2.mlpackage/Manifest.json", "sizeBytes": 617 },
|
|
39
169
|
{ "relPath": "models/diarize/SortformerNvidiaLow_v2.mlpackage/Data/com.apple.CoreML/model.mlmodel", "sizeBytes": 856521 },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drakulavich/kesha-voice-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.31.0",
|
|
4
4
|
"description": "Give your tools a voice — speech to text and back, 25 languages, up to ~19× faster than Whisper. On your machine.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"keshaEngine": {
|
|
43
|
-
"version": "1.
|
|
43
|
+
"version": "1.26.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"test": "bun test --timeout 30000",
|
|
@@ -109,6 +109,7 @@
|
|
|
109
109
|
"overrides": {
|
|
110
110
|
"hono": "^4.12.25",
|
|
111
111
|
"fast-uri": "^3.1.5",
|
|
112
|
-
"ip-address": "^10.3.1"
|
|
112
|
+
"ip-address": "^10.3.1",
|
|
113
|
+
"smol-toml": "1.7.2"
|
|
113
114
|
}
|
|
114
115
|
}
|
package/src/cli/action-result.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { log } from "../log";
|
|
2
|
+
import { renderInvalidArg } from "./options";
|
|
2
3
|
|
|
3
4
|
export type ActionMessage = { level: "success" | "info" | "warn"; text: string };
|
|
4
5
|
|
|
@@ -9,7 +10,7 @@ export type ActionResult =
|
|
|
9
10
|
/** Renders an action's messages, writing `stdout` verbatim; a rejected action exits 2. */
|
|
10
11
|
export function emitActionResult(result: ActionResult): void {
|
|
11
12
|
if (!result.ok) {
|
|
12
|
-
log.error(result.error);
|
|
13
|
+
log.error(renderInvalidArg(result.error));
|
|
13
14
|
if (result.hint) log.warn(result.hint);
|
|
14
15
|
process.exit(2);
|
|
15
16
|
}
|
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
DiagnosticLogSession,
|
|
5
5
|
DiagnosticSessionStatus,
|
|
6
6
|
} from "../diagnostic-log";
|
|
7
|
+
import { setEngineDebugSink } from "../engine/events";
|
|
7
8
|
import { errorMessage } from "../error-utils";
|
|
8
9
|
import { log } from "../log";
|
|
9
10
|
import { createStatsRecorder } from "../stats";
|
|
@@ -46,12 +47,21 @@ export async function runCommandSession(
|
|
|
46
47
|
};
|
|
47
48
|
session.diagnosticLog.event("command.start", { command, ...startFields });
|
|
48
49
|
|
|
50
|
+
setEngineDebugSink((event) =>
|
|
51
|
+
session.diagnosticLog.event("engine.debug", {
|
|
52
|
+
t_ms: event.t_ms,
|
|
53
|
+
engineEvent: event.event ?? null,
|
|
54
|
+
...engineDebugFields(event.fields),
|
|
55
|
+
}),
|
|
56
|
+
);
|
|
49
57
|
let outcome: CommandOutcome;
|
|
50
58
|
try {
|
|
51
59
|
outcome = await body(session);
|
|
52
60
|
} catch (err) {
|
|
53
61
|
closeSessionQuietly(session, command, { status: "failed", itemCount: 0 });
|
|
54
62
|
throw err;
|
|
63
|
+
} finally {
|
|
64
|
+
setEngineDebugSink(null);
|
|
55
65
|
}
|
|
56
66
|
|
|
57
67
|
// A flush error must not displace a failure the command already has to report (Greptile P1/P2 on #607).
|
|
@@ -63,6 +73,18 @@ export async function runCommandSession(
|
|
|
63
73
|
return outcome;
|
|
64
74
|
}
|
|
65
75
|
|
|
76
|
+
// The message is prose and `event` is a reserved log field, so only the engine's typed fields ride along (Exploratory S9-F5).
|
|
77
|
+
function engineDebugFields(fields: unknown): DiagnosticLogFields {
|
|
78
|
+
const out: DiagnosticLogFields = {};
|
|
79
|
+
if (!fields || typeof fields !== "object" || Array.isArray(fields)) return out;
|
|
80
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
81
|
+
if (value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
82
|
+
out[key] = value;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
|
|
66
88
|
function closeSessionQuietly(
|
|
67
89
|
session: CommandSession,
|
|
68
90
|
command: StatsCommandName,
|
package/src/cli/completions.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineCommand } from "citty";
|
|
2
2
|
import { log } from "../log";
|
|
3
|
+
import { renderInvalidArg } from "./options";
|
|
3
4
|
// Inlined because import.meta.url escapes the embedded filesystem in the compiled .deb/.rpm binary (#914).
|
|
4
5
|
import bashCompletions from "../../completions/kesha.bash" with { type: "text" };
|
|
5
6
|
import zshCompletions from "../../completions/kesha.zsh" with { type: "text" };
|
|
@@ -29,14 +30,15 @@ export const completionsCommand = defineCommand({
|
|
|
29
30
|
args: {
|
|
30
31
|
shell: {
|
|
31
32
|
type: "positional",
|
|
32
|
-
required:
|
|
33
|
+
required: false,
|
|
33
34
|
description: "Shell: bash | zsh | fish",
|
|
34
35
|
},
|
|
35
36
|
},
|
|
36
37
|
async run({ args }: { args: CompletionsCommandArgs }) {
|
|
37
38
|
const shell = args.shell;
|
|
38
39
|
if (!shell || !isShell(shell)) {
|
|
39
|
-
log.error(
|
|
40
|
+
log.error(renderInvalidArg(shell ? `unknown shell '${shell}' (bash, zsh or fish)` : "missing shell (bash, zsh or fish)"));
|
|
41
|
+
process.stderr.write("usage: kesha completions <bash|zsh|fish>\n");
|
|
40
42
|
process.exit(2);
|
|
41
43
|
}
|
|
42
44
|
process.stdout.write(SHELL_SCRIPTS[shell]);
|
package/src/cli/dispatch.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { runMain, type CommandDef } from "citty";
|
|
1
|
+
import { runMain, type ArgsDef, type CommandDef } from "citty";
|
|
2
2
|
import { existsSync } from "fs";
|
|
3
3
|
import { log } from "../log";
|
|
4
4
|
import { guardStdoutWrites } from "../stdout-pipe";
|
|
5
5
|
import { suggestCommand } from "../suggest-command";
|
|
6
6
|
import { applyCliContext, resolveCliContext } from "./context";
|
|
7
|
+
import { rejectUnknownOptions, renderInvalidArg } from "./options";
|
|
7
8
|
|
|
8
9
|
// Lazy loaders so a cold CLI spawn transpiles only the invoked command, not the whole graph (#568).
|
|
9
10
|
// `CommandDef<any>`: citty's generic is invariant in the arg shape and each command has its own schema.
|
|
@@ -89,18 +90,42 @@ export function unknownCommandMessages(token: string, subcommandKeys: string[]):
|
|
|
89
90
|
return { errorLine: `unknown command '${token}'`, warnLines };
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
async function resolveArgsDef(command: CommandDef<any>): Promise<ArgsDef> {
|
|
94
|
+
const args = command.args;
|
|
95
|
+
return (typeof args === "function" ? await args() : await args) ?? {};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** `kesha --json record --out j.wav` is `record --json --out j.wav`: flag-shaped tokens before a subcommand name move behind it (S3-F3). */
|
|
99
|
+
export function hoistLeadingFlags(rawArgs: string[], subcommandKeys: string[]): string[] {
|
|
100
|
+
let i = 0;
|
|
101
|
+
while (i < rawArgs.length && rawArgs[i]!.startsWith("-") && rawArgs[i] !== "--") i++;
|
|
102
|
+
const name = rawArgs[i];
|
|
103
|
+
if (i === 0 || name === undefined || !subcommandKeys.includes(name)) return rawArgs;
|
|
104
|
+
return [name, ...rawArgs.slice(0, i), ...rawArgs.slice(i + 1)];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** A subcommand name that a valued leading flag hid from hoisting, unless a file of that name exists. */
|
|
108
|
+
function misplacedSubcommand(rawArgs: string[], subcommandKeys: string[]): string | undefined {
|
|
109
|
+
const end = rawArgs.indexOf("--");
|
|
110
|
+
return rawArgs.slice(0, end === -1 ? undefined : end).find((arg) => subcommandKeys.includes(arg) && !existsSync(arg));
|
|
111
|
+
}
|
|
112
|
+
|
|
92
113
|
export async function runCli(argv = process.argv.slice(2)): Promise<void> {
|
|
93
114
|
guardStdoutWrites();
|
|
94
115
|
const context = resolveCliContext(argv);
|
|
95
116
|
applyCliContext(context);
|
|
96
117
|
|
|
97
|
-
const [firstArg, ...restArgs] = context.rawArgs;
|
|
98
118
|
const subcommandKeys = SUBCOMMAND_NAMES;
|
|
119
|
+
const rawArgs = hoistLeadingFlags(context.rawArgs, subcommandKeys);
|
|
120
|
+
const [firstArg, ...restArgs] = rawArgs;
|
|
99
121
|
|
|
100
122
|
switch (classifyFirstArg(firstArg, subcommandKeys)) {
|
|
101
|
-
case "subcommand":
|
|
102
|
-
|
|
123
|
+
case "subcommand": {
|
|
124
|
+
const command = await SUBCOMMANDS[firstArg!]!();
|
|
125
|
+
rejectUnknownOptions(restArgs, await resolveArgsDef(command));
|
|
126
|
+
await runMain(command, { rawArgs: restArgs });
|
|
103
127
|
return;
|
|
128
|
+
}
|
|
104
129
|
|
|
105
130
|
case "unknown": {
|
|
106
131
|
// Extensionless existing files are valid transcription inputs; bare non-path tokens are likely command typos.
|
|
@@ -112,8 +137,15 @@ export async function runCli(argv = process.argv.slice(2)): Promise<void> {
|
|
|
112
137
|
}
|
|
113
138
|
|
|
114
139
|
default: {
|
|
140
|
+
const misplaced = misplacedSubcommand(rawArgs, subcommandKeys);
|
|
141
|
+
if (misplaced !== undefined) {
|
|
142
|
+
log.error(renderInvalidArg(`put global flags after the subcommand: kesha ${misplaced} ...`));
|
|
143
|
+
process.exit(2);
|
|
144
|
+
}
|
|
115
145
|
const { createMainCommand } = await import("./main");
|
|
116
|
-
|
|
146
|
+
const command = createMainCommand(context);
|
|
147
|
+
rejectUnknownOptions(rawArgs, await resolveArgsDef(command));
|
|
148
|
+
await runMain(command, { rawArgs });
|
|
117
149
|
}
|
|
118
150
|
}
|
|
119
151
|
}
|
package/src/cli/init.ts
CHANGED
|
@@ -2,13 +2,15 @@ import { defineCommand } from "citty";
|
|
|
2
2
|
import { confirm, multiselect, isCancel, cancel } from "@clack/prompts";
|
|
3
3
|
import { installCommandTokens, renderInstallPlan } from "../install-plan";
|
|
4
4
|
import { log } from "../log";
|
|
5
|
+
import { errorMessage } from "../error-utils";
|
|
6
|
+
import { exitCodeFor } from "../engine/events";
|
|
5
7
|
import { getEngineCapabilities } from "../engine";
|
|
6
8
|
import {
|
|
7
9
|
installableTtsLangs,
|
|
8
10
|
performInstall,
|
|
9
11
|
resolveBackendFlag,
|
|
10
12
|
resolveNoCacheFlag,
|
|
11
|
-
|
|
13
|
+
unavailableBackendRefusal,
|
|
12
14
|
} from "./install";
|
|
13
15
|
import type { SharedInstallArgs } from "./types";
|
|
14
16
|
|
|
@@ -30,16 +32,16 @@ export type TtsLangPrompt = (preselect: string[]) => Promise<string[]>;
|
|
|
30
32
|
/** Signature of the interactive yes/no prompt (injectable for tests). */
|
|
31
33
|
export type ConfirmPrompt = (message: string, initialValue: boolean) => Promise<boolean>;
|
|
32
34
|
|
|
33
|
-
/** Ctrl-C at any prompt ends init without downloading,
|
|
35
|
+
/** Ctrl-C at any prompt ends init without downloading, exiting 130 like an interrupted install so `kesha init && …` stops (S4-F1). */
|
|
34
36
|
function exitIfCancelled<T>(answer: T | symbol): T {
|
|
35
37
|
if (isCancel(answer)) {
|
|
36
38
|
cancel("Init cancelled.");
|
|
37
|
-
process.exit(
|
|
39
|
+
process.exit(130);
|
|
38
40
|
}
|
|
39
41
|
return answer as T;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
async function promptTtsLangs(preselect: string[]): Promise<string[]> {
|
|
44
|
+
export async function promptTtsLangs(preselect: string[]): Promise<string[]> {
|
|
43
45
|
// A corrupt engine must leave init offering the fallback list rather than aborting the
|
|
44
46
|
// guided setup that would replace it (#770).
|
|
45
47
|
const caps = await getEngineCapabilities().catch(() => null);
|
|
@@ -55,7 +57,7 @@ async function promptTtsLangs(preselect: string[]): Promise<string[]> {
|
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
/** #677: keep every prompt on clack — its close() unpipes stdin, deadlocking any readline sharing it. */
|
|
58
|
-
async function promptConfirm(message: string, initialValue: boolean): Promise<boolean> {
|
|
60
|
+
export async function promptConfirm(message: string, initialValue: boolean): Promise<boolean> {
|
|
59
61
|
return exitIfCancelled(await confirm({ message, initialValue }));
|
|
60
62
|
}
|
|
61
63
|
|
|
@@ -176,10 +178,10 @@ export async function promptInitSelection(
|
|
|
176
178
|
|
|
177
179
|
/** Mirrors the guard in `performInstall`: a preview must not describe an install this platform rejects (#684). */
|
|
178
180
|
async function printPlan(selection: InitSelection): Promise<boolean> {
|
|
179
|
-
const backendError =
|
|
181
|
+
const backendError = unavailableBackendRefusal(selection.backend);
|
|
180
182
|
if (backendError) {
|
|
181
|
-
log.error(backendError);
|
|
182
|
-
process.exitCode =
|
|
183
|
+
log.error(errorMessage(backendError));
|
|
184
|
+
process.exitCode = exitCodeFor(backendError);
|
|
183
185
|
return false;
|
|
184
186
|
}
|
|
185
187
|
log.info(
|
package/src/cli/install.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { defineCommand } from "citty";
|
|
2
2
|
import { errorMessage } from "../error-utils";
|
|
3
|
-
import { installEngine } from "../engine-install";
|
|
3
|
+
import { assertPlatformCanInstall, installEngine } from "../engine-install";
|
|
4
4
|
import { engineTarget, isDarwinArm64 } from "../engine-targets";
|
|
5
5
|
import { getEngineBinPath, getEngineCapabilities, type EngineCapabilities } from "../engine";
|
|
6
|
+
import { exitCodeFor, KeshaError } from "../engine/events";
|
|
6
7
|
import { renderInstallPlan } from "../install-plan";
|
|
7
8
|
import { maybeAskForStar } from "../star";
|
|
9
|
+
import { renderInvalidArg } from "./options";
|
|
8
10
|
import { log } from "../log";
|
|
9
11
|
import { packageVersion } from "../package-info";
|
|
10
12
|
import { isSemver } from "../semver.mjs";
|
|
@@ -171,6 +173,12 @@ function finishInstallDiagnostic(
|
|
|
171
173
|
}
|
|
172
174
|
}
|
|
173
175
|
|
|
176
|
+
/** The refusal `install`, `install --plan` and `init --plan` all render the same way (#684). */
|
|
177
|
+
export function unavailableBackendRefusal(backend: string | undefined): KeshaError | null {
|
|
178
|
+
const message = unavailableBackendError(backend);
|
|
179
|
+
return message ? new KeshaError("E_INVALID_ARG", message) : null;
|
|
180
|
+
}
|
|
181
|
+
|
|
174
182
|
/** Null when the requested backend is installable here. `KESHA_ENGINE_BIN` opts out — the user supplied their own engine. */
|
|
175
183
|
export function unavailableBackendError(backend: string | undefined): string | null {
|
|
176
184
|
const platformBackend = defaultBackendForPlatform();
|
|
@@ -197,11 +205,11 @@ export async function performInstall(options: PerformInstallOptions) {
|
|
|
197
205
|
const { noCache, backend, ttsLangs, vad = false, diarize = false, plan = false, engineVersion } =
|
|
198
206
|
options;
|
|
199
207
|
// A plan for an unavailable backend previews what its own printed command rejects (#684).
|
|
200
|
-
const backendError =
|
|
208
|
+
const backendError = unavailableBackendRefusal(backend);
|
|
201
209
|
if (plan) {
|
|
202
210
|
if (backendError) {
|
|
203
|
-
log.error(backendError);
|
|
204
|
-
process.exitCode =
|
|
211
|
+
log.error(errorMessage(backendError));
|
|
212
|
+
process.exitCode = exitCodeFor(backendError);
|
|
205
213
|
return;
|
|
206
214
|
}
|
|
207
215
|
log.info(
|
|
@@ -225,16 +233,15 @@ export async function performInstall(options: PerformInstallOptions) {
|
|
|
225
233
|
engineVersionOverride: engineVersion !== undefined,
|
|
226
234
|
});
|
|
227
235
|
|
|
228
|
-
|
|
236
|
+
try {
|
|
237
|
+
assertPlatformCanInstall({ diarize });
|
|
238
|
+
} catch (err) {
|
|
229
239
|
errorKind = "validation_failed";
|
|
230
|
-
throw
|
|
231
|
-
"--diarize is currently darwin-arm64 only " +
|
|
232
|
-
"(see https://github.com/drakulavich/kesha-voice-kit/issues/199).",
|
|
233
|
-
);
|
|
240
|
+
throw err;
|
|
234
241
|
}
|
|
235
242
|
if (backendError) {
|
|
236
243
|
errorKind = "validation_failed";
|
|
237
|
-
throw
|
|
244
|
+
throw backendError;
|
|
238
245
|
}
|
|
239
246
|
await installEngine({ noCache, backend, ttsLangs, vad, diarize, version: engineVersion });
|
|
240
247
|
await maybeAskForStar(getEngineBinPath(), packageVersion, log);
|
|
@@ -248,7 +255,7 @@ export async function performInstall(options: PerformInstallOptions) {
|
|
|
248
255
|
const message = errorMessage(err);
|
|
249
256
|
finishInstallDiagnostic(diagnosticLog, startedAt, "failed", errorKind);
|
|
250
257
|
log.error(message);
|
|
251
|
-
process.exit(1);
|
|
258
|
+
process.exit(err instanceof KeshaError ? exitCodeFor(err) : 1);
|
|
252
259
|
}
|
|
253
260
|
}
|
|
254
261
|
|
|
@@ -315,8 +322,8 @@ export const installCommand = defineCommand({
|
|
|
315
322
|
try {
|
|
316
323
|
ttsLangs = resolveTtsLangs({ tts: args.tts === true, positionals }, supported);
|
|
317
324
|
} catch (err) {
|
|
318
|
-
log.error(errorMessage(err));
|
|
319
|
-
process.exit(
|
|
325
|
+
log.error(renderInvalidArg(errorMessage(err)));
|
|
326
|
+
process.exit(2);
|
|
320
327
|
}
|
|
321
328
|
await performInstall({
|
|
322
329
|
noCache: resolveNoCacheFlag(args, rawArgs),
|