wormclaude 1.0.130 → 1.0.131
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 +20 -7
- package/dist/theme.js +1 -1
- package/package.json +1 -1
package/dist/inlinetools.js
CHANGED
|
@@ -206,16 +206,29 @@ export function recoverInlineToolCalls(text) {
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
// 4) AskUserQuestion'ı JSON yerine DÜZ-METİN (prose) yazan model (abliterated):
|
|
209
|
-
// AskUserQuestion question "X" with options [A · B · C]
|
|
209
|
+
// AskUserQuestion question "X" with options ["A","B"] | [A · B · C] → gerçek çağrıya çevir.
|
|
210
210
|
if (!out.length && /AskUserQuestion/i.test(t)) {
|
|
211
|
-
const m = t.match(/AskUserQuestion[\s\S]*?["“]([^"”]{3,}?)["”][\s\S]
|
|
211
|
+
const m = t.match(/AskUserQuestion[\s\S]*?["“]([^"”]{3,}?)["”][\s\S]*?(\[[\s\S]*?\])/i);
|
|
212
212
|
if (m) {
|
|
213
213
|
const question = m[1].trim();
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
214
|
+
let options = [];
|
|
215
|
+
// Önce gerçek JSON array dene (model çoğunlukla ["A","B/C","D"] yazıyor → "/" ile BÖLME).
|
|
216
|
+
const arr = safeJsonParse(m[2], null);
|
|
217
|
+
if (Array.isArray(arr)) {
|
|
218
|
+
options = arr
|
|
219
|
+
.map((x) => (typeof x === 'string' ? x.trim() : (x && (x.label || x.value || x.text) ? String(x.label || x.value || x.text).trim() : '')))
|
|
220
|
+
.filter(Boolean)
|
|
221
|
+
.map((label) => ({ label }));
|
|
222
|
+
}
|
|
223
|
+
// JSON değilse ayraçla böl ("·•|," ve 2+ boşluk — "/" YOK, "İşletme/Teknoloji" bölünmesin).
|
|
224
|
+
if (options.length < 2) {
|
|
225
|
+
options = m[2]
|
|
226
|
+
.replace(/^\[|\]$/g, '')
|
|
227
|
+
.split(/\s*[·•|,]\s*|\s{2,}/)
|
|
228
|
+
.map((s) => s.trim().replace(/^["'“]|["'”]$/g, ''))
|
|
229
|
+
.filter(Boolean)
|
|
230
|
+
.map((label) => ({ label }));
|
|
231
|
+
}
|
|
219
232
|
if (options.length >= 2)
|
|
220
233
|
push({ name: 'AskUserQuestion', arguments: { question, options } });
|
|
221
234
|
}
|
package/dist/theme.js
CHANGED