opencode-interrupt-plugin 0.4.31 → 0.4.32

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 (2) hide show
  1. package/README.md +11 -12
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,36 +1,35 @@
1
1
  # OpenCode Interrupt Plugin
2
2
 
3
- Streaming TTS + voice interruption for OpenCode. Speaks responses as they arrive and detects when you talk over it. **Walkie-talkie mode** lets you hold the spacebar to redirect the model on the fly.
3
+ Streaming TTS + voice interruption for OpenCode. Speaks responses as they arrive and detects when you talk over it. **Walkie-talkie mode** lets you type `/ptt` to redirect the model on the fly.
4
4
 
5
5
  ## Installation
6
6
 
7
- Add both the server plugin and the TUI plugin to your `~/.config/opencode/opencode.json`:
7
+ Add the plugin to your `~/.config/opencode/opencode.json`:
8
8
 
9
9
  ```json
10
10
  {
11
11
  "plugin": [
12
- "opencode-interrupt-plugin",
13
- "opencode-interrupt-plugin/tui"
12
+ "opencode-interrupt-plugin"
14
13
  ]
15
14
  }
16
15
  ```
17
16
 
18
- The server plugin handles TTS streaming, voice overlap detection, and interrupt injection. The TUI plugin adds the walkie-talkie keybinding (`space`).
17
+ The plugin handles TTS streaming, voice overlap detection, interrupt injection, and the `/ptt` walkie-talkie slash command.
19
18
 
20
19
  ## Usage
21
20
 
22
21
  ### Walkie-Talkie Mode
23
22
 
24
- Hold down the **spacebar** while speaking, then release it to redirect the model:
23
+ Type `/ptt` to toggle recording, speak, then type `/ptt` again to send:
25
24
 
26
25
  1. The model is generating a response — TTS is playing
27
- 2. **Press and hold** spacebar — generation aborts, TTS stops, mic starts recording
28
- 3. **Speak your correction** while holding spacebar
29
- 4. **Release** spacebar — audio is transcribed via Whisper and sent as your next message
26
+ 2. **Type `/ptt`** — generation aborts, TTS stops, mic starts recording
27
+ 3. **Speak your correction**
28
+ 4. **Type `/ptt` again** — audio is transcribed via Whisper and sent as your next message
30
29
  5. The model responds to your correction
31
30
 
32
31
  ```
33
- [Model speaking] → hold space → speak correction → release space → model redirects
32
+ [Model speaking] → type /ptt → speak correction → type /ptt → model redirects
34
33
  ```
35
34
 
36
35
  Requires [whisper.cpp](https://github.com/ggerganov/whisper.cpp) with the `base` model installed.
@@ -42,7 +41,7 @@ bash scripts/install-whisper.sh
42
41
 
43
42
  Or set `OPENAI_API_KEY` in your environment as a fallback.
44
43
 
45
- ### Voice Interruption (server plugin)
44
+ ### Voice Interruption
46
45
 
47
46
  When TTS is playing, just speak — the plugin detects your voice, stops TTS, and marks the session for correction injection.
48
47
 
@@ -63,4 +62,4 @@ When TTS is playing, just speak — the plugin detects your voice, stops TTS, an
63
62
  ## How It Works
64
63
 
65
64
  - **Server plugin**: Monitors mic via sox (continuous PCM pipe), detects voice during TTS playback, injects correction context into the next LLM request
66
- - **TUI plugin**: Registers a `space` keybinding in OpenCode's TUI keymap; key repeats while held keep the recording active; 300ms of silence after release triggers transcription and redirect
65
+ - **`/ptt` command**: `command.execute.before` hook intercepts `/ptt`, toggles recording on/off, transcribes via whisper.cpp, and sends the transcript via `session.prompt()`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-interrupt-plugin",
3
- "version": "0.4.31",
3
+ "version": "0.4.32",
4
4
  "description": "Streaming TTS + voice interruption for OpenCode. Speaks responses as they arrive and detects when you talk over it.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",