wormclaude 1.0.117 → 1.0.119
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 +3 -3
- package/dist/inlinetools.js +11 -0
- package/dist/theme.js +1 -1
- package/dist/tools.js +14 -5
- package/dist/tui.js +3 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -35,7 +35,7 @@ function loadSession() {
|
|
|
35
35
|
}
|
|
36
36
|
import { theme, VERSION } from './theme.js';
|
|
37
37
|
import { loadConfig, streamChat, fetchAccount } from './api.js';
|
|
38
|
-
import { stripInlineToolCalls } from './inlinetools.js';
|
|
38
|
+
import { stripInlineToolCalls, stripEchoBlocks } from './inlinetools.js';
|
|
39
39
|
import { newTrace, flushTelemetry } from './telemetry.js';
|
|
40
40
|
import { tier } from './program.js';
|
|
41
41
|
import { allToolSchemas, executeToolCalls, executeTool, toolLabel, setToolConfig, setBashCwd } from './tools.js';
|
|
@@ -782,7 +782,7 @@ function App() {
|
|
|
782
782
|
// Canlı akışta da gömülü tool-call JSON'unu gizle: model uzun çok-adımlı mesaj yazarken
|
|
783
783
|
// ham {"name":"Bash",...} görünmesin. (stripInlineToolCalls "name" yoksa hemen döner →
|
|
784
784
|
// düz metinde maliyet yok.) Tamamlanmamış son blok doğal olarak kalır, sonra temizlenir.
|
|
785
|
-
const cleaned = stripInlineToolCalls(cleanModelText(assistantText));
|
|
785
|
+
const cleaned = stripEchoBlocks(stripInlineToolCalls(cleanModelText(assistantText)));
|
|
786
786
|
const tail = cleaned.length > TAIL_CHARS ? cleaned.slice(-TAIL_CHARS) : cleaned;
|
|
787
787
|
setStreaming(tail);
|
|
788
788
|
setTokens(Math.round(assistantText.length / 4));
|
|
@@ -815,7 +815,7 @@ function App() {
|
|
|
815
815
|
assistantText = cleanModelText(assistantText);
|
|
816
816
|
// Model araç çağrısını metne gömdüyse (gömülü JSON / AskUserQuestion prose) → gösterim+
|
|
817
817
|
// geçmişten temizle. HER ZAMAN çalıştır: recovery kaçsa bile ham JSON ekrana sızmasın.
|
|
818
|
-
assistantText = stripInlineToolCalls(assistantText);
|
|
818
|
+
assistantText = stripEchoBlocks(stripInlineToolCalls(assistantText));
|
|
819
819
|
// Reactive compact: bağlam taştıysa bir kez özetle ve turu tekrar dene
|
|
820
820
|
if (gotCtxError && !reactiveRetried) {
|
|
821
821
|
reactiveRetried = true;
|
package/dist/inlinetools.js
CHANGED
|
@@ -128,6 +128,17 @@ export function recoverInlineToolCalls(text) {
|
|
|
128
128
|
}
|
|
129
129
|
return out;
|
|
130
130
|
}
|
|
131
|
+
/** Modelin komut/çıktıyı TEKRAR yazdığı kod-bloklarını siler (```plaintext/bash/http/console…).
|
|
132
|
+
* Zayıf 32B araç çıktısını (SSL handshake, header'lar, curl gövdesi) cevabında reproduce edip
|
|
133
|
+
* context'i şişiriyor + ekranı kirletiyor. Bunlar narrasyon — tool zaten çalıştı, sonucu kompakt
|
|
134
|
+
* gösteriliyor. NOT: python/js/ts/css gibi GERÇEK kod dilleri korunur (build çıktısı bozulmasın). */
|
|
135
|
+
const _ECHO_LANGS = /^(plaintext|plain|text|txt|http|https|console|bash|sh|shell|zsh|cmd|powershell|ps1|output|log|raw)$/i;
|
|
136
|
+
export function stripEchoBlocks(text) {
|
|
137
|
+
let s = text || '';
|
|
138
|
+
// Yalnız AÇIK echo-dilli blokları sil (dilsiz/python/js/html korunur → build çıktısı bozulmaz).
|
|
139
|
+
s = s.replace(/```([a-zA-Z0-9_+-]+)[ \t]*\r?\n([\s\S]*?)```/g, (blk, lang) => (_ECHO_LANGS.test(lang) ? '' : blk));
|
|
140
|
+
return s.replace(/\n{3,}/g, '\n\n').trim();
|
|
141
|
+
}
|
|
131
142
|
/** Kurtarılan çağrı bloklarını GÖRÜNTÜ/geçmiş metninden temizler (çirkin JSON kalmasın). */
|
|
132
143
|
export function stripInlineToolCalls(text) {
|
|
133
144
|
let s = text || '';
|
package/dist/theme.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// OpenAI function şemaları + Node executor'ları. Açıklamalar ve davranışlar
|
|
3
3
|
// WormClaude'un gerçek prompt.ts/şemalarından alınmıştır; sadece marka adı ve
|
|
4
4
|
// WormClaude'da bulunmayan araç referansları (Agent tool, sandbox) uyarlandı.
|
|
5
|
-
import { execSync, spawn } from 'node:child_process';
|
|
5
|
+
import { execSync, spawn, spawnSync } from 'node:child_process';
|
|
6
6
|
import * as fs from 'node:fs';
|
|
7
7
|
import * as os from 'node:os';
|
|
8
8
|
import * as path from 'node:path';
|
|
@@ -50,10 +50,13 @@ function runBashCapturingCwd(command, timeout) {
|
|
|
50
50
|
const cwd = getBashCwd();
|
|
51
51
|
const opts = { encoding: 'utf8', timeout, maxBuffer: 10 * 1024 * 1024, windowsHide: true, cwd };
|
|
52
52
|
if (process.platform === 'win32') {
|
|
53
|
-
// stderr'i
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
const
|
|
53
|
+
// spawnSync: stdout+stderr'i AYRI yakalar (komutu DEĞİŞTİRMEDEN) → curl'ün "% Total" progress
|
|
54
|
+
// meter'ı terminale sızmaz. execSync stderr'i inherit ederdi; `2>&1` ise zincirli (A && B)
|
|
55
|
+
// komutlarda yalnız SON komutun stderr'ini yakalıyordu (ilkininki sızıyordu).
|
|
56
|
+
const r = spawnSync(command, { ...opts, shell: true });
|
|
57
|
+
if (r.error)
|
|
58
|
+
throw r.error;
|
|
59
|
+
const out = (r.stdout || '') + (r.stderr || '');
|
|
57
60
|
// best-effort: "cd <hedef>" / "cd /d <hedef>" (zincirsiz tek komut)
|
|
58
61
|
const m = /^\s*cd\s+(?:\/d\s+)?"?([^"&|<>]+?)"?\s*$/i.exec(command);
|
|
59
62
|
if (m) {
|
|
@@ -64,6 +67,12 @@ function runBashCapturingCwd(command, timeout) {
|
|
|
64
67
|
}
|
|
65
68
|
catch { /* yok say */ }
|
|
66
69
|
}
|
|
70
|
+
if (typeof r.status === 'number' && r.status !== 0) {
|
|
71
|
+
const e = new Error(out || `Command failed (exit ${r.status})`);
|
|
72
|
+
e.stdout = out;
|
|
73
|
+
e.status = r.status;
|
|
74
|
+
throw e;
|
|
75
|
+
}
|
|
67
76
|
return out;
|
|
68
77
|
}
|
|
69
78
|
// POSIX
|
package/dist/tui.js
CHANGED
|
@@ -11,7 +11,7 @@ import { sanitizeOutput } from './errorsan.js';
|
|
|
11
11
|
import { itemAnsi, markdownAnsi } from './ansi.js';
|
|
12
12
|
import { theme, VERSION } from './theme.js';
|
|
13
13
|
import { cleanModelText } from './textclean.js';
|
|
14
|
-
import { stripInlineToolCalls } from './inlinetools.js';
|
|
14
|
+
import { stripInlineToolCalls, stripEchoBlocks } from './inlinetools.js';
|
|
15
15
|
import { COMMANDS, runSlashCommand } from './commands.js';
|
|
16
16
|
import { cmdDesc, t, setLang, loadLang, getLang } from './i18n.js';
|
|
17
17
|
import { getSkill, getSkills, buildSkillPrompt } from './skills.js';
|
|
@@ -328,7 +328,7 @@ export async function runTui() {
|
|
|
328
328
|
return;
|
|
329
329
|
// Gömülü araç-çağrısı JSON'unu (```json {"name":...}```) stdout'a YAZMADAN gizle —
|
|
330
330
|
// stdout append-only, sonradan silinemez. Kesimler fence-güvenli → tam blok burada.
|
|
331
|
-
const chunk = stripInlineToolCalls(cleanModelText(answer.slice(committed, cut))).replace(/\n+$/, '');
|
|
331
|
+
const chunk = stripEchoBlocks(stripInlineToolCalls(cleanModelText(answer.slice(committed, cut)))).replace(/\n+$/, '');
|
|
332
332
|
committed = cut;
|
|
333
333
|
if (!chunk && !final)
|
|
334
334
|
return;
|
|
@@ -371,7 +371,7 @@ export async function runTui() {
|
|
|
371
371
|
catch { }
|
|
372
372
|
continue; // tur sayılmaz, kaldığı yerden devam
|
|
373
373
|
}
|
|
374
|
-
answer = stripInlineToolCalls(cleanModelText(answer)).trim();
|
|
374
|
+
answer = stripEchoBlocks(stripInlineToolCalls(cleanModelText(answer))).trim();
|
|
375
375
|
const am = { role: 'assistant', content: answer || '' };
|
|
376
376
|
if (toolCalls.length)
|
|
377
377
|
am.tool_calls = toolCalls.map((t) => ({ id: t.id, type: 'function', function: { name: t.name, arguments: t.args || '{}' } }));
|