wormclaude 1.0.201 → 1.0.203
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 +1 -1
- package/dist/tui.js +57 -1
- package/package.json +1 -1
package/dist/theme.js
CHANGED
package/dist/tui.js
CHANGED
|
@@ -10,6 +10,7 @@ import { allToolSchemas, executeToolCalls, executeTool, toolLabel, setToolConfig
|
|
|
10
10
|
import { setCheckpointStore } from './checkpoint.js';
|
|
11
11
|
import { extractImages, visionMessages, VISION_MODEL } from './vision.js';
|
|
12
12
|
import * as path from 'node:path';
|
|
13
|
+
import * as fs from 'node:fs';
|
|
13
14
|
import { sanitizeOutput } from './errorsan.js';
|
|
14
15
|
import { itemAnsi, markdownAnsi } from './ansi.js';
|
|
15
16
|
import { theme, VERSION } from './theme.js';
|
|
@@ -56,6 +57,55 @@ function relWs(fp) {
|
|
|
56
57
|
return fp;
|
|
57
58
|
}
|
|
58
59
|
}
|
|
60
|
+
// Klasör-oku augmentasyonu: kullanıcı bir klasörü "oku/incele/analiz" deyince CLI OTOMATİK harita
|
|
61
|
+
// çıkarıp mesaja ekler → model haritayı hazır görür (model "listeleyemedim" diye takılamaz / Glob'ı
|
|
62
|
+
// atlamaz) + stratejik okumaya yönlendirilir (hepsini okuyup bağlam taşırmasın). DETERMİNİSTİK.
|
|
63
|
+
function augmentFolderRead(text) {
|
|
64
|
+
if (!/\b(oku|incele|analiz|tara|özetle|ozetle|göz at|read|analyz|review|examine|summar|inspect)/i.test(text))
|
|
65
|
+
return null;
|
|
66
|
+
const pathM = text.match(/([a-zA-Z]:[\\/][^\s"'`]*|(?:\.{1,2}|~)?\/[^\s"'`]+)/);
|
|
67
|
+
const folderWord = /(klasör|klasor|dizin|folder|directory|repo|proje|codebase)/i.test(text);
|
|
68
|
+
if (!pathM && !folderWord)
|
|
69
|
+
return null;
|
|
70
|
+
let dir = pathM ? pathM[1].replace(/[\\/]+$/, '') : getBashCwd();
|
|
71
|
+
try {
|
|
72
|
+
if (!fs.statSync(dir).isDirectory())
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
const SKIP = new Set(['node_modules', '.git', 'dist', 'build', 'out', '.next', 'venv', '.venv', '__pycache__', 'coverage']);
|
|
79
|
+
const files = [];
|
|
80
|
+
const walk = (d, depth) => {
|
|
81
|
+
if (depth > 6 || files.length > 250)
|
|
82
|
+
return;
|
|
83
|
+
let ents;
|
|
84
|
+
try {
|
|
85
|
+
ents = fs.readdirSync(d, { withFileTypes: true });
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
for (const e of ents) {
|
|
91
|
+
if (files.length > 250)
|
|
92
|
+
break;
|
|
93
|
+
const full = path.join(d, e.name);
|
|
94
|
+
if (e.isDirectory()) {
|
|
95
|
+
if (!SKIP.has(e.name) && !e.name.startsWith('.'))
|
|
96
|
+
walk(full, depth + 1);
|
|
97
|
+
}
|
|
98
|
+
else if (e.isFile())
|
|
99
|
+
files.push(path.relative(dir, full).replace(/\\/g, '/'));
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
walk(dir, 0);
|
|
103
|
+
if (!files.length)
|
|
104
|
+
return null;
|
|
105
|
+
const list = files.slice(0, 250).join('\n');
|
|
106
|
+
return `[Otomatik klasör haritası — ${dir} (${files.length} dosya)]\n${list}\n\n` +
|
|
107
|
+
`Harita ZATEN çıkarıldı (Glob'a gerek yok). STRATEJİK OKU: SADECE ilgili dosyaları Read et — HEPSİNİ okuma (bağlam taşar, iş yarıda kalır). Büyük dosyada offset/limit kullan; aradığını Grep ile bul. Güvenlik analizi (açık/sır/CVE) ise CodeAudit aracını kullan (tüm klasörü taşmadan tarar, sadece bulguları döner).\n\nKullanıcının isteği: ${text}`;
|
|
108
|
+
}
|
|
59
109
|
function capToolOut(name, out) {
|
|
60
110
|
const s = out || '';
|
|
61
111
|
const isCmd = name === 'Bash' || name === 'PowerShell';
|
|
@@ -117,7 +167,7 @@ export async function runTui() {
|
|
|
117
167
|
// Canlı akış artık FOOTER'da DEĞİL — içerik akışına (mesajın altından aşağı) satır-satır basılır.
|
|
118
168
|
const SPIN = ['·', '✢', '✳', '✶', '✻', '✽', '✶', '✳', '✢'];
|
|
119
169
|
// Canlı bağlam ölçer: son isteğin prompt_tokens'ı = o anki kullanılan bağlam (footer'da gösterilir).
|
|
120
|
-
const CTX_MAX = Number(process.env.WORMCLAUDE_CTX) ||
|
|
170
|
+
const CTX_MAX = Number(process.env.WORMCLAUDE_CTX) || 65536; // sunucu slot-context (parallel 2)
|
|
121
171
|
let ctxUsed = 0;
|
|
122
172
|
const _k = (n) => (n >= 1000 ? (n / 1000).toFixed(1).replace(/\.0$/, '') + 'k' : String(n));
|
|
123
173
|
const ctxGauge = () => `◷ ${_k(ctxUsed)}/${_k(CTX_MAX)} (%${Math.min(100, Math.round((ctxUsed / CTX_MAX) * 100))})`;
|
|
@@ -1020,6 +1070,12 @@ export async function runTui() {
|
|
|
1020
1070
|
runTurn(at.augmented, v);
|
|
1021
1071
|
return;
|
|
1022
1072
|
}
|
|
1073
|
+
// Klasör-oku → otomatik harita enjekte (model takılmasın + stratejik okusun)
|
|
1074
|
+
const _fr = augmentFolderRead(v);
|
|
1075
|
+
if (_fr) {
|
|
1076
|
+
runTurn(_fr, v);
|
|
1077
|
+
return;
|
|
1078
|
+
}
|
|
1023
1079
|
runTurn(v, v);
|
|
1024
1080
|
return;
|
|
1025
1081
|
}
|