wormclaude 1.0.55 → 1.0.57
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/cli.js +2 -1
- package/dist/theme.js +1 -1
- package/dist/tui.js +15 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -109,7 +109,8 @@ const _initHistory = () => {
|
|
|
109
109
|
// silemeyip KASKAD yapıyor (scrollback reflow). Alt-screen tüm ekranı yönetir → resize'da
|
|
110
110
|
// temiz yeniden çizim, kaskad YOK. Kopyalama: alt-screen'de fare seçimi sınırlı olduğundan
|
|
111
111
|
// /kopyala komutu (OSC52 ile panoya) sağlanır. ?1049h alt-screen · ?1007h alternate-scroll.
|
|
112
|
-
|
|
112
|
+
// VARSAYILAN: özel renderer (TUI). Eski ink sürümüne dönmek için WORMCLAUDE_INK=1.
|
|
113
|
+
const _TUI = process.env.WORMCLAUDE_INK ? false : true;
|
|
113
114
|
if (!_TUI) {
|
|
114
115
|
try {
|
|
115
116
|
process.stdout.write('\x1b[?1049h\x1b[?1007h\x1b[2J\x1b[H');
|
package/dist/theme.js
CHANGED
package/dist/tui.js
CHANGED
|
@@ -66,6 +66,11 @@ export async function runTui() {
|
|
|
66
66
|
let inputBuf = '', busy = false, streamChars = 0, spin = 0;
|
|
67
67
|
// Canlı akış artık FOOTER'da DEĞİL — içerik akışına (mesajın altından aşağı) satır-satır basılır.
|
|
68
68
|
const SPIN = ['·', '✢', '✳', '✶', '✻', '✽', '✶', '✳', '✢'];
|
|
69
|
+
// Canlı bağlam ölçer: son isteğin prompt_tokens'ı = o anki kullanılan bağlam (footer'da gösterilir).
|
|
70
|
+
const CTX_MAX = Number(process.env.WORMCLAUDE_CTX) || 12288;
|
|
71
|
+
let ctxUsed = 0;
|
|
72
|
+
const _k = (n) => (n >= 1000 ? (n / 1000).toFixed(1).replace(/\.0$/, '') + 'k' : String(n));
|
|
73
|
+
const ctxGauge = () => `◷ ${_k(ctxUsed)}/${_k(CTX_MAX)} (%${Math.min(100, Math.round((ctxUsed / CTX_MAX) * 100))})`;
|
|
69
74
|
// Giriş kutusunu genişliğe göre ÇOK SATIRA sar; çok uzunsa (yapıştırma) KISALTIP özet gösterir.
|
|
70
75
|
const MAX_INPUT_LINES = 6;
|
|
71
76
|
const inputBoxLines = (W) => {
|
|
@@ -149,7 +154,7 @@ export async function runTui() {
|
|
|
149
154
|
}
|
|
150
155
|
// ── İkonlu, 2-sütunlu bilgi başlığı (3 sol / 3 sağ) — responsive ──
|
|
151
156
|
function headerLines(W) {
|
|
152
|
-
const ctx =
|
|
157
|
+
const ctx = CTX_MAX.toLocaleString('tr-TR');
|
|
153
158
|
// [ikon, etiket, değer, renk]
|
|
154
159
|
const L = [
|
|
155
160
|
['◈', 'Version', 'v' + VERSION, theme.red],
|
|
@@ -158,7 +163,7 @@ export async function runTui() {
|
|
|
158
163
|
];
|
|
159
164
|
const R = [
|
|
160
165
|
['◉', 'Account', account.email || '—', theme.grey],
|
|
161
|
-
['◷', 'Context', ctx + '
|
|
166
|
+
['◷', 'Context', ctx + ' tok (pencere)', theme.grey],
|
|
162
167
|
['▸', 'Workspace', process.cwd(), theme.grey],
|
|
163
168
|
];
|
|
164
169
|
const cell = ([ic, lb, val, col]) => ' ' + paint(ic + ' ', theme.red) + paint(lb.padEnd(11), theme.greyDim) + paint(val, col);
|
|
@@ -208,9 +213,10 @@ export async function runTui() {
|
|
|
208
213
|
body = [...menu, line, ...inputLines, line];
|
|
209
214
|
}
|
|
210
215
|
else {
|
|
216
|
+
const g = ctxUsed ? paint(' ' + ctxGauge(), theme.greyDim) : '';
|
|
211
217
|
const status = busy
|
|
212
|
-
? paint(` ${SPIN[spin % SPIN.length]} çalışıyor…${streamChars ? ' ' + streamChars + ' karakter' : ''}`, theme.grey)
|
|
213
|
-
: paint(' / komutlar · ↑↓ geçmiş · /kopyala · Ctrl+C çıkış', theme.greyDim);
|
|
218
|
+
? paint(` ${SPIN[spin % SPIN.length]} çalışıyor…${streamChars ? ' ' + streamChars + ' karakter' : ''}`, theme.grey) + g
|
|
219
|
+
: paint(' / komutlar · ↑↓ geçmiş · /kopyala · Ctrl+C çıkış', theme.greyDim) + g;
|
|
214
220
|
body = [status, line, ...inputLines, line];
|
|
215
221
|
}
|
|
216
222
|
}
|
|
@@ -303,8 +309,12 @@ export async function runTui() {
|
|
|
303
309
|
streamChars = answer.length;
|
|
304
310
|
flushStream(false);
|
|
305
311
|
}
|
|
306
|
-
else if (ev.type === 'done')
|
|
312
|
+
else if (ev.type === 'done') {
|
|
307
313
|
toolCalls = ev.toolCalls || [];
|
|
314
|
+
const u = ev.usage;
|
|
315
|
+
if (u && u.input)
|
|
316
|
+
ctxUsed = u.input;
|
|
317
|
+
}
|
|
308
318
|
else if (ev.type === 'error') {
|
|
309
319
|
answer += `\n[hata: ${ev.error}]`;
|
|
310
320
|
flushStream(false);
|