{"_id":"@arvoretech/pi-kokoro-tts","_rev":"4-02b4efd95a48737dc84fae7637c5344c","name":"@arvoretech/pi-kokoro-tts","dist-tags":{"latest":"1.1.1"},"versions":{"1.1.0":{"name":"@arvoretech/pi-kokoro-tts","version":"1.1.0","keywords":["pi","extension","text-to-speech","tts","kokoro","voice"],"author":{"name":"Arvore"},"license":"MIT","_id":"@arvoretech/pi-kokoro-tts@1.1.0","maintainers":[{"name":"joao.barros.arvore","email":"joao.barros@arvore.com.br"},{"name":"ricardoraposorfox","email":"ricardorbxx1@gmail.com"},{"name":"jott4","email":"jvgcunha2002@gmail.com"},{"name":"vitor.piovezan","email":"vitor.piovezan@arvore.com.br"}],"homepage":"https://github.com/arvoreeducacao/arvore-pi-extensions#readme","bugs":{"url":"https://github.com/arvoreeducacao/arvore-pi-extensions/issues"},"pi":{"extensions":["./dist/index.js"]},"dist":{"shasum":"93d9efcd1149a5b81052016c18cbd6c9c7110ace","tarball":"https://registry.npmjs.org/@arvoretech/pi-kokoro-tts/-/pi-kokoro-tts-1.1.0.tgz","fileCount":6,"integrity":"sha512-nzCib6XDEiZh1XshKr+ZPuTh6tM/Zm408yJN1wKK08c/3RYMg3ox01xfMohqty+/VWVG2OtnoOP1uysWfFcacw==","signatures":[{"sig":"MEYCIQCkDvgIZMcQ+hoekr0NhVrPYQyIT+p8dz4NS2EamlZg1QIhANofrRbetKIEK1uJ0ZOveWCLwSDMe3Ub7nd8sHixV7EB","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38406},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"1c16de3664589c302fd6b277517058ec39644a87","scripts":{"dev":"tsc --watch","lint":"tsc --noEmit","build":"tsc"},"_npmUser":{"name":"jott4","email":"jvgcunha2002@gmail.com"},"repository":{"url":"git+https://github.com/arvoreeducacao/arvore-pi-extensions.git","type":"git","directory":"packages/kokoro-tts"},"_npmVersion":"11.12.1","description":"PI extension that speaks the assistant's responses out loud using a Kokoro-FastAPI text-to-speech endpoint","directories":{},"_nodeVersion":"24.15.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.0","@types/node":"^20.10.0","@earendil-works/pi-coding-agent":"0.79.1"},"peerDependencies":{"@earendil-works/pi-coding-agent":">=0.74.0"},"_npmOperationalInternal":{"tmp":"tmp/pi-kokoro-tts_1.1.0_1781562899494_0.3339430375911463","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@arvoretech/pi-kokoro-tts","version":"1.1.1","description":"PI extension that speaks the assistant's responses out loud using a Kokoro-FastAPI text-to-speech endpoint","main":"dist/index.js","types":"dist/index.d.ts","type":"module","peerDependencies":{"@earendil-works/pi-coding-agent":">=0.74.0"},"devDependencies":{"@earendil-works/pi-coding-agent":"0.79.1","@types/node":"^20.10.0","typescript":"^5.3.0"},"pi":{"extensions":["./dist/index.js"]},"keywords":["pi-package","pi","extension","text-to-speech","tts","kokoro","voice"],"repository":{"type":"git","url":"git+https://github.com/arvoreeducacao/arvore-pi-extensions.git","directory":"packages/kokoro-tts"},"author":{"name":"Arvore"},"license":"MIT","scripts":{"build":"tsc","dev":"tsc --watch","lint":"tsc --noEmit"},"_id":"@arvoretech/pi-kokoro-tts@1.1.1","bugs":{"url":"https://github.com/arvoreeducacao/arvore-pi-extensions/issues"},"homepage":"https://github.com/arvoreeducacao/arvore-pi-extensions#readme","_integrity":"sha512-yKK2YjB8+bCG2+TN9LuMt5TofHqXL8FQCYtJwYBNiahvzDx90z8AIuhnJnxE7bSid4b5Hqp1Ba6EfZRb47yBiQ==","_resolved":"/tmp/arvoretech-pi-kokoro-tts-1.1.1.tgz","_from":"file:/tmp/arvoretech-pi-kokoro-tts-1.1.1.tgz","_nodeVersion":"22.22.3","_npmVersion":"11.17.0","dist":{"integrity":"sha512-yKK2YjB8+bCG2+TN9LuMt5TofHqXL8FQCYtJwYBNiahvzDx90z8AIuhnJnxE7bSid4b5Hqp1Ba6EfZRb47yBiQ==","shasum":"91a23a1f1d8add3dfbbe232ea56619006f48cfc9","tarball":"https://registry.npmjs.org/@arvoretech/pi-kokoro-tts/-/pi-kokoro-tts-1.1.1.tgz","fileCount":6,"unpackedSize":38423,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@arvoretech%2fpi-kokoro-tts@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICf4pczUpL+66XEVg5f6utZZkNSAVxJ2yVsU1VTAd3JsAiBdCrtCLBie/yZQr4BQqwECSxEiOAjrZIRLfX5J+TUFgg=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:4b8a7c13-c4b3-4a0b-abab-b82f1ed68844"}},"directories":{},"maintainers":[{"name":"joao.barros.arvore","email":"joao.barros@arvore.com.br"},{"name":"rafsouza","email":"rafasouza@protonmail.com"},{"name":"pedro.adas","email":"pedro.adas@gmail.com"},{"name":"guilhermebs","email":"guilhermebscontact@gmail.com"},{"name":"ricardoraposorfox","email":"ricardorbxx1@gmail.com"},{"name":"jott4","email":"jvgcunha2002@gmail.com"},{"name":"vitor.piovezan","email":"vitor.piovezan@arvore.com.br"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-kokoro-tts_1.1.1_1782217142475_0.13740831766869177"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-15T22:34:59.388Z","modified":"2026-06-23T12:19:03.151Z","1.1.0":"2026-06-15T22:34:59.634Z","1.1.1":"2026-06-23T12:19:02.611Z"},"bugs":{"url":"https://github.com/arvoreeducacao/arvore-pi-extensions/issues"},"author":{"name":"Arvore"},"license":"MIT","homepage":"https://github.com/arvoreeducacao/arvore-pi-extensions#readme","keywords":["pi-package","pi","extension","text-to-speech","tts","kokoro","voice"],"repository":{"type":"git","url":"git+https://github.com/arvoreeducacao/arvore-pi-extensions.git","directory":"packages/kokoro-tts"},"description":"PI extension that speaks the assistant's responses out loud using a Kokoro-FastAPI text-to-speech endpoint","maintainers":[{"name":"joao.barros.arvore","email":"joao.barros@arvore.com.br"},{"name":"rafsouza","email":"rafasouza@protonmail.com"},{"name":"pedro.adas","email":"pedro.adas@gmail.com"},{"name":"guilhermebs","email":"guilhermebscontact@gmail.com"},{"name":"ricardoraposorfox","email":"ricardorbxx1@gmail.com"},{"name":"jott4","email":"jvgcunha2002@gmail.com"},{"name":"vitor.piovezan","email":"vitor.piovezan@arvore.com.br"}],"readme":"# @arvoretech/pi-kokoro-tts\n\nPI extension that speaks the assistant's responses out loud using a [Kokoro-FastAPI](https://github.com/remsky/Kokoro-FastAPI) text-to-speech endpoint.\n\nPairs with [`@arvoretech/pi-elevenlabs-stt`](../elevenlabs-stt) to enable a full voice loop: speak to pi (STT), pi answers in text, and this extension reads the answer back to you (TTS).\n\n## What it does\n\nRegisters a keyboard shortcut that toggles **voice mode**. While voice mode is on, every final assistant response is streamed to the Kokoro endpoint (`POST /v1/audio/speech`) and played through `ffplay` as it arrives.\n\n- **Toggle voice mode**: press the shortcut (default `ctrl+super+s` on macOS, `ctrl+alt+s` elsewhere). The footer shows `🔊 voice on` while enabled.\n- Audio streams in `pcm` (24 kHz mono) directly into `ffplay`, so playback starts before the full response is synthesized.\n- A new response interrupts any playback already in progress.\n- The voice-mode state is persisted in the session and restored on `--resume`.\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `/voice` | Toggle voice mode on/off. |\n| `/voice-select` | Select the Kokoro voice (e.g. `pf_dora`, `pm_alex`, `af_heart`). |\n| `/say [text]` | Speak the given text. With no argument, repeats the last spoken response. |\n| `/tts-stop` | Stop the current playback. |\n\n## Requirements\n\n- [`ffplay`](https://ffmpeg.org/) on `PATH` (ships with `ffmpeg`; used to play the audio stream).\n- A reachable Kokoro-FastAPI endpoint (see configuration).\n\n## Configuration\n\n| Env var | Default | Description |\n|---------|---------|-------------|\n| `KOKORO_TTS_URL` | `https://tts.arvore.com.br/v1` | Base URL of the Kokoro-FastAPI OpenAI-compatible API (without trailing slash). |\n| `KOKORO_TTS_API_KEY` | falls back to `ARVORE_TTS_API_KEY` | API key sent as the `X-API-Key` header. Required by the Arvore Kokoro gateway. |\n| `KOKORO_TTS_VOICE` | `pf_dora` | Voice name. `pf_dora` / `pm_alex` / `pm_santa` are the Brazilian Portuguese voices. Combinations like `pf_dora+af_heart` are supported by Kokoro. |\n| `KOKORO_TTS_MODEL` | `kokoro` | Model name sent in the request. |\n| `KOKORO_TTS_SPEED` | `1` | Speaking speed multiplier (`0.25`–`4`). |\n| `KOKORO_TTS_STREAMING` | `true` | Stream audio in chunks as the response arrives (low latency). Set to `false`/`0`/`off`/`no` to synthesize and play only the final response. |\n| `KOKORO_TTS_SHORTCUT` | `ctrl+super+s` (macOS), `ctrl+alt+s` (other) | Shortcut that toggles voice mode. On macOS, `super` is the Cmd key. |\n\n## Notes\n\n- Markdown is stripped before synthesis: code blocks, links, headings, and URLs are removed or simplified so the speech sounds natural.\n- Responses are truncated to 4000 characters per utterance.\n- Requires interactive (TUI) mode for the shortcut and footer status.\n- `/voice-select` opens an interactive picker (TUI only) listing the available PT/EN voices fetched from the endpoint, with the current voice marked. The selected voice is persisted in the session and restored on `--resume`, the same way the voice-mode state is. Voice mode itself is toggled with `/voice` or the shortcut.\n","readmeFilename":"README.md"}