opencode-ghost 1.3.9 → 1.3.11
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 +14 -0
- package/README.md +21 -12
- package/package.json +14 -12
- package/src/placeholder.ts +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ All notable changes to this project are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.3.11] - 2026-10-20
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **deps:** Require opentui 0.6 for opencode 2.1
|
|
13
|
+
|
|
14
|
+
## [1.3.10] - 2026-10-11
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **deps:** Install opentui as dependencies instead of peers
|
|
19
|
+
|
|
8
20
|
## [1.3.9] - 2026-10-11
|
|
9
21
|
|
|
10
22
|
### Fixed
|
|
@@ -301,6 +313,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
301
313
|
- Options for `model`, `acceptKeys`, `maxChars`, `idleDelayMs`,
|
|
302
314
|
`recentMessages` and `system`.
|
|
303
315
|
|
|
316
|
+
[1.3.11]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.3.10...v1.3.11
|
|
317
|
+
[1.3.10]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.3.9...v1.3.10
|
|
304
318
|
[1.3.9]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.3.8...v1.3.9
|
|
305
319
|
[1.3.8]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.3.7...v1.3.8
|
|
306
320
|
[1.3.7]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.3.6...v1.3.7
|
package/README.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<img src="assets/logo.svg" alt="ghost — next-prompt suggestions for OpenCode" height="96">
|
|
3
|
+
</h1>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://github.com/ozandogrultan/opencode-ghost/actions/workflows/ci.yml"><img src="https://github.com/ozandogrultan/opencode-ghost/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
7
|
+
<a href="https://www.npmjs.com/package/opencode-ghost"><img src="https://img.shields.io/npm/v/opencode-ghost" alt="npm"></a>
|
|
8
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"></a>
|
|
9
|
+
<a href="#contributing"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome"></a>
|
|
10
|
+
<a href="https://github.com/ozandogrultan/opencode-ghost/stargazers"><img src="https://img.shields.io/github/stars/ozandogrultan/opencode-ghost.svg?style=social" alt="GitHub stars"></a>
|
|
11
|
+
</p>
|
|
4
12
|
|
|
5
13
|
An **OpenCode V2 TUI plugin** providing next-prompt suggestions, in the
|
|
6
14
|
style of Claude Code: after each turn a small model reads the recent
|
|
@@ -24,11 +32,12 @@ a dimmed inline placeholder in the empty composer with
|
|
|
24
32
|
- **Hides as you type.** Typing and pasting abort pending generation and hide the
|
|
25
33
|
preview. Emptying the composer restores the same suggestion without another
|
|
26
34
|
API call; focus changes also reuse it. Navigation keys leave it intact.
|
|
27
|
-
- **`/suggest`
|
|
35
|
+
- **`/suggest` controls it.** Toggle suggestions, set a runtime model override,
|
|
36
|
+
or inspect live state and diagnostics; settings persist via the plugin's storage.
|
|
28
37
|
|
|
29
38
|
## Requirements
|
|
30
39
|
|
|
31
|
-
- [opencode](https://opencode.ai) v2 (TUI plugins
|
|
40
|
+
- [opencode](https://opencode.ai) v2 (TUI plugins).
|
|
32
41
|
- A provider/model and authentication method that support OpenCode's stateless
|
|
33
42
|
`generate.text` endpoint. Set `model` explicitly if no default small model is available.
|
|
34
43
|
|
|
@@ -46,7 +55,7 @@ Add the package to your `cli.json` (normally `~/.config/opencode/cli.json`):
|
|
|
46
55
|
```
|
|
47
56
|
|
|
48
57
|
Then **restart opencode**; it installs the package on startup. Pin a version
|
|
49
|
-
with `"opencode-ghost
|
|
58
|
+
with `"opencode-ghost@<version>"`, or change the version and restart to update.
|
|
50
59
|
Pass options with the object form shown under [Manually](#manually), using
|
|
51
60
|
`"package": "opencode-ghost"`.
|
|
52
61
|
|
|
@@ -132,12 +141,12 @@ still enforces `maxChars` when normalizing the displayed suggestion.
|
|
|
132
141
|
- `/suggest model openai/gpt-6-luna-fast` — set a persisted runtime model override.
|
|
133
142
|
- `/suggest model clear` — clear the override and use the configured `model`,
|
|
134
143
|
or the OpenCode small default, never the main model.
|
|
135
|
-
- `/suggest debug` — toggle debug mode (persisted). While on, each
|
|
136
|
-
|
|
137
|
-
the error.
|
|
144
|
+
- `/suggest debug` — toggle debug mode (persisted). While on, each non-aborted
|
|
145
|
+
generation outcome and each display change shows a toast.
|
|
138
146
|
- `/suggest debug on` / `/suggest debug off` — set debug mode explicitly.
|
|
139
|
-
- `/suggest log` — show the last 20
|
|
140
|
-
total and stage latency, length and error
|
|
147
|
+
- `/suggest log` — show live state, the last 20 display changes, and the last 20
|
|
148
|
+
generation attempts (outcome, model, total and stage latency, length and error
|
|
149
|
+
detail) in a dialog, regardless of debug mode.
|
|
141
150
|
|
|
142
151
|
Model precedence is the persisted `/suggest model` override, then the `model`
|
|
143
152
|
option, then the effective title agent's model from OpenCode's public agent API.
|
|
@@ -145,7 +154,7 @@ OpenCode resolves inherited `agents.title.model`, migrated legacy `small_model`,
|
|
|
145
154
|
and directory definitions such as `agents/title.md` and `agent/title.md`, including
|
|
146
155
|
agent deletion/recreation. Explicitly configured variants are preserved.
|
|
147
156
|
Without a configured title model, or when the title agent is disabled, Ghost
|
|
148
|
-
mirrors OpenCode
|
|
157
|
+
mirrors OpenCode's internal small-model policy until a public API exists:
|
|
149
158
|
within the session model's provider (or the session agent model's provider,
|
|
150
159
|
then the location's default provider, then the first enabled text model's
|
|
151
160
|
provider when no default exists), choose
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-ghost",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.3.11",
|
|
4
|
+
"description": "OpenCode ghost text autosuggest: suggests your next message as dimmed inline ghost text in the empty TUI composer, accepted with Tab or Right arrow.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Ozan Dogrultan",
|
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
"ghost-text",
|
|
21
21
|
"autosuggest",
|
|
22
22
|
"prompt",
|
|
23
|
-
"suggestion"
|
|
23
|
+
"suggestion",
|
|
24
|
+
"next-prompt",
|
|
25
|
+
"opencode-tui"
|
|
24
26
|
],
|
|
25
27
|
"exports": {
|
|
26
28
|
"./tui": "./src/tui.tsx"
|
|
@@ -36,7 +38,7 @@
|
|
|
36
38
|
},
|
|
37
39
|
"packageManager": "bun@1.4.2",
|
|
38
40
|
"engines": {
|
|
39
|
-
"opencode": ">=2.0
|
|
41
|
+
"opencode": ">=2.1.0"
|
|
40
42
|
},
|
|
41
43
|
"scripts": {
|
|
42
44
|
"prepare": "husky",
|
|
@@ -47,22 +49,22 @@
|
|
|
47
49
|
"lint:sh": "for script in install.sh tests/*.sh scripts/*.sh; do bash -n \"$script\" || exit; done",
|
|
48
50
|
"prepublishOnly": "bun run test && bun run typecheck"
|
|
49
51
|
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@opentui/core": "^0.6.6",
|
|
54
|
+
"@opentui/solid": "^0.6.6"
|
|
55
|
+
},
|
|
50
56
|
"peerDependencies": {
|
|
51
57
|
"@opencode/plugin": "*",
|
|
52
|
-
"@opentui/core": ">=0.5.16 <0.6.0",
|
|
53
|
-
"@opentui/solid": ">=0.5.16 <0.6.0",
|
|
54
58
|
"solid-js": "*"
|
|
55
59
|
},
|
|
56
60
|
"devDependencies": {
|
|
57
61
|
"@commitlint/cli": "^21.2.2",
|
|
58
62
|
"@commitlint/config-conventional": "^21.2.2",
|
|
59
|
-
"@opencode/plugin": "2.0.
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
-
"@types/bun": "^1.4.2",
|
|
63
|
-
"@types/node": "24.12.2",
|
|
63
|
+
"@opencode/plugin": "2.0.29",
|
|
64
|
+
"@types/bun": "^1.4.3",
|
|
65
|
+
"@types/node": "26.6.5",
|
|
64
66
|
"husky": "^9.1.7",
|
|
65
|
-
"solid-js": "
|
|
67
|
+
"solid-js": "1.9.12",
|
|
66
68
|
"typescript": "7.0.2"
|
|
67
69
|
}
|
|
68
70
|
}
|
package/src/placeholder.ts
CHANGED
|
@@ -6,6 +6,8 @@ export function dimPlaceholderColor(muted: RGBA): RGBA {
|
|
|
6
6
|
return RGBA.fromValues(muted.r, muted.g, muted.b, muted.a * 0.55)
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
const sameColor = (a: RGBA, b: RGBA) => a.equals(b)
|
|
10
|
+
|
|
9
11
|
export function createInlinePlaceholder() {
|
|
10
12
|
let owned: {
|
|
11
13
|
editor: PlaceholderEditor
|
|
@@ -21,7 +23,7 @@ export function createInlinePlaceholder() {
|
|
|
21
23
|
owned = undefined
|
|
22
24
|
if (editor.isDestroyed) return
|
|
23
25
|
if (editor.placeholder === text) editor.placeholder = original
|
|
24
|
-
if (editor.placeholderColor
|
|
26
|
+
if (sameColor(editor.placeholderColor, color)) editor.placeholderColor = originalColor
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
return {
|
|
@@ -39,10 +41,10 @@ export function createInlinePlaceholder() {
|
|
|
39
41
|
owned = { editor, original: editor.placeholder, originalColor: editor.placeholderColor, text, color }
|
|
40
42
|
} else {
|
|
41
43
|
if (editor.placeholder !== owned.text) owned.original = editor.placeholder
|
|
42
|
-
if (editor.placeholderColor
|
|
44
|
+
if (!sameColor(editor.placeholderColor, owned.color)) owned.originalColor = editor.placeholderColor
|
|
43
45
|
owned.text = text
|
|
44
46
|
}
|
|
45
|
-
if (editor.placeholderColor
|
|
47
|
+
if (!sameColor(editor.placeholderColor, color)) editor.placeholderColor = color
|
|
46
48
|
owned.color = editor.placeholderColor
|
|
47
49
|
if (editor.placeholder !== text) editor.placeholder = text
|
|
48
50
|
},
|