wormclaude 1.0.138 → 1.0.140

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 CHANGED
@@ -193,6 +193,17 @@ 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
+ // Onaylamadan ÖNCE tüm kodu göster (Claude gibi) — fazlası scrollback'e gider. 300 satır güvenlik sınırı.
202
+ const PREV = 300;
203
+ 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));
204
+ const more = lines.length > PREV ? '\n' + paint(` │ … +${lines.length - PREV} ${word} (çok büyük dosya)`, theme.greyDim) : '';
205
+ return '\n' + head + (body.length ? '\n' + body.join('\n') : '') + more;
206
+ }
196
207
  if (it.kind === 'note')
197
208
  return '\n' + wrap(it.text || '', W).map((ln) => paint(ln, theme.greyDim)).join('\n');
198
209
  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
@@ -16,4 +16,4 @@ export const theme = {
16
16
  synType: '#a78bfa', // tip/sınıf adları, sabitler
17
17
  synProp: '#e0e0e0', // özellik/anahtar adları
18
18
  };
19
- export const VERSION = '1.0.138';
19
+ export const VERSION = '1.0.140';
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 q = paint(' ' + t('tui.permLabel') + ' ', theme.redBright, true) + paint(perm.label, theme.white) + paint(' ' + t('tui.permRun'), theme.grey);
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
  }),
@@ -489,19 +495,27 @@ export async function runTui() {
489
495
  // Açılış: Claude tarzı GÜVEN ekranı — trust metni (içerik) + ok-tuşlu Evet/Hayır seçici (ask modal).
490
496
  {
491
497
  const _en = getLang() === 'en';
492
- printItem({ kind: 'note', text: (_en ? 'Accessing workspace:' : 'Çalışma alanına erişiliyor:') + '\n\n' +
498
+ const _trustNote = { kind: 'note', text: (_en ? 'Accessing workspace:' : 'Çalışma alanına erişiliyor:') + '\n\n' +
493
499
  process.cwd() + '\n\n' +
494
500
  t('trust.check') + '\n\n' +
495
- t('trust.canDo') });
501
+ t('trust.canDo') };
502
+ printItem(_trustNote);
496
503
  const _noLabel = _en ? 'No, exit' : 'Hayır, çık';
497
504
  ask = {
498
505
  question: _en ? 'Trust this folder?' : 'Bu klasöre güveniyor musun?',
499
506
  options: [{ label: _en ? 'Yes, I trust this folder' : 'Evet, bu klasöre güveniyorum' }, { label: _noLabel }],
500
507
  sel: 0,
501
- resolve: (v) => { if (v === _noLabel)
502
- quit();
503
- else
504
- refresh(); },
508
+ // Onay sonrası trust/workspace yazısını KALDIR (Claude gibi) → ekran temizlenir.
509
+ resolve: (v) => {
510
+ if (v === _noLabel) {
511
+ quit();
512
+ return;
513
+ }
514
+ const _i = displayItems.indexOf(_trustNote);
515
+ if (_i >= 0)
516
+ displayItems.splice(_i, 1);
517
+ redrawAll();
518
+ },
505
519
  };
506
520
  refresh();
507
521
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.138",
3
+ "version": "1.0.140",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {