wormclaude 1.0.40 → 1.0.42
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/theme.js +1 -1
- package/dist/tui.js +34 -5
- package/package.json +1 -1
package/dist/theme.js
CHANGED
package/dist/tui.js
CHANGED
|
@@ -57,6 +57,8 @@ export async function runTui() {
|
|
|
57
57
|
// İzin (araç onayı) durumu
|
|
58
58
|
let perm = null;
|
|
59
59
|
const allowAll = new Set(); // "Tümüne izin" denen araçlar (oturum boyu)
|
|
60
|
+
const inputHistory = []; // gönderilen mesajlar (↑/↓ ile geri çağrılır)
|
|
61
|
+
let histIdx = -1; // -1 = geçmişte gezinmiyor
|
|
60
62
|
// ── Claude tarzı başlık (model/plan/mail/cwd) — responsive ──
|
|
61
63
|
function headerLines(W) {
|
|
62
64
|
const a = paint(' WormClaude ', theme.greyDim) + paint('v' + VERSION, theme.red, true)
|
|
@@ -89,10 +91,11 @@ export async function runTui() {
|
|
|
89
91
|
if (vis(shown) > avail)
|
|
90
92
|
shown = '…' + shown.slice(-(avail - 1));
|
|
91
93
|
const inputLine = paint('❯ ', theme.redBright, true) + paint(shown, theme.white) + paint('▌', theme.greyDim);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
// Durum satırı KUTUNUN ÜSTÜNDE (en altta değil): çalışırken spinner, boştayken ipucu.
|
|
95
|
+
const status = busy
|
|
96
|
+
? paint(` ${SPIN[spin % SPIN.length]} çalışıyor…${streamChars ? ' ' + streamChars + ' karakter' : ''}`, theme.grey)
|
|
97
|
+
: paint(' /kopyala · /help komutlar · ↑↓ geçmiş · Ctrl+C çıkış', theme.greyDim);
|
|
98
|
+
body = [status, line, inputLine, line];
|
|
96
99
|
}
|
|
97
100
|
let out = '\x1b7'; // imleci kaydet
|
|
98
101
|
body.forEach((l, i) => { out += `\x1b[${start + i};1H\x1b[2K` + fit(l, W); });
|
|
@@ -128,10 +131,11 @@ export async function runTui() {
|
|
|
128
131
|
let answer = '';
|
|
129
132
|
let toolCalls = [];
|
|
130
133
|
for await (const ev of streamChat(history, allToolSchemas(), config)) {
|
|
134
|
+
// NOT: token başına drawFooter ÇAĞIRMA (uzun cevapta binlerce çizim → titreme/kaybolma).
|
|
135
|
+
// streamChars güncellenir; footer'ı 120ms'lik spinTimer çizer; yazma anında keypress çizer.
|
|
131
136
|
if (ev.type === 'text') {
|
|
132
137
|
answer += ev.text;
|
|
133
138
|
streamChars = answer.length;
|
|
134
|
-
drawFooter();
|
|
135
139
|
}
|
|
136
140
|
else if (ev.type === 'done')
|
|
137
141
|
toolCalls = ev.toolCalls || [];
|
|
@@ -246,15 +250,40 @@ export async function runTui() {
|
|
|
246
250
|
if (key && key.ctrl && key.name === 'd') {
|
|
247
251
|
quit();
|
|
248
252
|
}
|
|
253
|
+
// ↑/↓ — geçmiş mesajlarda gezin (shell tarzı komut geçmişi)
|
|
254
|
+
if (key && key.name === 'up') {
|
|
255
|
+
if (inputHistory.length) {
|
|
256
|
+
histIdx = histIdx < 0 ? inputHistory.length - 1 : Math.max(0, histIdx - 1);
|
|
257
|
+
inputBuf = inputHistory[histIdx];
|
|
258
|
+
drawFooter();
|
|
259
|
+
}
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (key && key.name === 'down') {
|
|
263
|
+
if (histIdx >= 0) {
|
|
264
|
+
histIdx++;
|
|
265
|
+
if (histIdx >= inputHistory.length) {
|
|
266
|
+
histIdx = -1;
|
|
267
|
+
inputBuf = '';
|
|
268
|
+
}
|
|
269
|
+
else
|
|
270
|
+
inputBuf = inputHistory[histIdx];
|
|
271
|
+
drawFooter();
|
|
272
|
+
}
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
249
275
|
if (key && key.name === 'return') {
|
|
250
276
|
if (busy)
|
|
251
277
|
return; // tur sürerken Enter beklemede; yazılan metin durur (type-ahead)
|
|
252
278
|
const v = inputBuf.trim();
|
|
253
279
|
inputBuf = '';
|
|
280
|
+
histIdx = -1;
|
|
254
281
|
if (!v) {
|
|
255
282
|
drawFooter();
|
|
256
283
|
return;
|
|
257
284
|
}
|
|
285
|
+
if (v)
|
|
286
|
+
inputHistory.push(v); // geçmişe ekle (↑ ile geri çağrılır)
|
|
258
287
|
if (v === '/cikis' || v === '/exit' || v === '/quit') {
|
|
259
288
|
quit();
|
|
260
289
|
}
|