@scotteza/opencode-spoken-replies 1.0.3 → 1.0.4

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.
@@ -84,7 +84,18 @@ async function prepareOnnxRuntime() {
84
84
  ort.env.logLevel = "error";
85
85
  }
86
86
  async function loadKokoroModule() {
87
- return import("kokoro-js");
87
+ const runtimeSymbol = Symbol.for("onnxruntime");
88
+ const runtimeHost = globalThis;
89
+ const hadRuntimeOverride = runtimeSymbol in runtimeHost;
90
+ const runtimeOverride = runtimeHost[runtimeSymbol];
91
+ if (hadRuntimeOverride)
92
+ delete runtimeHost[runtimeSymbol];
93
+ try {
94
+ return await import("kokoro-js");
95
+ } finally {
96
+ if (hadRuntimeOverride)
97
+ runtimeHost[runtimeSymbol] = runtimeOverride;
98
+ }
88
99
  }
89
100
 
90
101
  class KokoroRuntime {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scotteza/opencode-spoken-replies",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Local Kokoro text-to-speech for OpenCode assistant replies",
5
5
  "keywords": [
6
6
  "opencode",