evot-agent 0.5.2 → 0.5.4
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/package.json +1 -1
- package/src/backends/claude.js +26 -0
- package/src/backends/common.js +6 -1
package/package.json
CHANGED
package/src/backends/claude.js
CHANGED
|
@@ -64,6 +64,32 @@ export async function runClaudeJob(job) {
|
|
|
64
64
|
strictMcpConfig: true,
|
|
65
65
|
// MCP 툴은 프롬프트 없이 실행되도록 자동 승인 유지.
|
|
66
66
|
allowedTools: ["mcp__playwright"],
|
|
67
|
+
// 두 번째 겹: Playwright 외 툴 호출은 hook에서 거부한다. disallowedTools는 이름 목록이라
|
|
68
|
+
// SDK가 새 내장 툴(REPL·Monitor·Workflow 등)을 추가하면 그대로 뚫리고, bypassPermissions라
|
|
69
|
+
// 확인 없이 실행된다. hook은 permissionMode와 무관하게 돌고 툴 목록은 건드리지 않으므로
|
|
70
|
+
// tools:[] 때처럼 Playwright가 사라지는 회귀는 없다(허용 접두어는 allowedTools와 동일).
|
|
71
|
+
hooks: {
|
|
72
|
+
PreToolUse: [
|
|
73
|
+
{
|
|
74
|
+
hooks: [
|
|
75
|
+
async (input) => {
|
|
76
|
+
const name = typeof input?.tool_name === "string" ? input.tool_name : "";
|
|
77
|
+
if (name.startsWith("mcp__playwright__")) return { continue: true };
|
|
78
|
+
console.warn(`[evot-agent] blocked tool call: ${name || "(unknown)"}`);
|
|
79
|
+
return {
|
|
80
|
+
continue: true,
|
|
81
|
+
hookSpecificOutput: {
|
|
82
|
+
hookEventName: "PreToolUse",
|
|
83
|
+
permissionDecision: "deny",
|
|
84
|
+
permissionDecisionReason:
|
|
85
|
+
"evot-agent: only Playwright browser tools are allowed",
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
67
93
|
},
|
|
68
94
|
})) {
|
|
69
95
|
if (message.type === "assistant") {
|
package/src/backends/common.js
CHANGED
|
@@ -51,7 +51,12 @@ export const SYSTEM_APPEND = [
|
|
|
51
51
|
" each section is its description text followed by its image lines, each",
|
|
52
52
|
" exactly 'IMAGE: <url>' with a direct image URL you actually saw",
|
|
53
53
|
" (e.g. a pbs.twimg.com link or a URL ending in .jpg/.png). Max 10 images total.",
|
|
54
|
-
"-
|
|
54
|
+
"- Cite sources like an academic paper. Put [[src:N]] immediately after the claim it",
|
|
55
|
+
" supports, where N is that URL's 1-based number in the Sources list below. Reuse the",
|
|
56
|
+
" same N for the same URL, and only cite pages you actually opened.",
|
|
57
|
+
"- End with a 'Sources:' section listing each URL on its own line as '[N] <url>',",
|
|
58
|
+
" numbered from 1 in the order first cited. Every N you used inline must appear here,",
|
|
59
|
+
" and every listed URL must be one you actually visited.",
|
|
55
60
|
"Do not include tool logs or meta commentary in the final answer.",
|
|
56
61
|
].join("\n");
|
|
57
62
|
|