wormclaude 1.0.26 → 1.0.28
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/ansi.js +3 -5
- package/dist/theme.js +1 -1
- package/dist/tui.js +20 -13
- package/package.json +1 -1
package/dist/ansi.js
CHANGED
|
@@ -142,11 +142,9 @@ export function itemAnsi(it, cols) {
|
|
|
142
142
|
if (it.kind === 'banner')
|
|
143
143
|
return '\n' + bannerAnsi(cols);
|
|
144
144
|
if (it.kind === 'user') {
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
const body = wrap('› ' + (it.text || ''), inner).map((ln) => paint('│ ', theme.greyDim) + paint(ln.padEnd(inner), theme.white) + paint(' │', theme.greyDim));
|
|
149
|
-
return '\n' + [top, ...body, bot].join('\n');
|
|
145
|
+
// Kenarlıksız (kutu, küçültünce bozuluyordu) — sadece "› metin", resize'da temiz sarılır.
|
|
146
|
+
const body = wrap(it.text || '', W - 2).map((ln, i) => (i === 0 ? paint('› ', theme.greyDim, true) : ' ') + paint(ln, theme.white));
|
|
147
|
+
return '\n' + body.join('\n');
|
|
150
148
|
}
|
|
151
149
|
if (it.kind === 'assistant') {
|
|
152
150
|
const md = markdownAnsi(it.text || '', cols).split('\n');
|
package/dist/theme.js
CHANGED
package/dist/tui.js
CHANGED
|
@@ -6,7 +6,7 @@ import readline from 'node:readline';
|
|
|
6
6
|
import logUpdate from 'log-update';
|
|
7
7
|
import stringWidth from 'string-width';
|
|
8
8
|
import { loadConfig, streamChat } from './api.js';
|
|
9
|
-
import { itemAnsi
|
|
9
|
+
import { itemAnsi } from './ansi.js';
|
|
10
10
|
import { theme, VERSION } from './theme.js';
|
|
11
11
|
import { cleanModelText } from './textclean.js';
|
|
12
12
|
const RESET = '\x1b[0m';
|
|
@@ -110,9 +110,19 @@ export async function runTui() {
|
|
|
110
110
|
readline.emitKeypressEvents(process.stdin);
|
|
111
111
|
if (process.stdin.isTTY)
|
|
112
112
|
process.stdin.setRawMode(true);
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
// TÜM mouse-reporting modlarını kapat (ink oturumundan ?1007h sızmış olabilir). Kapalıyken
|
|
114
|
+
// fare sürükleme/seçimi tamamen terminalin işi olur → yukarı sürükleyip seçmek çalışır.
|
|
115
|
+
try {
|
|
116
|
+
process.stdout.write('\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1006l\x1b[?1015l\x1b[?1007l');
|
|
117
|
+
}
|
|
118
|
+
catch { }
|
|
119
|
+
// Temiz başlangıç: önceki terminal içeriğini ve scrollback'i temizle.
|
|
120
|
+
process.stdout.write('\x1b[2J\x1b[3J\x1b[H');
|
|
121
|
+
// KOMPAKT banner (tek satır) — büyük ASCII scrollback'te küçültünce bozuluyordu; bu bozulmaz.
|
|
122
|
+
process.stdout.write(paint(' ● WORMCLAUDE', theme.red, true) + paint(' · uncensored security + code', theme.greyDim) + '\n');
|
|
123
|
+
process.stdout.write(paint(` v${VERSION} · özel renderer (deneysel) · /help komutlar · /kopyala panoya`, theme.greyDim) + '\n\n');
|
|
115
124
|
renderFooter();
|
|
125
|
+
const quit = () => { logUpdate.clear(); process.stdout.write('\x1b[2J\x1b[3J\x1b[H'); process.exit(0); };
|
|
116
126
|
let ctrlcAt = 0;
|
|
117
127
|
process.stdin.on('keypress', (str, key) => {
|
|
118
128
|
// Ctrl+C tek başına ÇIKMAZ (Windows'ta seçimi Ctrl+C ile kopyalarken uygulama kapanmasın).
|
|
@@ -125,18 +135,14 @@ export async function runTui() {
|
|
|
125
135
|
}
|
|
126
136
|
const now = Date.now();
|
|
127
137
|
if (now - ctrlcAt < 2000) {
|
|
128
|
-
|
|
129
|
-
process.stdout.write('\n');
|
|
130
|
-
process.exit(0);
|
|
138
|
+
quit();
|
|
131
139
|
}
|
|
132
140
|
ctrlcAt = now;
|
|
133
141
|
printItem({ kind: 'note', text: 'Çıkmak için tekrar Ctrl+C (veya /cikis). Kopyalama Ctrl+C\'yi etkilemez.' });
|
|
134
142
|
return;
|
|
135
143
|
}
|
|
136
144
|
if (key && key.ctrl && key.name === 'd') {
|
|
137
|
-
|
|
138
|
-
process.stdout.write('\n');
|
|
139
|
-
process.exit(0);
|
|
145
|
+
quit();
|
|
140
146
|
}
|
|
141
147
|
if (busy)
|
|
142
148
|
return; // tur sırasında giriş kilitli (M1)
|
|
@@ -148,8 +154,7 @@ export async function runTui() {
|
|
|
148
154
|
return;
|
|
149
155
|
}
|
|
150
156
|
if (v === '/cikis' || v === '/exit' || v === '/quit') {
|
|
151
|
-
|
|
152
|
-
process.exit(0);
|
|
157
|
+
quit();
|
|
153
158
|
}
|
|
154
159
|
// /kopyala — son yanıtı OSC52 ile panoya
|
|
155
160
|
if (v === '/kopyala' || v === '/copy') {
|
|
@@ -176,8 +181,10 @@ export async function runTui() {
|
|
|
176
181
|
renderFooter();
|
|
177
182
|
return;
|
|
178
183
|
}
|
|
179
|
-
// yazdırılabilir karakter /
|
|
180
|
-
|
|
184
|
+
// SADECE gerçek yazdırılabilir karakter ekle. Escape/kontrol dizileri (fare raporları, ok
|
|
185
|
+
// tuşları, fonksiyon tuşları) girişi BOZMAZ ve footer'ı yeniden çizdirmez → fareyle seçim
|
|
186
|
+
// sırasında ekran en alta snap edip seçimi düşürmez.
|
|
187
|
+
if (str && !key?.ctrl && !key?.meta && !str.startsWith('\x1b') && !/[\x00-\x1f]/.test(str)) {
|
|
181
188
|
inputBuf += str;
|
|
182
189
|
renderFooter();
|
|
183
190
|
}
|