opencode-ghost 1.0.3 → 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 +7 -0
- package/package.json +1 -1
- package/src/placeholder.ts +5 -1
- package/src/tui.tsx +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ 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
|
+
|
|
8
14
|
## [1.0.3] - 2026-10-08
|
|
9
15
|
|
|
10
16
|
### Fixed
|
|
@@ -203,6 +209,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
203
209
|
- Options for `model`, `acceptKeys`, `maxChars`, `idleDelayMs`,
|
|
204
210
|
`recentMessages` and `system`.
|
|
205
211
|
|
|
212
|
+
[1.0.4]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.0.3...v1.0.4
|
|
206
213
|
[1.0.3]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.0.2...v1.0.3
|
|
207
214
|
[1.0.2]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.0.1...v1.0.2
|
|
208
215
|
[1.0.1]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.0.0...v1.0.1
|
package/package.json
CHANGED
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) => {
|