wormclaude 1.0.83 → 1.0.84
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 +7 -6
- package/dist/subagents.js +22 -0
- package/dist/theme.js +1 -1
- package/dist/tools.js +3 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -20,6 +20,7 @@ import { linkify } from './links.js';
|
|
|
20
20
|
import { recordLearned } from './learn.js';
|
|
21
21
|
import { loadSkills, getSkills, getSkill, buildSkillPrompt } from './skills.js';
|
|
22
22
|
import { loadExtensions, getExtCommands, getExtCommand, buildExtCommandPrompt } from './extensions.js';
|
|
23
|
+
import { platformNote } from './subagents.js';
|
|
23
24
|
import { COMMANDS, runSlashCommand } from './commands.js';
|
|
24
25
|
import { tasks } from './tasks.js';
|
|
25
26
|
import { connectMcpServers } from './mcp.js';
|
|
@@ -123,12 +124,12 @@ loadExtensions(); // extensions/<ad>/ (gömülü + kullanıcı + proje) yükle
|
|
|
123
124
|
// Kalıcı hafıza: açılışta .wormclaude/memory.md + WORMCLAUDE.md'yi context'e yükle
|
|
124
125
|
const _memCtx = loadMemoryContext();
|
|
125
126
|
const _envContext = () => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
const
|
|
129
|
-
? '
|
|
130
|
-
: '
|
|
131
|
-
return
|
|
127
|
+
// Platform + kabuk kuralları paylaşılan kaynaktan (subagents.platformNote) — ana ajan
|
|
128
|
+
// ve alt-ajanlar AYNI Windows tırnak/araç kurallarını görür.
|
|
129
|
+
const extra = process.platform === 'win32'
|
|
130
|
+
? '\n- AVOID interactive scaffolders that hang (create-react-app); prefer Vite: npm create vite@latest myapp -- --template react.'
|
|
131
|
+
: '';
|
|
132
|
+
return platformNote() + extra;
|
|
132
133
|
};
|
|
133
134
|
const _initHistory = () => {
|
|
134
135
|
const sys = [{ role: 'system', content: _envContext() }];
|
package/dist/subagents.js
CHANGED
|
@@ -4,6 +4,28 @@
|
|
|
4
4
|
import * as fs from 'node:fs';
|
|
5
5
|
import * as os from 'node:os';
|
|
6
6
|
import * as path from 'node:path';
|
|
7
|
+
/**
|
|
8
|
+
* Çalışma ortamı + kabuk kuralları — hem ana ajana hem ALT-ajanlara verilir.
|
|
9
|
+
* Windows'ta cmd.exe tırnak kuralları kritik: yanlış tırnak sessizce "Sistem
|
|
10
|
+
* belirtilen dosyayı bulamıyor" / "URL rejected" ile patlar (curl 'url' başarısız).
|
|
11
|
+
*/
|
|
12
|
+
export function platformNote() {
|
|
13
|
+
const isWin = process.platform === 'win32';
|
|
14
|
+
const plat = isWin ? 'Windows' : process.platform === 'darwin' ? 'macOS' : 'Linux';
|
|
15
|
+
const cwd = process.cwd();
|
|
16
|
+
if (isWin) {
|
|
17
|
+
return [
|
|
18
|
+
`ENVIRONMENT: User machine = Windows. The Bash tool runs commands via cmd.exe (NOT a Unix shell). CWD: ${cwd}.`,
|
|
19
|
+
'WINDOWS SHELL RULES (critical — wrong quoting fails with "Sistem belirtilen dosyayı bulamıyor" or "URL rejected"):',
|
|
20
|
+
'- Use DOUBLE quotes only. SINGLE quotes do NOT work in cmd.exe — `curl \'http://x\'` FAILS.',
|
|
21
|
+
'- The characters < > & | ^ ( ) are special in cmd.exe; ANY argument or URL containing them MUST be wrapped in double quotes. Correct: curl "https://site/path?q=<script>alert(1)</script>" — never single-quoted, never unquoted.',
|
|
22
|
+
'- For fetching or probing a URL, PREFER the WebFetch tool (cross-platform, no shell quoting). Use curl.exe only when you need the RAW HTTP response (e.g. to see if an XSS payload is reflected verbatim), and ALWAYS double-quote the full URL.',
|
|
23
|
+
'- Unix/security tools are usually NOT installed (no grep/sed/awk/ls/cat/nmap/nikto/sqlmap). Use the Read/Grep/Glob tools or PowerShell (Get-Content, Select-String, Get-ChildItem). Before calling an external tool, verify it exists with `where <tool>`; if missing, use an HTTP/WebFetch-based method instead.',
|
|
24
|
+
'- && chaining works in cmd.exe. Always pass non-interactive flags (-y/--yes) to avoid hangs.',
|
|
25
|
+
].join('\n');
|
|
26
|
+
}
|
|
27
|
+
return `ENVIRONMENT: User machine = ${plat}. Bash tool shell: bash/sh (POSIX). CWD: ${cwd}. Use POSIX commands and standard quoting; double-quote URLs containing special characters.`;
|
|
28
|
+
}
|
|
7
29
|
// ── Gömülü uzman ajanlar ──────────────────────────────────────────────────────
|
|
8
30
|
const BUILTINS = [
|
|
9
31
|
{
|
package/dist/theme.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -8,7 +8,7 @@ import * as os from 'node:os';
|
|
|
8
8
|
import * as path from 'node:path';
|
|
9
9
|
import { loadConfig } from './api.js';
|
|
10
10
|
import { runAgentLoop } from './agent.js';
|
|
11
|
-
import { resolveSubagent, subagentTypesHint } from './subagents.js';
|
|
11
|
+
import { resolveSubagent, subagentTypesHint, platformNote } from './subagents.js';
|
|
12
12
|
import { saveMemoryFact } from './memory.js';
|
|
13
13
|
import { emit as emitSpan } from './telemetry.js';
|
|
14
14
|
import { tasks } from './tasks.js';
|
|
@@ -951,7 +951,7 @@ export async function executeTool(name, args) {
|
|
|
951
951
|
if (name === 'Agent') {
|
|
952
952
|
// Uzman ajan seçimi: subagent_type verilirse özel prompt + tool-kısıtı uygulanır.
|
|
953
953
|
const def = resolveSubagent(args.subagent_type);
|
|
954
|
-
const sysPrompt = def ? def.system : SUBAGENT_SYSTEM;
|
|
954
|
+
const sysPrompt = (def ? def.system : SUBAGENT_SYSTEM) + '\n\n' + platformNote();
|
|
955
955
|
const subTools = subAgentTools(def?.tools);
|
|
956
956
|
const subMessages = [
|
|
957
957
|
{ role: 'system', content: sysPrompt },
|
|
@@ -1391,7 +1391,7 @@ export async function executeTool(name, args) {
|
|
|
1391
1391
|
if (sk.tools && sk.tools.length)
|
|
1392
1392
|
tools = tools.filter((t) => sk.tools.includes(t.function.name));
|
|
1393
1393
|
const messages = [
|
|
1394
|
-
{ role: 'system', content: SUBAGENT_SYSTEM },
|
|
1394
|
+
{ role: 'system', content: SUBAGENT_SYSTEM + '\n\n' + platformNote() },
|
|
1395
1395
|
{ role: 'user', content: prompt },
|
|
1396
1396
|
];
|
|
1397
1397
|
const { finalText } = await runAgentLoop({ config: cfg(), messages, tools, executeTool });
|