@aethrekh/pisces-echo
v0.1.0-beta.0
Published
Echo — opt-in TTS for Pi sessions. Reads assistant responses aloud using platform system speech (no API key required).
Maintainers
Readme
Echo
Opt-in TTS layer for Pi sessions. Reads assistant responses aloud using the platform's built-in speech engine — no API key, no cloud service, no extra dependencies.
Disabled by default. Enable with a .echo.json config file in your workspace or globally.
Installation
pi install npm:@aethrekh/pisces-echoQuick start
Create .echo.json in your project root (or run /echo --setup for the interactive wizard):
{ "mode": "assist", "voice": "Samantha", "sounds": true }Restart Pi. Echo sets a status line and begins classifying responses.
Modes
| Mode | What it speaks |
|---|---|
| "silent" | Nothing — no speech, no system prompt injection (default) |
| "verbose" | Every assistant response, full text, markdown stripped |
| "assist" | Only on: build/test completions, failures, confirmations, destructive operations |
| "companion" | Assist + wins, notable observations, interesting patterns |
assist and companion are LLM-driven: the model appends a hidden <echo> JSON block to every response classifying whether to speak and what to say. Echo strips the block before it reaches your terminal and fires TTS only when speak: true.
verbose bypasses classification entirely — it speaks every response directly without any model involvement.
Config reference
{
"mode": "assist", // "silent" | "verbose" | "assist" | "companion"
"voice": "Samantha", // any voice name from `say -v ?`, or "auto" for system default
"sounds": true // play a system sound cue before each spoken line
}Config is loaded from the first file found in this order:
.echo.jsonin the current workspace root~/.pi/echo.json(global default)
If neither exists, Echo defaults to silent — no audio, no injection.
Setup wizard
Run /echo --setup (or just /echo) from any Pi session to launch the interactive wizard:
- Voice picker — scrollable list of installed English voices (
say -v ?). Navigate with ↑/↓ and hear each voice speak a sample line as you scroll. Press Enter to confirm. - Mode picker — four options, each speaks a characteristic sample phrase in your chosen voice.
- Sounds toggle — plays the actual sound cue so you know what you're opting into.
- Write location — always writes to
.echo.jsonin the current workspace, then optionally to~/.pi/echo.jsonas a global default.
Platform support
| Platform | TTS engine | Voice selection |
|---|---|---|
| macOS | say | Any voice from say -v ? (e.g. Samantha, Daniel, Alex) |
| Linux | espeak | Voice name per espeak conventions (e.g. en+f3) |
| Windows | PowerShell SAPI | System.Speech.Synthesis.SpeechSynthesizer |
Speech is fire-and-forget — Pi never blocks waiting for audio to finish. Sending a new message stops any in-progress speech.
System sound cues:
| Priority | macOS | Linux |
|---|---|---|
| success | Glass.aiff | complete.oga (if present) |
| error | Basso.aiff | dialog-error.oga |
| warning | Purr.aiff | dialog-warning.oga |
| info | Pop.aiff | falls back silently |
How LLM classification works
In assist and companion modes, Echo appends a [REQUIRED — Echo voice layer] instruction to the system prompt. The model is told to append a structured JSON block at the end of every response:
<echo>{"speak":true,"summary":"Build complete. No warnings.","priority":"success"}</echo>Echo's message_end handler strips the block before it reaches your terminal. If speak: true, it fires the sound cue then calls say (or equivalent) with the summary text. Summaries are capped at 12 words by the model instruction — direct and characterful, not verbose.
If the model omits the block or produces malformed JSON, Echo silently no-ops. Use verbose mode if you need guaranteed audio without relying on model compliance.
Pi lifecycle hooks used
| Hook | Action |
|---|---|
| resources_discover | Loads config via event.cwd — the workspace path |
| session_start | Sets footer status: echo: assist · Samantha |
| before_agent_start | Injects <echo> classification instruction (assist/companion only) |
| message_end | Extracts <echo> block, strips from display, fires TTS |
| turn_start | Stops any in-progress speech when user sends next message |
| session_shutdown | Stops speech, clears config |
