speech-opencode 1.1.4 → 1.1.6
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 +9 -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { tool } from "@opencode-ai/plugin";
|
|
2
2
|
import OpenAI from "openai";
|
|
3
|
-
import { spawn } from "child_process";
|
|
3
|
+
import { spawn, spawnSync } from "child_process";
|
|
4
4
|
import { unlinkSync, readFileSync, existsSync, watch, mkdirSync, writeFileSync } from "fs";
|
|
5
5
|
import { tmpdir, homedir } from "os";
|
|
6
6
|
import { join, dirname } from "path";
|
|
@@ -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
|
+
spawnSync("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 {
|