opencode-ghost 0.2.4 → 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 +17 -1
- package/README.md +14 -13
- package/package.json +1 -1
- package/src/completion.ts +8 -5
- package/src/tui.tsx +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,20 @@ 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.
|
|
17
|
+
## [0.2.5] - 2026-09-25
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Slash-command argument hints are dimmed at the same opacity as every other
|
|
22
|
+
ghost; they keep the theme accent hue but no longer appear brighter than the
|
|
23
|
+
next-message and history ghosts.
|
|
10
24
|
## [0.2.4] - 2026-09-25
|
|
11
25
|
|
|
12
26
|
### Fixed
|
|
@@ -98,7 +112,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
98
112
|
- Options for `model`, `acceptKeys`, `maxChars`, `idleDelayMs`,
|
|
99
113
|
`recentMessages` and `system`.
|
|
100
114
|
|
|
101
|
-
[Unreleased]: https://github.com/ozandogrultan/opencode-ghost/compare/v0.2.
|
|
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
|
|
117
|
+
[0.2.5]: https://github.com/ozandogrultan/opencode-ghost/compare/v0.2.4...v0.2.5
|
|
102
118
|
[0.2.4]: https://github.com/ozandogrultan/opencode-ghost/compare/v0.2.3...v0.2.4
|
|
103
119
|
[0.2.3]: https://github.com/ozandogrultan/opencode-ghost/compare/v0.2.2...v0.2.3
|
|
104
120
|
[0.2.2]: https://github.com/ozandogrultan/opencode-ghost/compare/v0.2.1...v0.2.2
|
package/README.md
CHANGED
|
@@ -17,22 +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`)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
- **
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
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.
|
|
36
37
|
- **`/suggest` toggles it.** State is stored in the plugin KV.
|
|
37
38
|
|
|
38
39
|
## Requirements
|
package/package.json
CHANGED
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
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
@@ -21,6 +21,9 @@ const MAX_TRANSCRIPT_CHARS = 6000
|
|
|
21
21
|
// this many rows; longer text is clipped. The host caps its editor at >= 6 rows
|
|
22
22
|
// by default, so 5 stays inside that ceiling.
|
|
23
23
|
const MAX_GHOST_LINES = 5
|
|
24
|
+
// Every ghost is drawn at this opacity so it always reads as a suggestion, not
|
|
25
|
+
// typed text. Slash-command ghosts keep the accent hue but are dimmed too.
|
|
26
|
+
const GHOST_OPACITY = 0.6
|
|
24
27
|
const ENABLED_KEY = "ghost.enabled"
|
|
25
28
|
const MODEL_KEY = "ghost.model"
|
|
26
29
|
|
|
@@ -493,11 +496,9 @@ const tui: TuiPlugin = async (api, rawOptions) => {
|
|
|
493
496
|
let display = ""
|
|
494
497
|
let insert = ""
|
|
495
498
|
let wrap = false
|
|
496
|
-
//
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
const color = isSlash ? api.theme.current.accent : api.theme.current.textMuted
|
|
500
|
-
const opacity = isSlash ? 1 : 0.6
|
|
499
|
+
// Every ghost is grey and dimmed so it cannot be mistaken for typed text.
|
|
500
|
+
const color = api.theme.current.textMuted
|
|
501
|
+
const opacity = GHOST_OPACITY
|
|
501
502
|
if (found) {
|
|
502
503
|
const args = "args" in found ? found.args : undefined
|
|
503
504
|
insert = found.insert ?? ""
|