opencode-groq-dictate 1.1.10 → 1.1.12
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 +1 -0
- package/package.json +1 -1
- package/tui.tsx +15 -12
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/opencode-groq-dictate)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
[](https://github.com/LeonVeganMan/opencode-groq-dictate/releases)
|
|
7
|
+
[](https://www.opendock.net/plugins/opencode-groq-dictate/)
|
|
7
8
|
[](#development)
|
|
8
9
|
|
|
9
10
|
Dictation inside the **opencode v2** TUI: press `alt+v`, speak, press `alt+v` again.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-groq-dictate",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.12",
|
|
4
4
|
"description": "Groq dictation in the OpenCode v2 TUI: alt+v records, transcribes with whisper-large-v3-turbo, and pastes the text into the prompt.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
package/tui.tsx
CHANGED
|
@@ -456,21 +456,23 @@ export default Plugin.define({
|
|
|
456
456
|
],
|
|
457
457
|
}))
|
|
458
458
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
const
|
|
459
|
+
// Theme colours are shade maps ({100..600}): passing the map itself as `fg`
|
|
460
|
+
// crashes the slot renderer (e.length), so every helper resolves one shade.
|
|
461
|
+
const shade = (value: unknown, key = "400"): string | undefined =>
|
|
462
|
+
typeof value === "string" ? value : (value as Record<string, string> | undefined)?.[key]
|
|
463
|
+
const red = () => shade(context.theme?.hue?.red) ?? "#ff5555"
|
|
464
|
+
const amber = () => shade(context.theme?.hue?.orange) ?? "#FF9654"
|
|
465
|
+
const green = () => shade(context.theme?.hue?.green) ?? "#7fbf7f"
|
|
462
466
|
const muted = () => context.theme?.text?.muted ?? context.theme?.text?.subdued ?? "#808080"
|
|
463
467
|
// The brand accent, the same one the go-meter panel uses for its figures.
|
|
464
|
-
const accent = () =>
|
|
465
|
-
context.theme?.hue?.accent?.["500"] ?? context.theme?.hue?.interactive?.["300"] ?? "#FF9654"
|
|
468
|
+
const accent = () => shade(context.theme?.hue?.accent, "500") ?? shade(context.theme?.hue?.interactive, "300") ?? "#FF9654"
|
|
466
469
|
|
|
467
470
|
// The footer row already carries the model and the other status items, so the
|
|
468
471
|
// dot sits next to them and disappears when there is nothing to report.
|
|
469
472
|
context.ui.slot({
|
|
470
473
|
append: "prompt.footer.status",
|
|
471
|
-
// Always return an element
|
|
472
|
-
//
|
|
473
|
-
// which crashes the slot ("evaluating 'e.length'") on v2.1.0.
|
|
474
|
+
// Always return an element, never a <Show> that resolves to nothing: the
|
|
475
|
+
// host reads .length on the render result, so undefined crashes the slot.
|
|
474
476
|
render: () => (
|
|
475
477
|
<text fg={recording() ? red() : amber()}>
|
|
476
478
|
{recording() ? `● REC ${elapsed()}s` : busy() ? "● …" : ""}
|
|
@@ -513,13 +515,14 @@ export default Plugin.define({
|
|
|
513
515
|
<box flexDirection="column">
|
|
514
516
|
<box flexDirection="row" gap={1}>
|
|
515
517
|
{/* Plain glyphs: the emoji did not render in every terminal font. */}
|
|
516
|
-
<text fg={
|
|
517
|
-
<text onMouseUp={(
|
|
518
|
-
<text fg={muted()} onMouseUp={() => openSettings()}>{"settings"}</text>
|
|
518
|
+
<text fg={muted()}>{"Groq Dictate"}</text>
|
|
519
|
+
<text fg={accent()} onMouseUp={() => openSettings()}>{"settings"}</text>
|
|
519
520
|
</box>
|
|
520
521
|
{row(
|
|
521
522
|
"state",
|
|
522
|
-
|
|
523
|
+
// The square is the record button: it sits next to the state word,
|
|
524
|
+
// click starts, ctrl+click starts and sends.
|
|
525
|
+
recording() ? `■ rec ${elapsed()}s` : busy() ? "■ transcribing…" : "■ idle",
|
|
523
526
|
state,
|
|
524
527
|
(event) => toggle(wantsSubmit(event)),
|
|
525
528
|
)}
|