@alexwkleung/reika 0.4.0 → 0.6.0
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/README.md +3 -3
- package/README.zh-CN.md +20 -20
- package/dist/agent/loop.js +35 -3
- package/dist/agent/shellruns.js +81 -0
- package/dist/approval.js +6 -0
- package/dist/cli.js +3 -0
- package/dist/config.js +2 -1
- package/dist/debug.js +135 -16
- package/dist/headlessargs.js +1 -1
- package/dist/provider/transport.js +13 -1
- package/dist/search/_chrome.js +92 -19
- package/dist/search/cdp.js +6 -1
- package/dist/store/sessions.js +5 -4
- package/dist/tools/_danger.js +383 -38
- package/dist/tools/_heredoc.js +22 -8
- package/dist/tools/_readonly.js +132 -4
- package/dist/tools/_writetargets.js +3 -6
- package/dist/tools/bash.js +2 -1
- package/dist/ui/App.js +109 -18
- package/dist/ui/Approval.js +15 -5
- package/dist/ui/Scrollback.js +9 -3
- package/dist/ui/framedrops.js +34 -0
- package/dist/ui/harnessecho.js +24 -0
- package/dist/ui/reasoningfold.js +8 -1
- package/dist/ui/syncframe.js +7 -2
- package/package.json +1 -1
package/dist/ui/reasoningfold.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { stripHarnessEcho } from './harnessecho.js';
|
|
1
2
|
// The endpoint's reasoning parser ends the thinking channel at the first literal think tag it sees
|
|
2
3
|
// in the stream — including one the model wrote *inside* its own reasoning, e.g. while quoting
|
|
3
4
|
// `--reasoning-format`, or describing this very bug. The parser consumes the tag, ends
|
|
@@ -51,6 +52,12 @@ export function foldedAssistantFields(msg) {
|
|
|
51
52
|
const folded = foldSpilledReasoning(msg.reasoning, msg.content);
|
|
52
53
|
return {
|
|
53
54
|
...(folded.reasoning ? { reasoning: folded.reasoning } : {}),
|
|
54
|
-
content: folded.content,
|
|
55
|
+
content: stripHarnessEcho(folded.content),
|
|
55
56
|
};
|
|
56
57
|
}
|
|
58
|
+
// The live region's half of the same display pass, so a streamed reply that opens on a copied
|
|
59
|
+
// harness marker never shows it and then drops it on commit.
|
|
60
|
+
export function foldedLiveFields(reasoning, content) {
|
|
61
|
+
const folded = foldSpilledReasoning(reasoning, content);
|
|
62
|
+
return { reasoning: folded.reasoning, content: stripHarnessEcho(folded.content) };
|
|
63
|
+
}
|
package/dist/ui/syncframe.js
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
//
|
|
19
19
|
// Writes are only queued for a real TTY; a pipe (tests, CI) gets the stream back untouched.
|
|
20
20
|
// `REIKA_SYNC_OUTPUT=0` is the kill switch for a terminal that misbehaves on mode 2026.
|
|
21
|
+
import { recordFrame } from './framedrops.js';
|
|
21
22
|
// Ink gives every code point its own grid cell, so `⏺︎` (U+23FA + VS15) spends two cells on a
|
|
22
23
|
// glyph the terminal draws in one, and a bordered row comes up a column short (#450). Components
|
|
23
24
|
// write a bare `⏺` — one cell, no phantom — and the selector goes back on here, after Ink has laid
|
|
@@ -28,7 +29,7 @@ export function restoreTextPresentation(text) {
|
|
|
28
29
|
}
|
|
29
30
|
export const BEGIN_SYNC = '\x1b[?2026h';
|
|
30
31
|
export const END_SYNC = '\x1b[?2026l';
|
|
31
|
-
export function createFrameWriter(target) {
|
|
32
|
+
export function createFrameWriter(target, onFrame) {
|
|
32
33
|
let pending = [];
|
|
33
34
|
let scheduled = false;
|
|
34
35
|
let closed = false;
|
|
@@ -38,6 +39,7 @@ export function createFrameWriter(target) {
|
|
|
38
39
|
return;
|
|
39
40
|
const frame = pending.join('');
|
|
40
41
|
pending = [];
|
|
42
|
+
onFrame?.(frame);
|
|
41
43
|
target.write(BEGIN_SYNC + restoreTextPresentation(frame) + END_SYNC);
|
|
42
44
|
};
|
|
43
45
|
return {
|
|
@@ -73,8 +75,11 @@ export function createSyncedStdout(target, env = process.env) {
|
|
|
73
75
|
// The kill switch drops the frame batching, not the presentation fix: without it the dialog
|
|
74
76
|
// marker would be a bare `⏺` some terminals draw as an emoji.
|
|
75
77
|
let write;
|
|
78
|
+
// Measured per frame only: unbatched, Ink's erase and its reprint arrive as separate writes, and
|
|
79
|
+
// the erase alone would read as a drop.
|
|
80
|
+
const onFrame = env.REIKA_DEBUG ? recordFrame : undefined;
|
|
76
81
|
if (syncedOutputEnabled(env)) {
|
|
77
|
-
const writer = createFrameWriter(target);
|
|
82
|
+
const writer = createFrameWriter(target, onFrame);
|
|
78
83
|
process.once('exit', writer.close);
|
|
79
84
|
write = writer.write;
|
|
80
85
|
}
|