opencode-interrupt-plugin 0.4.30 → 0.4.31
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/index.js +7 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -116,16 +116,16 @@ async function transcribeAndSend(sessionID, directory, api) {
|
|
|
116
116
|
async function transcribeAndSendV1(sessionID, client) {
|
|
117
117
|
pttStopRecording();
|
|
118
118
|
if (!existsSync(RECORDING_FILE)) {
|
|
119
|
-
await client.tui.showToast({ body: { title: "PTT", message: "No audio captured", variant: "warning" } });
|
|
119
|
+
await client.tui.showToast({ body: { title: "PTT", message: "No audio captured — try again", variant: "warning" } });
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
|
-
await client.tui.showToast({ body: { title: "PTT", message: "Transcribing...", variant: "info" } });
|
|
122
|
+
await client.tui.showToast({ body: { title: "PTT", message: "Transcribing with Whisper...", variant: "info" } });
|
|
123
123
|
let text = null;
|
|
124
124
|
text = await transcribeLocal();
|
|
125
125
|
if (!text)
|
|
126
126
|
text = await transcribeAPI();
|
|
127
127
|
if (!text) {
|
|
128
|
-
await client.tui.showToast({ body: { title: "PTT", message: "
|
|
128
|
+
await client.tui.showToast({ body: { title: "PTT", message: "Install whisper: run scripts/install-whisper.sh, or set OPENAI_API_KEY", variant: "error", duration: 8000 } });
|
|
129
129
|
try {
|
|
130
130
|
unlinkSync(RECORDING_FILE);
|
|
131
131
|
}
|
|
@@ -137,11 +137,12 @@ async function transcribeAndSendV1(sessionID, client) {
|
|
|
137
137
|
}
|
|
138
138
|
catch { /* ignore */ }
|
|
139
139
|
if (!sessionID) {
|
|
140
|
-
await client.tui.showToast({ body: { title: "PTT", message: "
|
|
140
|
+
await client.tui.showToast({ body: { title: "PTT", message: "Open a session first, then type /ptt", variant: "warning", duration: 5000 } });
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
143
|
await client.session.prompt({ path: { id: sessionID }, body: { parts: [{ type: "text", text }] } });
|
|
144
|
-
|
|
144
|
+
const preview = text.length > 80 ? text.slice(0, 77) + "..." : text;
|
|
145
|
+
await client.tui.showToast({ body: { title: "PTT", message: `Sent: "${preview}"`, variant: "success", duration: 5000 } });
|
|
145
146
|
}
|
|
146
147
|
const TTS_COMMANDS = [
|
|
147
148
|
{ name: 'tts-on', description: 'Enable streaming TTS', template: 'TTS enabled.' },
|
|
@@ -337,7 +338,7 @@ export const InterruptPlugin = (userConfig = {}) => {
|
|
|
337
338
|
catch { /* ignore */ }
|
|
338
339
|
}
|
|
339
340
|
pttStartRecording();
|
|
340
|
-
await client.tui.showToast({ body: { title: "PTT", message: "Recording...
|
|
341
|
+
await client.tui.showToast({ body: { title: "PTT", message: "Recording... type /ptt to stop", variant: "info" } });
|
|
341
342
|
}
|
|
342
343
|
throw new Error('Command handled by interrupt plugin');
|
|
343
344
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-interrupt-plugin",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.31",
|
|
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",
|