wormclaude 1.0.138 → 1.0.139
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 +10 -0
- package/dist/i18n.js +4 -0
- package/dist/theme.js +1 -1
- package/dist/tui.js +7 -1
- package/package.json +1 -1
package/dist/ansi.js
CHANGED
|
@@ -193,6 +193,16 @@ export function itemAnsi(it, cols) {
|
|
|
193
193
|
const extra = lines.length > 1 ? paint(` (+${lines.length - 1} ${word})`, theme.greyDim) : '';
|
|
194
194
|
return '\n' + head + '\n' + paint(' ⎿ ', theme.greyDim) + paint(first, theme.grey) + extra;
|
|
195
195
|
}
|
|
196
|
+
if (it.kind === 'fileprev') {
|
|
197
|
+
// Yazmadan ÖNCE dosya içeriği önizlemesi (Claude "Create file" bloğu gibi).
|
|
198
|
+
const word = t('tui.linesWord') || 'satır';
|
|
199
|
+
const lines = it.lines || [];
|
|
200
|
+
const head = paint(' ┌ ', theme.greyDim) + paint((t('tui.createFile') || 'Oluşturulacak dosya') + ': ', theme.redBright, true) + paint(`${it.file} (${lines.length} ${word})`, theme.white);
|
|
201
|
+
const PREV = 14;
|
|
202
|
+
const body = lines.slice(0, PREV).map((ln, i) => paint(` │ ${String(i + 1).padStart(3, ' ')} `, theme.greyDim) + paint(ln.replace(/\t/g, ' ').slice(0, Math.max(8, W - 10)), theme.grey));
|
|
203
|
+
const more = lines.length > PREV ? '\n' + paint(` │ … +${lines.length - PREV} ${word}`, theme.greyDim) : '';
|
|
204
|
+
return '\n' + head + (body.length ? '\n' + body.join('\n') : '') + more;
|
|
205
|
+
}
|
|
196
206
|
if (it.kind === 'note')
|
|
197
207
|
return '\n' + wrap(it.text || '', W).map((ln) => paint(ln, theme.greyDim)).join('\n');
|
|
198
208
|
return '';
|
package/dist/i18n.js
CHANGED
|
@@ -80,6 +80,8 @@ const STR = {
|
|
|
80
80
|
'tui.wrote': 'Yazıldı:',
|
|
81
81
|
'tui.edited': 'Düzenlendi:',
|
|
82
82
|
'tui.toolDone': 'tamam',
|
|
83
|
+
'tui.createFile': 'Oluşturulacak dosya',
|
|
84
|
+
'tui.permCreate': 'oluşturulsun mu?',
|
|
83
85
|
'tui.pasteSummary': '…(+{0} satır · {1} karakter, Enter ile gönder)',
|
|
84
86
|
'tui.permLabel': 'İZİN',
|
|
85
87
|
'tui.permRun': 'çalıştırılsın mı?',
|
|
@@ -144,6 +146,8 @@ const STR = {
|
|
|
144
146
|
'tui.wrote': 'Wrote',
|
|
145
147
|
'tui.edited': 'Edited',
|
|
146
148
|
'tui.toolDone': 'done',
|
|
149
|
+
'tui.createFile': 'Create file',
|
|
150
|
+
'tui.permCreate': '— create it?',
|
|
147
151
|
'tui.pasteSummary': '…(+{0} lines · {1} chars, Enter to send)',
|
|
148
152
|
'tui.permLabel': 'PERMISSION',
|
|
149
153
|
'tui.permRun': 'run it?',
|
package/dist/theme.js
CHANGED
package/dist/tui.js
CHANGED
|
@@ -234,7 +234,8 @@ export async function runTui() {
|
|
|
234
234
|
let body;
|
|
235
235
|
if (perm) {
|
|
236
236
|
// İzin dialogu: araç adı + Evet/Tümü/Hayır
|
|
237
|
-
const
|
|
237
|
+
const _permQ = (perm.name === 'Write' || perm.name === 'Edit') ? t('tui.permCreate') : t('tui.permRun');
|
|
238
|
+
const q = paint(' ' + t('tui.permLabel') + ' ', theme.redBright, true) + paint(perm.label, theme.white) + paint(' ' + _permQ, theme.grey);
|
|
238
239
|
const opts = paint(' ' + t('tui.permYes'), theme.redBright, true) + paint(' · ', theme.greyDim)
|
|
239
240
|
+ paint(t('tui.permAll'), theme.grey) + paint(' · ', theme.greyDim) + paint(t('tui.permNo'), theme.grey);
|
|
240
241
|
body = [line, q, opts, line];
|
|
@@ -419,6 +420,11 @@ export async function runTui() {
|
|
|
419
420
|
confirm: (c, args) => new Promise((resolve) => {
|
|
420
421
|
if (allowAll.has(c.name))
|
|
421
422
|
return resolve('allow');
|
|
423
|
+
// Claude tarzı: Write/Edit'te YAZMADAN ÖNCE dosya içeriğini göster, sonra onay iste.
|
|
424
|
+
if ((c.name === 'Write' && args?.content != null) || (c.name === 'Edit' && args?.new_string != null)) {
|
|
425
|
+
const _content = String(c.name === 'Write' ? args.content : args.new_string);
|
|
426
|
+
printItem({ kind: 'fileprev', file: relWs(args.file_path), lines: _content.split('\n') });
|
|
427
|
+
}
|
|
422
428
|
perm = { label: toolLabel(c.name, args), name: c.name, resolve };
|
|
423
429
|
refresh();
|
|
424
430
|
}),
|