opencode-interrupt-plugin 0.4.7 → 0.4.9
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/dist/tts/index.js +13 -1
- package/package.json +1 -1
package/dist/tts/index.js
CHANGED
|
@@ -129,6 +129,8 @@ export class TTSStreamer extends EventEmitter {
|
|
|
129
129
|
return this.engine.isPlaying || this.queue.length > 0 || this.processing || (Date.now() - this.lastActivity < 3000);
|
|
130
130
|
}
|
|
131
131
|
resetSession() {
|
|
132
|
+
this.stopped = false;
|
|
133
|
+
this.processing = false;
|
|
132
134
|
this.buffer.clear();
|
|
133
135
|
this.queue = [];
|
|
134
136
|
this.spokenText = "";
|
|
@@ -136,9 +138,19 @@ export class TTSStreamer extends EventEmitter {
|
|
|
136
138
|
}
|
|
137
139
|
async processQueue() {
|
|
138
140
|
this.processing = true;
|
|
141
|
+
if (this.stopped) {
|
|
142
|
+
debug(`[interrupt-tts] processQueue clearing stale stopped flag`);
|
|
143
|
+
this.stopped = false;
|
|
144
|
+
}
|
|
145
|
+
debug(`[interrupt-tts] processQueue start, queue=${this.queue.length}, stopped=${this.stopped}`);
|
|
139
146
|
while (this.queue.length > 0 && !this.stopped) {
|
|
140
147
|
const sentence = this.queue.shift();
|
|
141
|
-
|
|
148
|
+
try {
|
|
149
|
+
await this.engine.speak(sentence);
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
debug(`[interrupt-tts] TTS error in processQueue: ${err}`);
|
|
153
|
+
}
|
|
142
154
|
if (!this.stopped) {
|
|
143
155
|
this.spokenText += sentence + " ";
|
|
144
156
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-interrupt-plugin",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
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",
|