wormclaude 1.0.77 → 1.0.79

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 CHANGED
@@ -100,6 +100,20 @@ if (_needLogin) {
100
100
  config.model = _fresh.model;
101
101
  if (!config.apiKey)
102
102
  process.exit(0);
103
+ // Login akışı terminal girişini (stdin raw-mode) kirletiyor → TUI'de mesaj kutusuna yazı gitmiyor.
104
+ // Çözüm: temiz durumla OTOMATİK yeniden başlat (güncelleme akışıyla aynı desen). Kullanıcı elle restart yapmaz.
105
+ {
106
+ process.stdout.write('\n ✓ Giris yapildi, baslatiliyor...\n\n');
107
+ const { spawn } = await import('node:child_process');
108
+ const _cmd = process.platform === 'win32' ? 'wormclaude.cmd' : 'wormclaude';
109
+ const _child = spawn(_cmd, process.argv.slice(2), {
110
+ stdio: 'inherit', shell: true,
111
+ env: { ...process.env, WORMCLAUDE_SKIP_UPDATE: '1' },
112
+ });
113
+ _child.on('exit', (code) => process.exit(code ?? 0));
114
+ _child.on('error', () => { process.stdout.write(' Giris tamam. Lutfen "wormclaude" komutunu tekrar calistir.\n'); process.exit(0); });
115
+ await new Promise(() => { }); // çocuk süreci devralana kadar bekle (ana akışa düşme)
116
+ }
103
117
  }
104
118
  setToolConfig(config); // Agent/alt-agent araçları aynı config'i kullanır
105
119
  const MAX_TURNS = Number(process.env.WORMCLAUDE_MAX_TURNS) || 50; // tur limiti
package/dist/safejson.js CHANGED
@@ -104,9 +104,58 @@ function closeOpenStructures(text) {
104
104
  out += stack.pop();
105
105
  return out;
106
106
  }
107
+ /**
108
+ * String DEĞERLERİ içindeki kaçırılmamış çift tırnakları kaçırır.
109
+ * Qwen sık sık shell komutlarını tırnaksız-kaçışla üretir:
110
+ * {"command":"curl "http://x?q=<script>alert('XSS')</script>""}
111
+ * Bu geçerli JSON değil (ikinci " string'i erken kapatır). Bir string içindeyken bir " görünce
112
+ * ileriye bakarız: boşluk atlandıktan sonra gelen anlamlı karakter `:` ise (anahtar kapanışı),
113
+ * `,}]` ise (değer kapanışı) → gerçek kapanış; aksi halde bu İÇ bir tırnaktır → `\"` ile kaçırılır.
114
+ * JSON-iskeletinde anahtar her zaman `:`, değer her zaman `,}]` ile takip edildiğinden güvenlidir.
115
+ */
116
+ export function escapeStrayQuotes(text) {
117
+ let out = '';
118
+ let inString = false;
119
+ let escape = false;
120
+ for (let i = 0; i < text.length; i++) {
121
+ const ch = text[i];
122
+ if (!inString) {
123
+ out += ch;
124
+ if (ch === '"')
125
+ inString = true;
126
+ continue;
127
+ }
128
+ if (escape) {
129
+ out += ch;
130
+ escape = false;
131
+ continue;
132
+ }
133
+ if (ch === '\\') {
134
+ out += ch;
135
+ escape = true;
136
+ continue;
137
+ }
138
+ if (ch === '"') {
139
+ let j = i + 1;
140
+ while (j < text.length && /\s/.test(text[j]))
141
+ j++;
142
+ const next = text[j];
143
+ if (next === undefined || next === ':' || next === ',' || next === '}' || next === ']') {
144
+ out += ch;
145
+ inString = false; // gerçek kapanış
146
+ }
147
+ else {
148
+ out += '\\"'; // iç tırnak → kaçır
149
+ }
150
+ continue;
151
+ }
152
+ out += ch;
153
+ }
154
+ return out;
155
+ }
107
156
  /**
108
157
  * Bozuk/yarım JSON'u en iyi çabayla parse eder. Sırayla: düz parse → fixBooleanCasing →
109
- * trailing-comma temizliği → açık yapıları kapatma. Hepsi başarısızsa fallback döner.
158
+ * trailing-comma temizliği → iç-tırnak kaçırma → açık yapıları kapatma. Hepsi başarısızsa fallback.
110
159
  */
111
160
  export function safeJsonParse(text, fallback) {
112
161
  if (text == null)
@@ -131,13 +180,19 @@ export function safeJsonParse(text, fallback) {
131
180
  return JSON.parse(repaired);
132
181
  }
133
182
  catch { }
134
- // 4) Açık yapıları kapat
135
- repaired = closeOpenStructures(repaired);
183
+ // 4) İç (kaçırılmamış) tırnakları kaçır — shell komutlarındaki "..." için kritik
184
+ const quoted = escapeStrayQuotes(repaired);
185
+ try {
186
+ return JSON.parse(quoted);
187
+ }
188
+ catch { }
189
+ // 5) Açık yapıları kapat
190
+ repaired = closeOpenStructures(quoted);
136
191
  try {
137
192
  return JSON.parse(repaired);
138
193
  }
139
194
  catch { }
140
- // 5) Pes
195
+ // 6) Pes
141
196
  return fallback;
142
197
  }
143
198
  /**
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.77';
19
+ export const VERSION = '1.0.79';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.77",
3
+ "version": "1.0.79",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {