koneck 2.125.0 → 2.126.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/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +5 -3
- package/dist/engine.js.map +1 -1
- package/dist/frame-pace.d.ts +23 -1
- package/dist/frame-pace.d.ts.map +1 -1
- package/dist/frame-pace.js +31 -4
- package/dist/frame-pace.js.map +1 -1
- package/dist/frame-sync.d.ts +25 -0
- package/dist/frame-sync.d.ts.map +1 -1
- package/dist/frame-sync.js +66 -0
- package/dist/frame-sync.js.map +1 -1
- package/dist/ink-chat.d.ts +3 -1
- package/dist/ink-chat.d.ts.map +1 -1
- package/dist/ink-chat.js +29 -7
- package/dist/ink-chat.js.map +1 -1
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +17 -0
- package/dist/permissions.js.map +1 -1
- package/dist/tool-args.d.ts +22 -0
- package/dist/tool-args.d.ts.map +1 -0
- package/dist/tool-args.js +42 -0
- package/dist/tool-args.js.map +1 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +28 -5
- package/dist/tools.js.map +1 -1
- package/package.json +1 -1
package/dist/frame-pace.js
CHANGED
|
@@ -47,8 +47,9 @@ const ON_TIME_FRACTION = 0.2;
|
|
|
47
47
|
* Pure, so the pacing can be asserted rather than eyeballed: the same pair of numbers always gives
|
|
48
48
|
* the same answer, and the curve can be checked at both ends without a terminal.
|
|
49
49
|
*/
|
|
50
|
-
export function pacedInterval(current, deliveredMs) {
|
|
51
|
-
const
|
|
50
|
+
export function pacedInterval(current, deliveredMs, floor = MIN_FRAME_MS) {
|
|
51
|
+
const target = Math.max(MIN_FRAME_MS, Math.min(MAX_FRAME_MS, floor));
|
|
52
|
+
const asked = Math.max(target, Math.min(MAX_FRAME_MS, current));
|
|
52
53
|
const late = deliveredMs - asked;
|
|
53
54
|
// Later than the frame's own budget: the machine cannot paint this fast. Ask for less — at least
|
|
54
55
|
// as long as the frame actually took, so the next request is one it has been shown to manage.
|
|
@@ -57,9 +58,35 @@ export function pacedInterval(current, deliveredMs) {
|
|
|
57
58
|
}
|
|
58
59
|
// Comfortably on time and currently backed off: ease toward the target, gently. A fifth at a
|
|
59
60
|
// time takes several good frames to recover, which is the point — one fast frame proves little.
|
|
60
|
-
if (late <= asked * ON_TIME_FRACTION && asked >
|
|
61
|
-
return Math.max(
|
|
61
|
+
if (late <= asked * ON_TIME_FRACTION && asked > target) {
|
|
62
|
+
return Math.max(target, Math.round(asked * 0.8));
|
|
62
63
|
}
|
|
63
64
|
return asked;
|
|
64
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* The rate to start from, given whether the terminal composites a redraw.
|
|
68
|
+
*
|
|
69
|
+
* In alt-screen mode a frame rewrites the whole screen. A terminal that implements synchronized
|
|
70
|
+
* output presents that as one picture, so it can be done often and looks smooth. A terminal that
|
|
71
|
+
* does not shows the erase, so every frame is a visible blink of the entire interface — and the
|
|
72
|
+
* honest response is to do it far less often, not to keep blinking twelve times a second because
|
|
73
|
+
* the animation would be prettier if the terminal were better.
|
|
74
|
+
*
|
|
75
|
+
* Four frames a second still reads as a spinner turning. It is a compromise, and it is the right
|
|
76
|
+
* way round: a slightly steppy spinner is a cosmetic loss, a blinking screen is why somebody stops
|
|
77
|
+
* using the tool.
|
|
78
|
+
*/
|
|
79
|
+
export const UNSYNCED_FRAME_MS = 250;
|
|
80
|
+
export function startingInterval(synchronized) {
|
|
81
|
+
return synchronized ? MIN_FRAME_MS : UNSYNCED_FRAME_MS;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The floor for this terminal: the pacer must never speed back up past what it can show cleanly.
|
|
85
|
+
*
|
|
86
|
+
* Without this the recovery path would walk a blinking terminal back to 80ms the moment a few
|
|
87
|
+
* frames arrived on time — the machine was keeping up, which was never the problem.
|
|
88
|
+
*/
|
|
89
|
+
export function floorFor(synchronized) {
|
|
90
|
+
return synchronized ? MIN_FRAME_MS : UNSYNCED_FRAME_MS;
|
|
91
|
+
}
|
|
65
92
|
//# sourceMappingURL=frame-pace.js.map
|
package/dist/frame-pace.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame-pace.js","sourceRoot":"","sources":["../src/frame-pace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,+FAA+F;AAC/F,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC;AAEhC;;;;;;GAMG;AACH,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,oFAAoF;AACpF,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe,EAAE,WAAmB;
|
|
1
|
+
{"version":3,"file":"frame-pace.js","sourceRoot":"","sources":["../src/frame-pace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,+FAA+F;AAC/F,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC;AAEhC;;;;;;GAMG;AACH,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,oFAAoF;AACpF,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe,EAAE,WAAmB,EAAE,KAAK,GAAG,YAAY;IACtF,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;IACrE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;IAChE,MAAM,IAAI,GAAG,WAAW,GAAG,KAAK,CAAC;IAEjC,iGAAiG;IACjG,8FAA8F;IAC9F,IAAI,IAAI,GAAG,KAAK,GAAG,aAAa,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED,6FAA6F;IAC7F,gGAAgG;IAChG,IAAI,IAAI,IAAI,KAAK,GAAG,gBAAgB,IAAI,KAAK,GAAG,MAAM,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAGD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAErC,MAAM,UAAU,gBAAgB,CAAC,YAAqB;IACpD,OAAO,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC;AACzD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,YAAqB;IAC5C,OAAO,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC;AACzD,CAAC"}
|
package/dist/frame-sync.d.ts
CHANGED
|
@@ -40,4 +40,29 @@ export declare function synchronizedFrame(chunk: string): string;
|
|
|
40
40
|
* on the stream the terminal actually resizes rather than on a copy that never hears about it.
|
|
41
41
|
*/
|
|
42
42
|
export declare function withSynchronizedFrames<T extends NodeJS.WriteStream>(stream: T): T;
|
|
43
|
+
/**
|
|
44
|
+
* Whether this terminal really implements synchronized output, asked rather than assumed.
|
|
45
|
+
*
|
|
46
|
+
* Setting mode 2026 is safe everywhere — an unrecognised private mode is a defined no-op — so
|
|
47
|
+
* nothing had to be known in advance to start using it. But whether it *works* decides something
|
|
48
|
+
* else entirely: how often the whole screen may be redrawn.
|
|
49
|
+
*
|
|
50
|
+
* In alt-screen mode the transcript is re-rendered every frame, so each animation tick rewrites the
|
|
51
|
+
* entire screen. On a terminal that composites the update that is invisible and the animation can
|
|
52
|
+
* run fast. On one that does not, every tick is an erase the eye can see, twelve times a second —
|
|
53
|
+
* reported as "the whole cli blinks when it is working, it blinks a lot ... otherwise people won't
|
|
54
|
+
* use it". Those two terminals want opposite frame rates, and there is no number that suits both.
|
|
55
|
+
*
|
|
56
|
+
* So the terminal is asked. DECRQM (CSI ? 2026 $p) makes it report the mode: a reply of 1 or 2 means
|
|
57
|
+
* it knows the mode (set or reset), 0 means it does not recognise it, and no reply at all means the
|
|
58
|
+
* same thing in practice. Silence is treated as unsupported, which is both the safe default and
|
|
59
|
+
* self-correcting: a terminal that implements the mode answers in microseconds, so the only thing a
|
|
60
|
+
* timeout costs is a slower animation on a terminal that was going to flash anyway.
|
|
61
|
+
*
|
|
62
|
+
* Asked once, before Ink starts, because it reads a reply from stdin and Ink owns stdin afterwards.
|
|
63
|
+
*/
|
|
64
|
+
export declare function probeSynchronizedOutput(stdout?: {
|
|
65
|
+
isTTY?: boolean;
|
|
66
|
+
write?: (s: string) => unknown;
|
|
67
|
+
}, stdin?: NodeJS.ReadStream, env?: Record<string, string | undefined>, timeoutMs?: number): Promise<boolean>;
|
|
43
68
|
//# sourceMappingURL=frame-sync.d.ts.map
|
package/dist/frame-sync.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame-sync.d.ts","sourceRoot":"","sources":["../src/frame-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAOH,4EAA4E;AAC5E,wBAAgB,uBAAuB,CACrC,MAAM,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAmB,EAC5C,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,OAAO,CAMT;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKvD;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAmBjF"}
|
|
1
|
+
{"version":3,"file":"frame-sync.d.ts","sourceRoot":"","sources":["../src/frame-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAOH,4EAA4E;AAC5E,wBAAgB,uBAAuB,CACrC,MAAM,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAmB,EAC5C,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,OAAO,CAMT;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKvD;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAmBjF;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAA;CAAmB,EAC5E,KAAK,GAAE,MAAM,CAAC,UAA0B,EACxC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,EACrD,SAAS,SAAM,GACd,OAAO,CAAC,OAAO,CAAC,CAmClB"}
|
package/dist/frame-sync.js
CHANGED
|
@@ -77,4 +77,70 @@ export function withSynchronizedFrames(stream) {
|
|
|
77
77
|
},
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Whether this terminal really implements synchronized output, asked rather than assumed.
|
|
82
|
+
*
|
|
83
|
+
* Setting mode 2026 is safe everywhere — an unrecognised private mode is a defined no-op — so
|
|
84
|
+
* nothing had to be known in advance to start using it. But whether it *works* decides something
|
|
85
|
+
* else entirely: how often the whole screen may be redrawn.
|
|
86
|
+
*
|
|
87
|
+
* In alt-screen mode the transcript is re-rendered every frame, so each animation tick rewrites the
|
|
88
|
+
* entire screen. On a terminal that composites the update that is invisible and the animation can
|
|
89
|
+
* run fast. On one that does not, every tick is an erase the eye can see, twelve times a second —
|
|
90
|
+
* reported as "the whole cli blinks when it is working, it blinks a lot ... otherwise people won't
|
|
91
|
+
* use it". Those two terminals want opposite frame rates, and there is no number that suits both.
|
|
92
|
+
*
|
|
93
|
+
* So the terminal is asked. DECRQM (CSI ? 2026 $p) makes it report the mode: a reply of 1 or 2 means
|
|
94
|
+
* it knows the mode (set or reset), 0 means it does not recognise it, and no reply at all means the
|
|
95
|
+
* same thing in practice. Silence is treated as unsupported, which is both the safe default and
|
|
96
|
+
* self-correcting: a terminal that implements the mode answers in microseconds, so the only thing a
|
|
97
|
+
* timeout costs is a slower animation on a terminal that was going to flash anyway.
|
|
98
|
+
*
|
|
99
|
+
* Asked once, before Ink starts, because it reads a reply from stdin and Ink owns stdin afterwards.
|
|
100
|
+
*/
|
|
101
|
+
export async function probeSynchronizedOutput(stdout = process.stdout, stdin = process.stdin, env = process.env, timeoutMs = 150) {
|
|
102
|
+
if (!wantsSynchronizedFrames(stdout, env))
|
|
103
|
+
return false;
|
|
104
|
+
if (!stdin.isTTY || typeof stdin.setRawMode !== 'function')
|
|
105
|
+
return false;
|
|
106
|
+
return new Promise(resolve => {
|
|
107
|
+
let settled = false;
|
|
108
|
+
let seen = '';
|
|
109
|
+
const wasRaw = stdin.isRaw === true;
|
|
110
|
+
const finish = (answer) => {
|
|
111
|
+
if (settled)
|
|
112
|
+
return;
|
|
113
|
+
settled = true;
|
|
114
|
+
clearTimeout(timer);
|
|
115
|
+
stdin.removeListener('data', onData);
|
|
116
|
+
try {
|
|
117
|
+
if (!wasRaw)
|
|
118
|
+
stdin.setRawMode(false);
|
|
119
|
+
}
|
|
120
|
+
catch { /* nothing to restore */ }
|
|
121
|
+
if (!wasRaw)
|
|
122
|
+
stdin.pause();
|
|
123
|
+
resolve(answer);
|
|
124
|
+
};
|
|
125
|
+
const onData = (chunk) => {
|
|
126
|
+
seen += chunk.toString('latin1');
|
|
127
|
+
// CSI ? 2026 ; <value> $y — 1 (set) or 2 (reset) mean the mode is known; 0 means it is not.
|
|
128
|
+
const m = /\x1b\[\?2026;([0-4])\$y/.exec(seen);
|
|
129
|
+
if (m)
|
|
130
|
+
finish(m[1] === '1' || m[1] === '2');
|
|
131
|
+
// Some terminals answer a mode they do not know with a bare "0" report; keep waiting for a
|
|
132
|
+
// recognisable reply otherwise, and let the timeout be the answer.
|
|
133
|
+
};
|
|
134
|
+
const timer = setTimeout(() => finish(false), timeoutMs);
|
|
135
|
+
try {
|
|
136
|
+
stdin.setRawMode(true);
|
|
137
|
+
stdin.resume();
|
|
138
|
+
stdin.on('data', onData);
|
|
139
|
+
stdout.write?.('\x1b[?2026$p');
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
finish(false);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
80
146
|
//# sourceMappingURL=frame-sync.js.map
|
package/dist/frame-sync.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame-sync.js","sourceRoot":"","sources":["../src/frame-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,sFAAsF;AACtF,MAAM,KAAK,GAAG,aAAa,CAAC;AAC5B,2DAA2D;AAC3D,MAAM,GAAG,GAAG,aAAa,CAAC;AAE1B,4EAA4E;AAC5E,MAAM,UAAU,uBAAuB,CACrC,SAA8B,OAAO,CAAC,MAAM,EAC5C,MAA0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AC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/ink-chat.d.ts
CHANGED
|
@@ -339,9 +339,11 @@ export declare function DiffPanel({ files, width, height }: {
|
|
|
339
339
|
* Typechecking passes on that code and no test could reach it, because nothing in the suite mounted
|
|
340
340
|
* an Ink app. Something does now.
|
|
341
341
|
*/
|
|
342
|
-
export declare function App({ config: initialConfig, clearFrame }: {
|
|
342
|
+
export declare function App({ config: initialConfig, clearFrame, synchronizedFrames }: {
|
|
343
343
|
config: AgentConfig;
|
|
344
344
|
clearFrame?: () => void;
|
|
345
|
+
/** Whether this terminal composites a redraw; see frame-sync.ts. */
|
|
346
|
+
synchronizedFrames?: boolean;
|
|
345
347
|
}): React.JSX.Element;
|
|
346
348
|
export declare function runInkChatMode(config: AgentConfig): Promise<void>;
|
|
347
349
|
//# sourceMappingURL=ink-chat.d.ts.map
|
package/dist/ink-chat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ink-chat.d.ts","sourceRoot":"","sources":["../src/ink-chat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AA0B3D,OAAO,EAAyB,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAuCtE,OAAO,KAAK,EAAY,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAiB5D,OAAO,EAA6C,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3F,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,YAAY,CAAC;AAoD7D,KAAK,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AAGhD,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAI9D;AAyED,6FAA6F;AAC7F,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAM7C;AA0BD,gGAAgG;AAChG,wBAAgB,WAAW,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,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,kBAA0B,EAAE,EACxE;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7C,oEAAoE;IACpE,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA69JhE;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCvE"}
|
package/dist/ink-chat.js
CHANGED
|
@@ -3,8 +3,8 @@ import React, { useState, useEffect, useRef } from 'react';
|
|
|
3
3
|
import { Box, Static, Text, render, useApp, useInput, useStdin } from 'ink';
|
|
4
4
|
import { execa } from 'execa';
|
|
5
5
|
import { resolveAgentConcurrency, toolsUnsupportedNotice } from './engine-facts.js';
|
|
6
|
-
import { withSynchronizedFrames } from './frame-sync.js';
|
|
7
|
-
import { pacedInterval } from './frame-pace.js';
|
|
6
|
+
import { withSynchronizedFrames, probeSynchronizedOutput } from './frame-sync.js';
|
|
7
|
+
import { pacedInterval, startingInterval, floorFor } from './frame-pace.js';
|
|
8
8
|
import { estimateCost, formatCost, rateText } from './pricing.js';
|
|
9
9
|
import { generateSessionId, saveSession, listSessions, loadSession, relativeAge, renameSession, forkSession, archiveSession, findSession, } from './session.js';
|
|
10
10
|
import { loadMemory } from './memory.js';
|
|
@@ -1266,7 +1266,7 @@ export function DiffPanel({ files, width, height }) {
|
|
|
1266
1266
|
* Typechecking passes on that code and no test could reach it, because nothing in the suite mounted
|
|
1267
1267
|
* an Ink app. Something does now.
|
|
1268
1268
|
*/
|
|
1269
|
-
export function App({ config: initialConfig, clearFrame }) {
|
|
1269
|
+
export function App({ config: initialConfig, clearFrame, synchronizedFrames = false }) {
|
|
1270
1270
|
const { exit } = useApp();
|
|
1271
1271
|
const [cfg, setCfg] = useState(initialConfig);
|
|
1272
1272
|
// Tool approval callbacks belong to a session created on an earlier render. Keep the control
|
|
@@ -2198,6 +2198,17 @@ export function App({ config: initialConfig, clearFrame }) {
|
|
|
2198
2198
|
/** Tools this turn has run, which is what separates work from a plain answer. */
|
|
2199
2199
|
const turnToolsRef = useRef(0); // a tool failed and was worked around
|
|
2200
2200
|
const busyStart = useRef(0);
|
|
2201
|
+
/*
|
|
2202
|
+
* Whether this terminal composites a redraw, decided once before Ink started.
|
|
2203
|
+
*
|
|
2204
|
+
* A ref rather than state: it never changes for the life of the process, and the ticker reads it
|
|
2205
|
+
* when it starts. It gates the frame rate, because in alt-screen mode every frame rewrites the
|
|
2206
|
+
* whole screen — invisible where the terminal composites it, a blink of the entire interface
|
|
2207
|
+
* where it does not. See frame-sync.ts and frame-pace.ts.
|
|
2208
|
+
*/
|
|
2209
|
+
const syncedFramesRef = useRef(synchronizedFrames);
|
|
2210
|
+
/** Whether the diff panel is showing, so the transcript does not draw the same diff again. */
|
|
2211
|
+
const diffPanelOpenRef = useRef(false);
|
|
2201
2212
|
const wordTimer = useRef(0);
|
|
2202
2213
|
// Register on the session bus so other running KONECK instances can reach this one.
|
|
2203
2214
|
useEffect(() => {
|
|
@@ -2276,11 +2287,12 @@ export function App({ config: initialConfig, clearFrame }) {
|
|
|
2276
2287
|
* budget, and asking again just as soon only queues a frame that cannot be painted — which is
|
|
2277
2288
|
* how a Pi ends up lagging while the same build feels instant on a laptop. See frame-pace.ts.
|
|
2278
2289
|
*/
|
|
2279
|
-
|
|
2290
|
+
const floor = floorFor(syncedFramesRef.current);
|
|
2291
|
+
let interval = startingInterval(syncedFramesRef.current);
|
|
2280
2292
|
let asked = Date.now();
|
|
2281
2293
|
const tick = () => {
|
|
2282
2294
|
const now = Date.now();
|
|
2283
|
-
interval = pacedInterval(interval, now - asked);
|
|
2295
|
+
interval = pacedInterval(interval, now - asked, floor);
|
|
2284
2296
|
// Elapsed is read from the clock rather than counted in ticks, so a frame the event loop
|
|
2285
2297
|
// delivers late moves the animation on by what actually passed instead of falling behind.
|
|
2286
2298
|
const elapsed = now - busyStart.current;
|
|
@@ -5366,6 +5378,9 @@ export function App({ config: initialConfig, clearFrame }) {
|
|
|
5366
5378
|
* scrollback full-width, and there is no frame to put a second column in.
|
|
5367
5379
|
*/
|
|
5368
5380
|
const diffPanelOpen = showDiffPanel && altScreen && liveDiffs.length > 0;
|
|
5381
|
+
// Read by renderStep, which is defined above this line, so it goes through a ref rather than
|
|
5382
|
+
// depending on declaration order.
|
|
5383
|
+
diffPanelOpenRef.current = diffPanelOpen;
|
|
5369
5384
|
const diffPanelWidth = diffPanelOpen
|
|
5370
5385
|
? Math.max(34, Math.min(Math.floor(uiWidth * 0.46), 96))
|
|
5371
5386
|
: 0;
|
|
@@ -5420,7 +5435,7 @@ export function App({ config: initialConfig, clearFrame }) {
|
|
|
5420
5435
|
const ms = (step.endedAt ?? Date.now()) - step.startedAt;
|
|
5421
5436
|
const glyph = running ? SPINNER[spinFrame] : step.ok === false ? G.fail : G.ok;
|
|
5422
5437
|
const color = running ? AMBER : step.ok === false ? CRIMSON : GREEN;
|
|
5423
|
-
return (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: color, children: glyph }), _jsx(Text, { color: AMBER, bold: true, children: step.name }), _jsx(Text, { color: DIM, children: "\u00B7" }), _jsx(Text, { color: MUTED, children: fmtElapsed(ms) })] }), step.detail !== '' && (step.diffs ?? []).length === 0 && (_jsxs(Box, { paddingLeft: 2, gap: 1, children: [_jsx(Text, { color: DIM, children: "\u2514" }), _jsx(Text, { color: MUTED, children: step.detail })] })), step.ok === false && step.error && (_jsxs(Box, { paddingLeft: 2, gap: 1, children: [_jsx(Text, { color: DIM, children: "\u2514" }), _jsx(Text, { color: CRIMSON, children: fitCells(step.error, Math.max(20, barWidth - 6)) })] })), running && step.output && (_jsx(Box, { paddingLeft: 4, children: _jsx(Text, { color: DIM, children: fitCells(step.output, Math.max(20, barWidth - 6)) }) })), (step.diffs ?? []).map((d, i) => renderDiff(d, i))] }, key));
|
|
5438
|
+
return (_jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsxs(Box, { gap: 1, children: [_jsx(Text, { color: color, children: glyph }), _jsx(Text, { color: AMBER, bold: true, children: step.name }), _jsx(Text, { color: DIM, children: "\u00B7" }), _jsx(Text, { color: MUTED, children: fmtElapsed(ms) })] }), step.detail !== '' && (step.diffs ?? []).length === 0 && (_jsxs(Box, { paddingLeft: 2, gap: 1, children: [_jsx(Text, { color: DIM, children: "\u2514" }), _jsx(Text, { color: MUTED, children: step.detail })] })), step.ok === false && step.error && (_jsxs(Box, { paddingLeft: 2, gap: 1, children: [_jsx(Text, { color: DIM, children: "\u2514" }), _jsx(Text, { color: CRIMSON, children: fitCells(step.error, Math.max(20, barWidth - 6)) })] })), running && step.output && (_jsx(Box, { paddingLeft: 4, children: _jsx(Text, { color: DIM, children: fitCells(step.output, Math.max(20, barWidth - 6)) }) })), !diffPanelOpenRef.current && (step.diffs ?? []).map((d, i) => renderDiff(d, i))] }, key));
|
|
5424
5439
|
};
|
|
5425
5440
|
/**
|
|
5426
5441
|
* One transcript row.
|
|
@@ -5858,7 +5873,14 @@ export async function runInkChatMode(config) {
|
|
|
5858
5873
|
// Frames go out bracketed as synchronized updates, so the erase-then-redraw Ink performs on
|
|
5859
5874
|
// every repaint is composited by the terminal instead of being shown as a blank flash. That is
|
|
5860
5875
|
// what allows the animation to run at FRAME_MS; see frame-sync.ts.
|
|
5861
|
-
|
|
5876
|
+
/*
|
|
5877
|
+
* Asked before Ink starts, because the reply arrives on stdin and Ink owns stdin from here.
|
|
5878
|
+
*
|
|
5879
|
+
* The answer sets the animation's floor: fast where a redraw is composited, slow where every
|
|
5880
|
+
* frame is a visible blink of the whole screen. 150ms at worst, once, on startup.
|
|
5881
|
+
*/
|
|
5882
|
+
const synchronizedFrames = await probeSynchronizedOutput().catch(() => false);
|
|
5883
|
+
const app = render(_jsx(App, { config: config, synchronizedFrames: synchronizedFrames, clearFrame: () => inkClear?.() }), { stdout: withSynchronizedFrames(process.stdout),
|
|
5862
5884
|
exitOnCtrlC: false, patchConsole: false });
|
|
5863
5885
|
inkClear = app.clear;
|
|
5864
5886
|
// The engine is imported on demand so the banner and the prompt are not waiting on the OpenAI
|