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.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/package.json +1 -1
  3. package/tui.tsx +15 -12
package/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
  [![npm](https://img.shields.io/npm/v/opencode-groq-dictate?label=npm)](https://www.npmjs.com/package/opencode-groq-dictate)
5
5
  [![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
6
  [![release](https://img.shields.io/github/v/tag/LeonVeganMan/opencode-groq-dictate?label=release)](https://github.com/LeonVeganMan/opencode-groq-dictate/releases)
7
+ [![OpenDock](https://img.shields.io/badge/OpenDock-listed-orange)](https://www.opendock.net/plugins/opencode-groq-dictate/)
7
8
  [![tests](https://img.shields.io/badge/tests-bun%20test-informational.svg)](#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.10",
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
- const red = () => context.theme?.hue?.red?.["400"] ?? "#ff5555"
460
- const amber = () => context.theme?.hue?.orange ?? "#FF9654"
461
- const green = () => context.theme?.hue?.green?.["400"] ?? "#7fbf7f"
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: the host reads .length on what the render
472
- // returns, and a <Show> that resolves to nothing hands it undefined,
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={state()}>{"■"}</text>
517
- <text onMouseUp={(event) => toggle(wantsSubmit(event))}>{"Groq Dictate"}</text>
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
- recording() ? `● rec ${elapsed()}s` : busy() ? "transcribing…" : "idle",
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
  )}