opencode-ghost 1.0.2 → 1.0.4
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/package.json +3 -1
- package/src/placeholder.ts +5 -1
- package/src/tui.tsx +4 -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.0.4] - 2026-10-08
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **tui:** Dim inline suggestions against the composer background
|
|
13
|
+
|
|
14
|
+
## [1.0.3] - 2026-10-08
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **packaging:** Declare required OpenTUI runtime peers
|
|
19
|
+
|
|
8
20
|
## [1.0.2] - 2026-10-08
|
|
9
21
|
|
|
10
22
|
### Changed
|
|
@@ -197,6 +209,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
197
209
|
- Options for `model`, `acceptKeys`, `maxChars`, `idleDelayMs`,
|
|
198
210
|
`recentMessages` and `system`.
|
|
199
211
|
|
|
212
|
+
[1.0.4]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.0.3...v1.0.4
|
|
213
|
+
[1.0.3]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.0.2...v1.0.3
|
|
200
214
|
[1.0.2]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.0.1...v1.0.2
|
|
201
215
|
[1.0.1]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.0.0...v1.0.1
|
|
202
216
|
[1.0.0]: https://github.com/ozandogrultan/opencode-ghost/compare/v0.6.0...v1.0.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-ghost",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Stateless inline next-prompt ghosts for the empty OpenCode V2 composer, accepted with Tab or Right.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@opencode/plugin": "*",
|
|
52
|
+
"@opentui/core": ">=0.5.16",
|
|
53
|
+
"@opentui/solid": ">=0.5.16",
|
|
52
54
|
"solid-js": "*"
|
|
53
55
|
},
|
|
54
56
|
"devDependencies": {
|
package/src/placeholder.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { RGBA, type TextareaRenderable } from "@opentui/core"
|
|
2
2
|
|
|
3
3
|
export type PlaceholderEditor = Pick<TextareaRenderable, "placeholder" | "placeholderColor" | "plainText" | "isDestroyed">
|
|
4
4
|
|
|
5
|
+
export function dimPlaceholderColor(muted: RGBA): RGBA {
|
|
6
|
+
return RGBA.fromValues(muted.r, muted.g, muted.b, muted.a * 0.55)
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
export function createInlinePlaceholder() {
|
|
6
10
|
let owned: {
|
|
7
11
|
editor: PlaceholderEditor
|
package/src/tui.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/** @jsxImportSource @opentui/solid */
|
|
2
2
|
import { Plugin } from "@opencode/plugin/tui"
|
|
3
3
|
import { TextareaRenderable, InputRenderable, type BoxRenderable, type Renderable } from "@opentui/core"
|
|
4
|
-
import { createEffect, createRoot, createSignal, on, onCleanup } from "solid-js"
|
|
4
|
+
import { createEffect, createMemo, createRoot, createSignal, on, onCleanup } from "solid-js"
|
|
5
5
|
import { composerAction, findComposerEditor, isEmptyComposer, keyName, observeComposerInput } from "./composer"
|
|
6
6
|
import { createLifecycle } from "./lifecycle"
|
|
7
7
|
import { acceptCommand, acceptShortcuts, ghostKeymapLayers } from "./keymap"
|
|
8
8
|
import { parseSuggestCommand, removedOptionKeys, resolveOptions, suggestionModel } from "./options"
|
|
9
|
-
import { createInlinePlaceholder } from "./placeholder"
|
|
9
|
+
import { createInlinePlaceholder, dimPlaceholderColor } from "./placeholder"
|
|
10
10
|
import { generateSuggestion } from "./stateless"
|
|
11
11
|
import { isEcho, normalize, resolveExplicitModel, resolveSmallModel } from "./text"
|
|
12
12
|
import { buildTranscript, lastUserText, suggestionPrompt, type TranscriptMessage } from "./transcript"
|
|
@@ -41,6 +41,7 @@ export default Plugin.define({
|
|
|
41
41
|
const [suggestion, setSuggestion] = createSignal<Suggestion | undefined>()
|
|
42
42
|
const [composerRevision, setComposerRevision] = createSignal(0)
|
|
43
43
|
const inline = createInlinePlaceholder()
|
|
44
|
+
const ghostColor = createMemo(() => dimPlaceholderColor(context.theme.text.muted))
|
|
44
45
|
|
|
45
46
|
let disposed = false
|
|
46
47
|
const composers = new Map<string, { marker: BoxRenderable; normal: () => boolean }>()
|
|
@@ -118,7 +119,7 @@ export default Plugin.define({
|
|
|
118
119
|
composerRevision()
|
|
119
120
|
const current = suggestion()
|
|
120
121
|
const editor = current ? getComposer(current.sessionID).editor : undefined
|
|
121
|
-
inline.sync(editor, current?.text,
|
|
122
|
+
inline.sync(editor, current?.text, ghostColor(), !!current && canGenerate(current.sessionID) && isComposerEmpty(current.sessionID))
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
const disposeRouteWatcher = createRoot((dispose) => {
|