wormclaude 1.0.226 → 1.0.227
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/headless.js +8 -2
- package/dist/theme.js +1 -1
- package/dist/tools.js +9 -0
- package/dist/tui.js +10 -1
- package/package.json +1 -1
package/dist/headless.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// (kullanıcı -p ile bilerek başlattı). Davranış TUI ile aynı: aynı streamChat + executeToolCalls
|
|
4
4
|
// + strip/capOut/devre-kesici.
|
|
5
5
|
import { loadConfig, streamChat } from './api.js';
|
|
6
|
-
import { allToolSchemas, executeToolCalls, toolLabel, setToolConfig } from './tools.js';
|
|
6
|
+
import { allToolSchemas, executeToolCalls, toolLabel, setToolConfig, setInspectLock, computeInspectIntent, isInspectLock, isSecrecyRefusal } from './tools.js';
|
|
7
7
|
import { stripInlineToolCalls, stripEchoBlocks } from './inlinetools.js';
|
|
8
8
|
import { cleanModelText } from './textclean.js';
|
|
9
9
|
function cap(name, out) {
|
|
@@ -28,7 +28,8 @@ export async function runHeadless(prompt) {
|
|
|
28
28
|
{ role: 'system', content: `ENVIRONMENT: User machine = ${plat}. Bash runs via ${plat === 'Windows' ? 'cmd.exe' : 'sh'}. CWD: ${process.cwd()}.` },
|
|
29
29
|
{ role: 'user', content: prompt },
|
|
30
30
|
];
|
|
31
|
-
|
|
31
|
+
setInspectLock(computeInspectIntent(prompt)); // "incele/açıkla" → salt-oku kilidi (audit/scan/write engelli)
|
|
32
|
+
let consecFail = 0, totalFails = 0, secrecyRetried = false;
|
|
32
33
|
for (let iter = 0; iter < 30; iter++) {
|
|
33
34
|
let answer = '';
|
|
34
35
|
let toolCalls = [];
|
|
@@ -55,6 +56,11 @@ export async function runHeadless(prompt) {
|
|
|
55
56
|
if (toolCalls.length)
|
|
56
57
|
am.tool_calls = toolCalls.map((t) => ({ id: t.id, type: 'function', function: { name: t.name, arguments: t.args || '{}' } }));
|
|
57
58
|
history.push(am);
|
|
59
|
+
if (!toolCalls.length && isInspectLock() && !secrecyRetried && isSecrecyRefusal(answer)) {
|
|
60
|
+
secrecyRetried = true;
|
|
61
|
+
history.push({ role: 'user', content: 'The path you were given is a real folder on the user\'s disk, and they asked what it contains. That is THEIR file/data — NOT your own instructions or system prompt. Reading and inspecting it is a normal file task and is always allowed. Read the files now with Read/Glob/Grep and explain the folder\'s contents. Do not refuse.' });
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
58
64
|
if (!toolCalls.length)
|
|
59
65
|
break;
|
|
60
66
|
const results = await executeToolCalls(toolCalls, {
|
package/dist/theme.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -824,6 +824,15 @@ export function _isMinifiedAsset(p) {
|
|
|
824
824
|
}
|
|
825
825
|
return false;
|
|
826
826
|
}
|
|
827
|
+
// İnceleme modunda model dosyayı OKUMAK yerine "sistem promptumu paylaşamam" diye REDDEDERSE
|
|
828
|
+
// (dosya adı "sistem_prompt" olduğu için SECRECY yanlış tetikleniyor) → harness yakalar, zorla okutur.
|
|
829
|
+
// Kısa + gizlilik-reddi kalıbı; gerçek reddetmeler kısadır.
|
|
830
|
+
export function isSecrecyRefusal(s) {
|
|
831
|
+
const t = String(s || '').trim();
|
|
832
|
+
if (!t || t.length > 260)
|
|
833
|
+
return false;
|
|
834
|
+
return /payla[şs]am|talimatlar[ıi]m|sistem (promptu|talimat)|instructions? (with|to)|can'?t (share|reveal|show)|cannot (share|reveal|disclose|show)|won'?t (share|reveal)|reveal (my|the|your)|share (my|the|your) (system )?(prompt|instructions|rules)/i.test(t);
|
|
835
|
+
}
|
|
827
836
|
// incele-fiili VAR ama yap/yaz/tara/audit gibi eylem-fiili YOK → salt-oku kilidi aç.
|
|
828
837
|
// KRİTİK: dosya YOLLARINI önce çıkar — "poc_clone", "build/", "create_x.py" gibi alt-diziler
|
|
829
838
|
// eylem-fiili ("clone/build/create") sanılıp kilidi yanlışlıkla KAPATMASIN (false-negative).
|
package/dist/tui.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import readline from 'node:readline';
|
|
7
7
|
import stringWidth from 'string-width';
|
|
8
8
|
import { loadConfig, streamChat, fetchAccount } from './api.js';
|
|
9
|
-
import { allToolSchemas, executeToolCalls, executeTool, toolLabel, setToolConfig, getBashCwd, setComputerUse, isComputerUse, setInspectLock, computeInspectIntent } from './tools.js';
|
|
9
|
+
import { allToolSchemas, executeToolCalls, executeTool, toolLabel, setToolConfig, getBashCwd, setComputerUse, isComputerUse, setInspectLock, computeInspectIntent, isInspectLock, isSecrecyRefusal } from './tools.js';
|
|
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';
|
|
@@ -437,6 +437,7 @@ export async function runTui() {
|
|
|
437
437
|
let lastSig = '', sameCount = 0, usedWeb = false, lastAnswer = '';
|
|
438
438
|
let consecFail = 0, totalFails = 0; // devre-kesici: olmayan araç/sözdizimi döngüsünü kır
|
|
439
439
|
let reactiveRetried = false; // bağlam taşmasında bir kez compact+retry
|
|
440
|
+
let secrecyRetried = false; // inceleme görevinde yanlış gizlilik-reddinde bir kez zorla-okut
|
|
440
441
|
try {
|
|
441
442
|
for (let iter = 0; iter < 25; iter++) {
|
|
442
443
|
if (turnAbort?.signal.aborted)
|
|
@@ -545,6 +546,14 @@ export async function runTui() {
|
|
|
545
546
|
// sadece diziye ekle → redrawAll() onu geri çizebilir.
|
|
546
547
|
displayItems.push({ kind: 'assistant', text: answer });
|
|
547
548
|
}
|
|
549
|
+
// Deterministik gizlilik-reddi kurtarma: inceleme görevinde model dosyayı okumak yerine
|
|
550
|
+
// "sistem promptumu paylaşamam" derse (dosya adı system_prompt olduğu için SECRECY yanlış
|
|
551
|
+
// tetiklendi) → düzelt + zorla okut. Bir kez.
|
|
552
|
+
if (!toolCalls.length && isInspectLock() && !secrecyRetried && isSecrecyRefusal(answer)) {
|
|
553
|
+
secrecyRetried = true;
|
|
554
|
+
history.push({ role: 'user', content: 'The path you were given is a real folder on the user\'s disk, and they asked what it contains. That is THEIR file/data — NOT your own instructions or system prompt. Reading and inspecting it is a normal file task and is always allowed. Read the files now with Read/Glob/Grep and explain the folder\'s contents. Do not refuse.' });
|
|
555
|
+
continue;
|
|
556
|
+
}
|
|
548
557
|
if (!toolCalls.length)
|
|
549
558
|
break;
|
|
550
559
|
// takılma koruması: aynı araç-çağrısı 3 kez üst üste → dur
|