opencode-ghost 0.2.5 → 0.2.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/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.6] - 2026-09-25
11
+
12
+ ### Fixed
13
+
14
+ - Partially typed slash-command arguments now ghost only the remaining letters
15
+ inline, rather than showing a bracketed option after the typed prefix.
16
+ - All ghosts, including slash-command argument hints, use dimmed grey text.
10
17
  ## [0.2.5] - 2026-09-25
11
18
 
12
19
  ### Changed
@@ -105,7 +112,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
105
112
  - Options for `model`, `acceptKeys`, `maxChars`, `idleDelayMs`,
106
113
  `recentMessages` and `system`.
107
114
 
108
- [Unreleased]: https://github.com/ozandogrultan/opencode-ghost/compare/v0.2.5...HEAD
115
+ [Unreleased]: https://github.com/ozandogrultan/opencode-ghost/compare/v0.2.6...HEAD
116
+ [0.2.6]: https://github.com/ozandogrultan/opencode-ghost/compare/v0.2.5...v0.2.6
109
117
  [0.2.5]: https://github.com/ozandogrultan/opencode-ghost/compare/v0.2.4...v0.2.5
110
118
  [0.2.4]: https://github.com/ozandogrultan/opencode-ghost/compare/v0.2.3...v0.2.4
111
119
  [0.2.3]: https://github.com/ozandogrultan/opencode-ghost/compare/v0.2.2...v0.2.3
package/README.md CHANGED
@@ -17,21 +17,23 @@ dimmed ghost text you accept with <kbd>Tab</kbd> (or <kbd>→</kbd>).
17
17
  default) for one line that sounds like you.
18
18
  - **Ghost text, `Tab` to accept.** The suggestion renders under the prompt;
19
19
  `Tab` or `→` drops it into the input so you can edit and send.
20
- - **Slash-command argument ghosts while typing.** After `/name `, accepted
21
- argument options (from `argHints`) render inside the prompt input box, right
22
- after the caret, as `[a | b | c]` like Claude Code. Running out of options or
23
- naming a command with no configured hints shows no ghost — command and skill
24
- descriptions are never suggested as if they were arguments. Tab completes the
25
- next argument. While the command name is still being typed, opencode's own
26
- slash menu stays in charge. Purely local — no model calls.
20
+ - **Slash-command argument ghosts while typing.** After `/name `, the accepted
21
+ argument options (from `argHints`) are listed as `[a | b | c]` inside the
22
+ prompt input box, right after the caret. Once you start typing an argument,
23
+ the list gives way to a dimmed inline completion of the matching option (e.g.
24
+ `/keepwarm alw` ghosts `ays`). Running out of options or naming a command
25
+ with no configured hints shows no ghost — command and skill descriptions are
26
+ never suggested as if they were arguments. Tab completes the next argument.
27
+ While the command name is still being typed, opencode's own slash menu stays
28
+ in charge. Purely local — no model calls.
27
29
  - **History ghost while typing.** If the line you are typing is a prefix of a
28
30
  message you already sent in the same session, the rest of it is ghosted in
29
31
  the box as well; Tab pulls the full line back. Also purely local.
30
- - **Distinct ghost styling.** Slash-command ghosts use the theme accent color;
31
- every ghost is dimmed so it cannot be mistaken for typed text. A
32
- next-message suggestion that is wider than the prompt wraps onto extra rows
33
- and grows the prompt box (up to five rows) so it stays fully readable; other
34
- ghosts are clipped to the box and never spill past it.
32
+ - **Grey, dimmed ghost styling.** Every ghost is grey and dimmed so it cannot
33
+ be mistaken for typed text. A next-message suggestion that is wider than the
34
+ prompt wraps onto extra rows and grows the prompt box (up to five rows) so it
35
+ stays fully readable; other ghosts are clipped to the box and never spill
36
+ past it.
35
37
  - **`/suggest` toggles it.** State is stored in the plugin KV.
36
38
 
37
39
  ## Requirements
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-ghost",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Claude Code-style next-prompt suggestions in the opencode TUI, shown as dimmed ghost text and accepted with Tab. An opencode plugin.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/completion.ts CHANGED
@@ -66,10 +66,13 @@ export function completeCommand(
66
66
  if (!hintList) return undefined
67
67
  const matches = matchOptions(parsed.args, hintList)
68
68
  if (!matches) return undefined
69
- const completed = parsed.args + matches[0].slice(parsed.args.length)
70
- return {
71
- args: matches,
72
- ghost: matches[0].slice(parsed.args.length),
73
- insert: `/${parsed.name} ${completed} `,
69
+ const ghost = matches[0].slice(parsed.args.length)
70
+ const result: Completion = {
71
+ ghost,
72
+ insert: `/${parsed.name} ${parsed.args + ghost} `,
74
73
  }
74
+ // Enumerate the accepted options only while the argument is still empty;
75
+ // once part of the word is typed, ghost the rest of the matching option.
76
+ if (parsed.args === "") result.args = matches
77
+ return result
75
78
  }
package/src/tui.tsx CHANGED
@@ -496,9 +496,8 @@ const tui: TuiPlugin = async (api, rawOptions) => {
496
496
  let display = ""
497
497
  let insert = ""
498
498
  let wrap = false
499
- // Slash-command completions are tinted like commands; every ghost is dimmed
500
- // so it cannot be mistaken for typed text.
501
- const color = isSlash ? api.theme.current.accent : api.theme.current.textMuted
499
+ // Every ghost is grey and dimmed so it cannot be mistaken for typed text.
500
+ const color = api.theme.current.textMuted
502
501
  const opacity = GHOST_OPACITY
503
502
  if (found) {
504
503
  const args = "args" in found ? found.args : undefined