wormclaude 1.0.113 → 1.0.115

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
@@ -439,7 +439,11 @@ const VERBS = [
439
439
  'Decrypting', 'Injecting', 'Probing', 'Assembling', 'Architecting',
440
440
  'Generating', 'Tinkering', 'Sharpening', 'Churning', 'Pwning',
441
441
  ];
442
- function WormSpinner({ label, tokens }) {
442
+ function fmtDur(sec) {
443
+ const s = Math.max(0, Math.floor(sec));
444
+ return s >= 60 ? `${Math.floor(s / 60)}m ${s % 60}s` : `${s}s`;
445
+ }
446
+ function WormSpinner({ label, tokens, seconds }) {
443
447
  const [f, setF] = useState(0);
444
448
  useEffect(() => {
445
449
  const t = setInterval(() => setF((x) => x + 1), 120);
@@ -452,6 +456,9 @@ function WormSpinner({ label, tokens }) {
452
456
  React.createElement(Text, { color: theme.grey },
453
457
  label,
454
458
  "\u2026"),
459
+ seconds ? React.createElement(Text, { color: theme.greyDim },
460
+ " \u00B7 ",
461
+ fmtDur(seconds)) : null,
455
462
  tokens ? React.createElement(Text, { color: theme.greyDim },
456
463
  " \u00B7 ",
457
464
  tokens,
@@ -500,6 +507,7 @@ function App() {
500
507
  const [verb, setVerb] = useState('Worming');
501
508
  const [tokens, setTokens] = useState(0);
502
509
  const [thinking, setThinking] = useState(true);
510
+ const [elapsedSec, setElapsedSec] = useState(0); // çalışırken geçen süre (spinner'da gösterilir)
503
511
  const [ctxTokens, setCtxTokens] = useState(0);
504
512
  const [started, setStarted] = useState(false);
505
513
  const [trustSel, setTrustSel] = useState(0); // 0=Evet, 1=Hayir
@@ -673,6 +681,17 @@ function App() {
673
681
  }
674
682
  // eslint-disable-next-line react-hooks/exhaustive-deps
675
683
  }, [started]);
684
+ // Çalışırken geçen süreyi say → spinner'da "Xm Ys" göster (Claude tarzı süre+token).
685
+ useEffect(() => {
686
+ if (!busy) {
687
+ setElapsedSec(0);
688
+ return;
689
+ }
690
+ const start = Date.now();
691
+ setElapsedSec(0);
692
+ const id = setInterval(() => setElapsedSec(Math.floor((Date.now() - start) / 1000)), 1000);
693
+ return () => clearInterval(id);
694
+ }, [busy]);
676
695
  const push = (it) => setItems((prev) => [...prev, it]);
677
696
  // Arka plan görevlerini izle → footer pill
678
697
  useEffect(() => {
@@ -727,6 +746,7 @@ function App() {
727
746
  let lastToolSig = '';
728
747
  let sameToolCount = 0;
729
748
  let consecFailTurns = 0; // üst üste TÜM araçların başarısız olduğu tur sayısı (devre-kesici)
749
+ let totalFails = 0; // görev boyunca toplam başarısız komut (karışık başarı/başarısızlık döngüsü)
730
750
  let taskIn = 0, taskOut = 0, taskCache = 0; // bu görevin GERÇEK token toplamı (tüm turlar; API usage'dan)
731
751
  while (iter < MAX_TURNS) {
732
752
  if (ac.signal.aborted) {
@@ -759,8 +779,12 @@ function App() {
759
779
  const TAIL_CHARS = 4000;
760
780
  let lastUi = 0;
761
781
  const paintStream = () => {
762
- const tail = assistantText.length > TAIL_CHARS ? assistantText.slice(-TAIL_CHARS) : assistantText;
763
- setStreaming(cleanModelText(tail));
782
+ // Canlı akışta da gömülü tool-call JSON'unu gizle: model uzun çok-adımlı mesaj yazarken
783
+ // ham {"name":"Bash",...} görünmesin. (stripInlineToolCalls "name" yoksa hemen döner →
784
+ // düz metinde maliyet yok.) Tamamlanmamış son blok doğal olarak kalır, sonra temizlenir.
785
+ const cleaned = stripInlineToolCalls(cleanModelText(assistantText));
786
+ const tail = cleaned.length > TAIL_CHARS ? cleaned.slice(-TAIL_CHARS) : cleaned;
787
+ setStreaming(tail);
764
788
  setTokens(Math.round(assistantText.length / 4));
765
789
  };
766
790
  for await (const ev of streamChat(historyRef.current, allToolSchemas(), config, ac.signal)) {
@@ -896,17 +920,23 @@ function App() {
896
920
  // Devre-kesici: bu turda TÜM araçlar başarısız olduysa say. Üst üste 2 tur olursa
897
921
  // modele "DUR ve özetle" dedir — yoksa model olmayan araç/Unix sözdizimini (grep, hydra)
898
922
  // deneyip döngüye girip token yakıyor ve hiç bitirmiyor.
899
- const _allFailed = results.length > 0 && results.every((r) => !r.ok);
923
+ // Devre-kesici 2: KÜMÜLATIF başarısızlık curl başarılı + grep başarısız KARIŞSA bile
924
+ // (olmayan aracı/Unix sözdizimini tekrar tekrar deniyorsa "hepsi fail" tetiklenmez ama
925
+ // başarısızlıklar birikir) toplam eşiği aşınca dur+özetle.
926
+ const _failed = results.filter((r) => !r.ok).length;
927
+ totalFails += _failed;
928
+ const _allFailed = results.length > 0 && _failed === results.length;
900
929
  consecFailTurns = _allFailed ? consecFailTurns + 1 : 0;
901
- if (consecFailTurns >= 2) {
930
+ if (consecFailTurns >= 2 || totalFails >= 4) {
902
931
  historyRef.current = [...historyRef.current, {
903
932
  role: 'user',
904
933
  content: getLang() === 'en'
905
- ? 'Multiple commands failed — the required tool/syntax is not available in this environment. STOP running commands and give a SHORT summary of what you found so far, in the user\'s language. Do not call any more tools.'
906
- : 'Komutlar üst üste başarısız oldu — bu ortamda gerekli araç/sözdizimi yok. Komut çalıştırmayı BIRAK ve şu ana kadarki bulguları KISA bir özetle ver. Başka araç çağırma.',
934
+ ? 'Several commands failed — required tools/syntax are not available here (e.g. grep/openssl/hydra on Windows). STOP running commands now and give a SHORT summary of what you found so far, in the user\'s language. Do NOT call any more tools, and do NOT use grep/sed/awk.'
935
+ : 'Komutlar başarısız oldu — bu ortamda gerekli araç/sözdizim yok (Windows\'ta grep/openssl/hydra gibi). Komut çalıştırmayı ŞİMDİ BIRAK ve şu ana kadarki bulguları KISA bir özetle ver. Başka araç çağırma, grep/sed/awk kullanma.',
907
936
  }];
908
937
  push({ kind: 'note', text: getLang() === 'en' ? 'Commands kept failing — wrapping up with a summary.' : 'Komutlar başarısız oldu — özetle bitiriliyor.' });
909
938
  consecFailTurns = 0;
939
+ totalFails = 0;
910
940
  }
911
941
  }
912
942
  if (!done)
@@ -1238,8 +1268,8 @@ function App() {
1238
1268
  ask.options.length,
1239
1269
  " se\u00E7 \u00B7 Enter onayla"))) : null,
1240
1270
  busy && !perm && !ask ? (thinking
1241
- ? React.createElement(WormSpinner, { label: verb, tokens: tokens })
1242
- : React.createElement(WormSpinner, { label: phase })) : null,
1271
+ ? React.createElement(WormSpinner, { label: verb, tokens: tokens, seconds: elapsedSec })
1272
+ : React.createElement(WormSpinner, { label: phase, seconds: elapsedSec })) : null,
1243
1273
  taskPill ? (React.createElement(Box, { paddingX: 1 },
1244
1274
  React.createElement(Text, { color: theme.greyDim }, taskPill))) : null,
1245
1275
  (React.createElement(Box, { flexDirection: "column" },
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.113';
19
+ export const VERSION = '1.0.115';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormclaude",
3
- "version": "1.0.113",
3
+ "version": "1.0.115",
4
4
  "description": "WormClaude CLI - uncensored security+code assistant (ink TUI, Claude-style)",
5
5
  "type": "module",
6
6
  "bin": {