opencode-ghost 1.3.1 → 1.3.3

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
@@ -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.3] - 2026-10-09
9
+
10
+ ### Fixed
11
+
12
+ - **tui:** Keep the end of long assistant messages in the transcript
13
+
14
+ ## [1.3.2] - 2026-10-09
15
+
16
+ ### Fixed
17
+
18
+ - **tui:** Drop the composer sibling check
19
+
8
20
  ## [1.3.1] - 2026-10-09
9
21
 
10
22
  ### Fixed
@@ -252,6 +264,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
252
264
  - Options for `model`, `acceptKeys`, `maxChars`, `idleDelayMs`,
253
265
  `recentMessages` and `system`.
254
266
 
267
+ [1.3.3]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.3.2...v1.3.3
268
+ [1.3.2]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.3.1...v1.3.2
255
269
  [1.3.1]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.3.0...v1.3.1
256
270
  [1.3.0]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.2.0...v1.3.0
257
271
  [1.2.0]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.1.0...v1.2.0
package/README.md CHANGED
@@ -161,8 +161,7 @@ are logged but not toasted). The history is not written to disk.
161
161
  When a generation is `ok` but nothing is visible, `/suggest log` also shows the
162
162
  live display state and a bounded history of display changes. Each `shown` or
163
163
  `hidden` entry names the reason the placeholder is not applied: no
164
- `prompt.footer` marker, an unidentified or ambiguous editor, extra sibling nodes in
165
- the composer, a non-normal prompt or keymap mode, a draft, selection, extmarks,
164
+ `prompt.footer` marker, an unidentified or ambiguous editor, a non-normal prompt or keymap mode, a draft, selection, extmarks,
166
165
  a busy or hidden session, or the host overriding the placeholder. The live
167
166
  section also reports focus, keymap mode and the placeholder colour. With
168
167
  `/suggest debug` on, each change is toasted.
@@ -174,13 +173,12 @@ section also reports focus, keymap mode and the placeholder colour. With
174
173
  composer, not a completion after typed text.
175
174
  - **Focus safety.** Modal/form and shell editors are never acceptance targets.
176
175
  Non-base keymap modes, autocomplete capture, renderer/editor selections and
177
- composer extmarks suppress the ghost. The textarea must be the first of exactly
178
- two children in its body (editor and metadata); additional UI, including image
179
- previews and failed-preview boxes, suppresses display and acceptance.
176
+ composer extmarks suppress the ghost. The layout around the textarea is not
177
+ inspected, so it works across host layouts.
180
178
  - **Attachment visibility.** V2 does not expose draft attachments to plugins.
181
- Mentionless files without a rendered preview (non-image files or images with
182
- previews disabled) cannot be detected, so a ghost may appear in those drafts.
183
- Disable suggestions with `/suggest` when using such attachments.
179
+ Attachments without an extmark (image previews, non-image files) cannot be
180
+ detected, so a ghost may appear in those drafts. Disable suggestions with
181
+ `/suggest` when using such attachments.
184
182
  - **Renderer integration.** Composer discovery depends on the host renderer
185
183
  hierarchy and its composer identity guard. Placeholder synchronization uses
186
184
  OpenTUI's public pre-render callback; host renderer changes need re-verification.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-ghost",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
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",
package/src/composer.ts CHANGED
@@ -39,10 +39,6 @@ export function isEmptyComposer(editor: TextareaRenderable | undefined, focused:
39
39
  export function composerBlocker(editor: TextareaRenderable | undefined, mode: string, normal: boolean, selected: boolean): string | undefined {
40
40
  if (!editor) return "no composer editor"
41
41
  if (!editor.parent || editor.parent.isDestroyed) return "editor detached"
42
- const siblings = editor.parent.getChildren().filter((node) =>
43
- !node.id.startsWith("slot-layout-"),
44
- )
45
- if (siblings.length !== 2 || siblings[0] !== editor) return `composer has ${siblings.length} sibling nodes (${siblings.map((node) => node.id || "?").join(", ")})`
46
42
  if (!normal) return "prompt not in normal mode"
47
43
  if (mode !== "base") return `keymap mode is ${mode}`
48
44
  if (selected) return "renderer has a selection"
package/src/text.ts CHANGED
@@ -92,6 +92,12 @@ export function clip(text: string, max: number): string {
92
92
  return value.slice(0, max - 1).trimEnd() + "…"
93
93
  }
94
94
 
95
+ export function clipTail(text: string, max: number): string {
96
+ const value = collapse(text)
97
+ if (value.length <= max) return value
98
+ return "…" + value.slice(value.length - (max - 1)).trimStart()
99
+ }
100
+
95
101
  export function normalize(raw: string, maxChars: number): string | undefined {
96
102
  const first = raw
97
103
  .split(/\r?\n/)
package/src/transcript.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { clip } from "./text"
1
+ import { clip, clipTail } from "./text"
2
2
 
3
3
  const MAX_MESSAGE_CHARS = 800
4
4
  const MAX_TRANSCRIPT_CHARS = 6000
@@ -25,7 +25,7 @@ export function buildTranscript(messages: readonly TranscriptMessage[], recentMe
25
25
  const entries = messages.map(messageText).filter((entry) => entry && entry.text.trim())
26
26
  for (const entry of entries.slice(-recentMessages)) {
27
27
  if (!entry) continue
28
- lines.push(`${entry.role}: ${clip(entry.text, MAX_MESSAGE_CHARS)}`)
28
+ lines.push(`${entry.role}: ${(entry.role === "Assistant" ? clipTail : clip)(entry.text, MAX_MESSAGE_CHARS)}`)
29
29
  }
30
30
  if (lines.length === 0) return ""
31
31
  return `${lines.join("\n").slice(-MAX_TRANSCRIPT_CHARS)}\n\nTask: write the user's next message.`