opencode-ghost 1.3.2 → 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 +7 -0
- package/package.json +1 -1
- package/src/text.ts +6 -0
- package/src/transcript.ts +2 -2
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.3.3] - 2026-10-09
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **tui:** Keep the end of long assistant messages in the transcript
|
|
13
|
+
|
|
8
14
|
## [1.3.2] - 2026-10-09
|
|
9
15
|
|
|
10
16
|
### Fixed
|
|
@@ -258,6 +264,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
258
264
|
- Options for `model`, `acceptKeys`, `maxChars`, `idleDelayMs`,
|
|
259
265
|
`recentMessages` and `system`.
|
|
260
266
|
|
|
267
|
+
[1.3.3]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.3.2...v1.3.3
|
|
261
268
|
[1.3.2]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.3.1...v1.3.2
|
|
262
269
|
[1.3.1]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.3.0...v1.3.1
|
|
263
270
|
[1.3.0]: https://github.com/ozandogrultan/opencode-ghost/compare/v1.2.0...v1.3.0
|
package/package.json
CHANGED
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.`
|