opencode-interrupt-plugin 0.4.8 → 0.4.10

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.
@@ -37,10 +37,6 @@ export class VoiceOverlapDetector extends EventEmitter {
37
37
  }
38
38
  handleVoiceDetected(rms) {
39
39
  const ttsPlaying = this.getIsTTSPlaying();
40
- if (!ttsPlaying) {
41
- debug(`[interrupt-overlap] Voice detected (RMS=${rms.toFixed(6)}) but TTS not playing, ignoring`);
42
- return;
43
- }
44
40
  if (Date.now() < this.cooldownUntil) {
45
41
  debug(`[interrupt-overlap] In cooldown (${this.cooldownUntil - Date.now()}ms remaining), ignoring`);
46
42
  return;
@@ -48,8 +44,13 @@ export class VoiceOverlapDetector extends EventEmitter {
48
44
  const now = Date.now();
49
45
  this.cooldownUntil = now + this.COOLDOWN_MS;
50
46
  const partialContent = this.getPartialContent();
51
- debug(`[interrupt-overlap] OVERLAP! RMS=${rms.toFixed(6)}, stopping TTS, partial=${partialContent.slice(0, 80)}`);
52
- this.stopTTS();
47
+ if (ttsPlaying) {
48
+ debug(`[interrupt-overlap] OVERLAP! RMS=${rms.toFixed(6)}, stopping TTS, partial=${partialContent.slice(0, 80)}`);
49
+ this.stopTTS();
50
+ }
51
+ else {
52
+ debug(`[interrupt-overlap] Voice heard during silence RMS=${rms.toFixed(6)}, marking interrupt`);
53
+ }
53
54
  const event = {
54
55
  partialTTSContent: partialContent,
55
56
  overlapTimestamp: now,
package/dist/tts/index.js CHANGED
@@ -138,6 +138,10 @@ export class TTSStreamer extends EventEmitter {
138
138
  }
139
139
  async processQueue() {
140
140
  this.processing = true;
141
+ if (this.stopped) {
142
+ debug(`[interrupt-tts] processQueue clearing stale stopped flag`);
143
+ this.stopped = false;
144
+ }
141
145
  debug(`[interrupt-tts] processQueue start, queue=${this.queue.length}, stopped=${this.stopped}`);
142
146
  while (this.queue.length > 0 && !this.stopped) {
143
147
  const sentence = this.queue.shift();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-interrupt-plugin",
3
- "version": "0.4.8",
3
+ "version": "0.4.10",
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",