wormclaude 1.0.173 → 1.0.175
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 +15 -1
- package/dist/cli.js +16 -0
- package/dist/theme.js +1 -1
- package/dist/tools.js +19 -4
- package/package.json +1 -1
package/dist/ansi.js
CHANGED
|
@@ -239,7 +239,21 @@ export function itemAnsi(it, cols) {
|
|
|
239
239
|
const head = paint(' ┌ ', theme.greyDim) + paint((t('tui.createFile') || 'Oluşturulacak dosya') + ': ', theme.redBright, true) + paint(`${it.file} (${lines.length} ${word})`, theme.white);
|
|
240
240
|
// Onaylamadan ÖNCE tüm kodu göster (Claude gibi) — fazlası scrollback'e gider. 300 satır güvenlik sınırı.
|
|
241
241
|
const PREV = 300;
|
|
242
|
-
const
|
|
242
|
+
const codeW = Math.max(8, W - 10); // gutter " │ NNN " ≈ 8 sütun
|
|
243
|
+
const shown = lines.slice(0, PREV).map((ln) => ln.replace(/\t/g, ' '));
|
|
244
|
+
const _lang = ((it.file || '').split('.').pop() || '').toLowerCase();
|
|
245
|
+
let body;
|
|
246
|
+
if (isHighlightable(_lang)) {
|
|
247
|
+
// Sözdizimi-vurgulu önizleme (sohbetteki kod blokları gibi) — satır no + renkli token'lar.
|
|
248
|
+
body = highlight(shown.join('\n'), _lang).map((toks, i) => {
|
|
249
|
+
const gutter = paint(` │ ${String(i + 1).padStart(3, ' ')} `, theme.greyDim);
|
|
250
|
+
const seg = toks.length ? wrapTokens(toks, codeW)[0] : ' ';
|
|
251
|
+
return gutter + (seg || ' ');
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
body = shown.map((ln, i) => paint(` │ ${String(i + 1).padStart(3, ' ')} `, theme.greyDim) + paint(ln.slice(0, codeW), theme.grey));
|
|
256
|
+
}
|
|
243
257
|
const more = lines.length > PREV ? '\n' + paint(` │ … +${lines.length - PREV} ${word} (çok büyük dosya)`, theme.greyDim) : '';
|
|
244
258
|
return '\n' + head + (body.length ? '\n' + body.join('\n') : '') + more;
|
|
245
259
|
}
|
package/dist/cli.js
CHANGED
|
@@ -169,6 +169,22 @@ if (_needLogin) {
|
|
|
169
169
|
await new Promise(() => { }); // çocuk süreci devralana kadar bekle (ana akışa düşme)
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
+
// KORUMALI WORKSPACE FIX: CLI C:\Users / C:\Windows / Program Files / disk-kökü gibi YAZILAMAZ
|
|
173
|
+
// bir yerden açıldıysa dosya yazımı EPERM verir ("bana site yap" → C:\Users\index.html → çöker).
|
|
174
|
+
// Böyle bir durumda kullanıcının yazılabilir ~/wormclaude klasörüne geç.
|
|
175
|
+
try {
|
|
176
|
+
const _d = process.cwd().replace(/[\\/]+$/, '').toLowerCase();
|
|
177
|
+
const _protected = /^[a-z]:[\\/]?$/.test(_d) || /^[a-z]:[\\/]users$/.test(_d) || /[\\/]windows$/.test(_d) || /program files/.test(_d) || _d === '';
|
|
178
|
+
if (_protected) {
|
|
179
|
+
const _safe = path.join(os.homedir(), 'wormclaude');
|
|
180
|
+
try {
|
|
181
|
+
fs.mkdirSync(_safe, { recursive: true });
|
|
182
|
+
process.chdir(_safe);
|
|
183
|
+
}
|
|
184
|
+
catch { /* yok say */ }
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
catch { /* yok say */ }
|
|
172
188
|
setToolConfig(config); // Agent/alt-agent araçları aynı config'i kullanır
|
|
173
189
|
setCheckpointStore(process.cwd()); // rewind deposu (/rewind, /checkpoints)
|
|
174
190
|
const MAX_TURNS = Number(process.env.WORMCLAUDE_MAX_TURNS) || 90; // tur limiti
|
package/dist/theme.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -1152,11 +1152,26 @@ export async function executeTool(name, args) {
|
|
|
1152
1152
|
return '';
|
|
1153
1153
|
} })();
|
|
1154
1154
|
recordCheckpoint(fp, _existed ? _wold : null, 'Write'); // rewind: eski hal (yoksa null=sil)
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1155
|
+
let _wfp = fp;
|
|
1156
|
+
try {
|
|
1157
|
+
fs.mkdirSync(path.dirname(path.resolve(_wfp)), { recursive: true });
|
|
1158
|
+
fs.writeFileSync(_wfp, _wnew);
|
|
1159
|
+
}
|
|
1160
|
+
catch (e) {
|
|
1161
|
+
// Korumalı konum (C:\Users root, C:\Windows...) → EPERM/EACCES. Güvenli ~/wormclaude'a yönlendir.
|
|
1162
|
+
if (e && (e.code === 'EPERM' || e.code === 'EACCES')) {
|
|
1163
|
+
const _safe = require('path').join(require('os').homedir(), 'wormclaude');
|
|
1164
|
+
_wfp = require('path').join(_safe, require('path').basename(args.file_path || 'file.txt'));
|
|
1165
|
+
fs.mkdirSync(_safe, { recursive: true });
|
|
1166
|
+
fs.writeFileSync(_wfp, _wnew);
|
|
1167
|
+
}
|
|
1168
|
+
else {
|
|
1169
|
+
throw e;
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
readFiles.add(norm(_wfp));
|
|
1158
1173
|
const _ovr = (_existed && _wold !== _wnew) ? ' (uzerine yazildi)' : '';
|
|
1159
|
-
return { ok: true, output: `Wrote ${
|
|
1174
|
+
return { ok: true, output: `Wrote ${_wfp} (${_wnew.length} chars)${_ovr}${diffStat(_wold, _wnew)}` };
|
|
1160
1175
|
}
|
|
1161
1176
|
if (name === 'Edit') {
|
|
1162
1177
|
const fp = resolveWs(args.file_path);
|