wormclaude 1.0.137 → 1.0.138
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/inlinetools.js +6 -4
- package/dist/theme.js +1 -1
- package/dist/tui.js +7 -2
- package/package.json +1 -1
package/dist/inlinetools.js
CHANGED
|
@@ -9,7 +9,8 @@ import { safeJsonParse } from './safejson.js';
|
|
|
9
9
|
const ARG_KEYS = ['arguments', 'parameters', 'input', 'args', 'params'];
|
|
10
10
|
// Model araç adını JSON DIŞINA koyabiliyor: `Bash {"command":...}` / `Write {"file_path":...}`.
|
|
11
11
|
const _TOOLS = 'Bash|PowerShell|Read|Write|Edit|Glob|Grep|WebFetch|WebSearch|Sleep|TaskOutput';
|
|
12
|
-
|
|
12
|
+
// name ile `{` arasında opsiyonel `,`/`:` olabilir: `Write {`, `Write,{`, `Write, {`, `Write: {`.
|
|
13
|
+
const TOOL_PREFIX_RE = new RegExp('(?:^|[\\n>*`\\s])(' + _TOOLS + ')\\s*[,:]?\\s*\\{');
|
|
13
14
|
// Fonksiyon-çağrı pseudo-syntax'i: `Write(file_path="...", content="""...""")`.
|
|
14
15
|
const TOOL_PAREN_RE = new RegExp('(' + _TOOLS + ')\\s*\\(');
|
|
15
16
|
// `key="val"` / `key='val'` / `key="""val"""` argümanlarını çözer (content çok-satırlı olabilir).
|
|
@@ -236,10 +237,11 @@ export function recoverInlineToolCalls(text) {
|
|
|
236
237
|
// 5) "ToolName { ...args... }" — model araç adını JSON DIŞINA koyuyor (Bash {"command":...}).
|
|
237
238
|
// Args doğrudan obje (arguments sarmalı yok) → {name: ToolName, arguments: {...}}.
|
|
238
239
|
if (!out.length) {
|
|
239
|
-
const re = new RegExp('(' + _TOOLS + ')\\s*(\\{)', 'g');
|
|
240
|
+
const re = new RegExp('(' + _TOOLS + ')\\s*[,:]?\\s*(\\{)', 'g');
|
|
240
241
|
let mm;
|
|
241
242
|
while ((mm = re.exec(t)) !== null) {
|
|
242
|
-
|
|
243
|
+
// mm[2] = '{' konumu; name'den { 'a kadar olan kısmı (virgül/boşluk) atla.
|
|
244
|
+
const objs = extractTopLevelJsonObjects(t.slice(mm.index + mm[0].length - 1));
|
|
243
245
|
if (objs.length) {
|
|
244
246
|
const args = safeJsonParse(objs[0], null);
|
|
245
247
|
if (args && typeof args === 'object' && !Array.isArray(args))
|
|
@@ -293,7 +295,7 @@ export function stripInlineToolCalls(text) {
|
|
|
293
295
|
s = s.replace(/AskUserQuestion[\s\S]*?\[[^\]]*\]\s*/gi, '');
|
|
294
296
|
// ToolName {…} biçimi (Bash {"command":...}) — adı + ardından gelen dengeli {…} bloğunu sil.
|
|
295
297
|
{
|
|
296
|
-
const re = new RegExp('(' + _TOOLS + ')\\s*\\{', 'g');
|
|
298
|
+
const re = new RegExp('(' + _TOOLS + ')\\s*[,:]?\\s*\\{', 'g');
|
|
297
299
|
let mm;
|
|
298
300
|
const spans = [];
|
|
299
301
|
while ((mm = re.exec(s)) !== null) {
|
package/dist/theme.js
CHANGED
package/dist/tui.js
CHANGED
|
@@ -394,8 +394,13 @@ export async function runTui() {
|
|
|
394
394
|
if (toolCalls.length)
|
|
395
395
|
am.tool_calls = toolCalls.map((t) => ({ id: t.id, type: 'function', function: { name: t.name, arguments: t.args || '{}' } }));
|
|
396
396
|
history.push(am);
|
|
397
|
-
if (answer)
|
|
398
|
-
lastAnswer = answer;
|
|
397
|
+
if (answer) {
|
|
398
|
+
lastAnswer = answer;
|
|
399
|
+
// RESIZE FIX: gösterim akışta stdout'a yapıldı ama displayItems'a da KAYDET ki resize/redraw
|
|
400
|
+
// sonrası cevap kaybolmasın. printItem YOK (stdout'a tekrar yazmaz → akışta duplikasyon olmaz),
|
|
401
|
+
// sadece diziye ekle → redrawAll() onu geri çizebilir.
|
|
402
|
+
displayItems.push({ kind: 'assistant', text: answer });
|
|
403
|
+
}
|
|
399
404
|
if (!toolCalls.length)
|
|
400
405
|
break;
|
|
401
406
|
// takılma koruması: aynı araç-çağrısı 3 kez üst üste → dur
|