wormclaude 1.0.51 → 1.0.52

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 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.51';
19
+ export const VERSION = '1.0.52';
package/dist/tui.js CHANGED
@@ -86,24 +86,11 @@ export async function runTui() {
86
86
  return shown.map((ln, i) => (i === 0 ? paint('✶ ', theme.redBright, true) : ' ') + paint(ln, theme.white) + (i === shown.length - 1 ? paint('▌', theme.greyDim) : ''));
87
87
  };
88
88
  // Footer yüksekliği DİNAMİK: izin=4; değilse (durum/menü) + çizgi + giriş-satırları + çizgi.
89
- let prevFH = 4;
90
- const footerHeight = () => {
91
- if (perm)
92
- return 4;
93
- if (ask)
94
- return ask.options.length + 3; // çizgi + soru + seçenekler... aslında: line+q+opts+line
95
- const il = inputBoxLines(Math.max(8, cols())).length;
96
- if (busy && streamPreview)
97
- return PREVIEW_LINES + 2 + il; // canlı akış önizlemesi
98
- const m = cmdMatches();
99
- const statusLines = m.length ? Math.min(8, m.length) : 1;
100
- return statusLines + 2 + il;
101
- };
102
- // Yükseklik değiştiyse scroll-region'ı + içeriği yeniden bas; değişmediyse sadece footer'ı çiz.
103
- const refresh = () => { const fh = footerHeight(); if (fh !== prevFH)
104
- redrawAll();
105
- else
106
- drawFooter(); };
89
+ // SABİT rezerve footer alanı (scroll region bir kez ayarlanır → churn/duplicate yok). Footer bu
90
+ // alanın DİBİNE sabitlenir; küçükse üstü boşaltılır. Menü/önizleme/giriş bu sınıra göre kırpılır.
91
+ const FOOTER_MAX = () => Math.min(11, Math.max(5, rows() - 6));
92
+ // refresh = sadece footer'ı çiz (region sabit; içerik yeniden BASILMAZ → duplicate olmaz).
93
+ const refresh = () => drawFooter();
107
94
  setToolConfig(config); // araçlar (Write/Bash/Edit…) aynı config'i kullansın
108
95
  // İzin (araç onayı) + soru (AskUserQuestion) durumu
109
96
  let perm = null;
@@ -171,16 +158,15 @@ export async function runTui() {
171
158
  return [...L, ...R].map((r) => fit(cell(r), W)); // dar ekran → alt alta
172
159
  return [0, 1, 2].map((i) => fit(padVis(cell(L[i]), colW) + cell(R[i]), W)); // geniş → 2 sütun
173
160
  }
174
- // ── Scroll region: üst = içerik (kayar), alt = sabit footer (dinamik yükseklik) ──
161
+ // ── Scroll region: üst=içerik, alt=SABİT rezerve footer alanı. İmleci koru (DECSTBM home'a alır). ──
175
162
  function setRegion() {
176
- const bottom = Math.max(1, rows() - footerHeight() - 1); // footer üstünde 1 boş satır
177
- process.stdout.write(`\x1b[1;${bottom}r`);
163
+ const bottom = Math.max(1, rows() - FOOTER_MAX() - 1);
164
+ process.stdout.write(`\x1b7\x1b[1;${bottom}r\x1b8`); // save · region · restore (içerik imleci bozulmaz)
178
165
  }
179
- // ── Sabit footeren alta mutlak konumla çiz (imleci kaydet/geri yükle içerik bozulmaz) ──
166
+ // ── Footerrezerve alanın DİBİNE çiz; rezerve alanın geri kalanını boşalt (eski menü kalmaz). ──
180
167
  function drawFooter() {
181
168
  const W = Math.max(8, cols());
182
- const fh = footerHeight();
183
- const start = rows() - fh + 1;
169
+ const R = rows(), FM = FOOTER_MAX();
184
170
  const line = paint('─'.repeat(W), theme.red);
185
171
  let body;
186
172
  if (perm) {
@@ -227,14 +213,19 @@ export async function runTui() {
227
213
  body = [status, line, ...inputLines, line];
228
214
  }
229
215
  }
230
- let out = '\x1b7'; // imleci kaydet
231
- body.forEach((l, i) => { out += `\x1b[${start + i};1H\x1b[2K` + fit(l, W); });
232
- out += '\x1b8'; // imleci geri yükle (içerik alanı)
216
+ if (body.length > FM)
217
+ body = body.slice(body.length - FM); // rezerve alanı aşma (giriş hep görünür)
218
+ const bodyStart = R - body.length + 1; // footer'ı ekranın DİBİNE sabitle
219
+ const reservedTop = R - FM + 1;
220
+ let out = '\x1b7'; // imleci kaydet (içerik alanı)
221
+ for (let r = reservedTop; r < bodyStart; r++)
222
+ out += `\x1b[${r};1H\x1b[2K`; // üst rezerve satırları boşalt
223
+ body.forEach((l, i) => { out += `\x1b[${bodyStart + i};1H\x1b[2K` + fit(l, W); });
224
+ out += '\x1b8'; // imleci geri yükle
233
225
  process.stdout.write(out);
234
226
  }
235
- // ── Her şeyi yeni boyutta yeniden bas (banner/kod responsive); içerik bölgesine ──
227
+ // ── Her şeyi yeni boyutta yeniden bas (SADECE açılış/resize/clear; footer değişiminde DEĞİL). ──
236
228
  function redrawAll() {
237
- prevFH = footerHeight(); // mevcut footer yüksekliğini kaydet (refresh karşılaştırması için)
238
229
  setRegion();
239
230
  process.stdout.write('\x1b[2J\x1b[3J\x1b[H');
240
231
  const W = cols();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {