@scotteza/opencode-spoken-replies 1.0.2 → 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.
package/README.md CHANGED
@@ -36,6 +36,24 @@ Or add it to the `plugins` array in your OpenCode `opencode.json` or `opencode.j
36
36
  }
37
37
  ```
38
38
 
39
+ ## Keyboard shortcuts
40
+
41
+ | Shortcut | Action |
42
+ | --- | --- |
43
+ | `F5` | Open assistant-message history. |
44
+ | `F6` | Pause or resume speech; replay the latest reply when idle. |
45
+ | `F7` | Replay the latest reply from the beginning. |
46
+ | `F8` | Turn automatic speech on or off. |
47
+ | `Ctrl+F6` | Slow speech by 0.25x. |
48
+ | `Ctrl+F7` | Speed speech up by 0.25x. |
49
+ | `Ctrl+F9` | Open the voice shortcuts menu. |
50
+ | `Ctrl+O` | Preview the selected voice in the voice picker. |
51
+ | `Enter` | Select a voice or play the selected history entry. |
52
+ | `Shift+Enter` | In history, play the selected entry and later entries. |
53
+ | `Escape` | Close the active picker. |
54
+
55
+ In the history picker, selecting an entry enables speech if it was off. On some keyboards, function keys require holding `Fn`.
56
+
39
57
  ## Build and use a local checkout
40
58
 
41
59
  To modify the plugin, install Node.js 20.9 or later and Bun 1.3.14 or later, then run these commands from the repository root.
@@ -90,24 +108,6 @@ Load the local build by adding its checkout directory (not `dist/`) to an OpenCo
90
108
 
91
109
  Restart or reload OpenCode, open a session, and look for the voice status in the footer. Speech is enabled by default. Question prompts in the active session are spoken by default; idle announcements and direct subagent replies are optional and off by default.
92
110
 
93
- ## Keyboard shortcuts
94
-
95
- | Shortcut | Action |
96
- | --- | --- |
97
- | `F5` | Open assistant-message history. |
98
- | `F6` | Pause or resume speech; replay the latest reply when idle. |
99
- | `F7` | Replay the latest reply from the beginning. |
100
- | `F8` | Turn automatic speech on or off. |
101
- | `Ctrl+F6` | Slow speech by 0.25x. |
102
- | `Ctrl+F7` | Speed speech up by 0.25x. |
103
- | `Ctrl+F9` | Open the voice shortcuts menu. |
104
- | `Ctrl+O` | Preview the selected voice in the voice picker. |
105
- | `Enter` | Select a voice or play the selected history entry. |
106
- | `Shift+Enter` | In history, play the selected entry and later entries. |
107
- | `Escape` | Close the active picker. |
108
-
109
- In the history picker, selecting an entry enables speech if it was off. On some keyboards, function keys require holding `Fn`.
110
-
111
111
  ## Settings
112
112
 
113
113
  Settings go in the plugin entry's `options` object. The defaults are voice `af_heart`, speed `1x`, automatic device selection, question prompts on, idle announcements off, and subagent replies off. Speed ranges from `0.25x` to `5x`; without an explicit speed or voice setting, changes are remembered between launches.
@@ -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.2",
3
+ "version": "1.0.4",
4
4
  "description": "Local Kokoro text-to-speech for OpenCode assistant replies",
5
5
  "keywords": [
6
6
  "opencode",