speech-opencode 1.1.3 → 1.1.5
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.d.ts.map +1 -1
- package/dist/index.js +23 -1
- package/package.json +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,qBAAqB,CAAA;AA8GvD,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+DAA+D;IAC/D,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,0FAA0F;IAC1F,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gFAAgF;IAChF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kFAAkF;IAClF,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,qBAAqB,CAAA;AA8GvD,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+DAA+D;IAC/D,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,0FAA0F;IAC1F,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gFAAgF;IAChF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kFAAkF;IAClF,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAmVD,eAAO,MAAM,WAAW,GACrB,UAAS,kBAAuB,KAAG,MAwEnC,CAAA;;AAGH,wBAA4B"}
|
package/dist/index.js
CHANGED
|
@@ -274,6 +274,14 @@ if __name__ == "__main__":
|
|
|
274
274
|
* Starts the wake word listener as a background Python process
|
|
275
275
|
*/
|
|
276
276
|
function startWakeWordListener(wakeWord = "hey_jarvis", threshold = 0.5) {
|
|
277
|
+
// First, kill any existing instances to prevent duplicates/zombies
|
|
278
|
+
// This is crucial because multiple listeners will fight for the mic
|
|
279
|
+
try {
|
|
280
|
+
spawn("pkill", ["-f", "opencode-wakeword-listener.py"]);
|
|
281
|
+
}
|
|
282
|
+
catch {
|
|
283
|
+
// Ignore
|
|
284
|
+
}
|
|
277
285
|
// Write the script to a temp file
|
|
278
286
|
const scriptPath = join(tmpdir(), "opencode-wakeword-listener.py");
|
|
279
287
|
try {
|
|
@@ -295,8 +303,10 @@ function startWakeWordListener(wakeWord = "hey_jarvis", threshold = 0.5) {
|
|
|
295
303
|
});
|
|
296
304
|
proc.stderr?.on("data", (data) => {
|
|
297
305
|
const msg = data.toString().trim();
|
|
298
|
-
|
|
306
|
+
// Filter out ONNX Runtime warnings about missing providers
|
|
307
|
+
if (msg && !msg.includes("UserWarning") && !msg.includes("onnxruntime") && !msg.includes("CUDAExecutionProvider") && !msg.includes("ALSA lib")) {
|
|
299
308
|
console.error(msg);
|
|
309
|
+
}
|
|
300
310
|
});
|
|
301
311
|
proc.on("error", (err) => {
|
|
302
312
|
console.error("[Voice Plugin] Wake word listener failed to start:", err.message);
|
|
@@ -341,6 +351,18 @@ function setupWakeWordWatcher(apiKey, maxDuration, silenceDuration, language, cl
|
|
|
341
351
|
return;
|
|
342
352
|
isRecording = true;
|
|
343
353
|
console.log("[Voice Plugin] Wake word triggered! Recording...");
|
|
354
|
+
// Show toast notification
|
|
355
|
+
try {
|
|
356
|
+
await client.tui.showToast({
|
|
357
|
+
body: {
|
|
358
|
+
message: "Wake word detected! Listening...",
|
|
359
|
+
variant: "info"
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
catch (err) {
|
|
364
|
+
console.error("[Voice Plugin] Failed to show toast:", err);
|
|
365
|
+
}
|
|
344
366
|
try {
|
|
345
367
|
// Clear the trigger file immediately
|
|
346
368
|
clearTriggerFile();
|