fix(hub): include Edit in default single-agent tools

Merge pull request #34 from fix/hub-include-edit-tool
This commit is contained in:
2026-07-25 14:19:04 +08:00
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -1,6 +1,7 @@
export const DEFAULT_CLAUDE_BUILT_IN_TOOLS = [ export const DEFAULT_CLAUDE_BUILT_IN_TOOLS = [
"Read", "Read",
"Write", "Write",
"Edit",
"Bash", "Bash",
"Glob", "Glob",
"Grep", "Grep",
@@ -31,7 +32,7 @@ export interface ClaudeSdkToolConfig {
const ROLE_TOOL_TO_CLAUDE_BUILT_INS: Readonly<Record<string, readonly string[]>> = { const ROLE_TOOL_TO_CLAUDE_BUILT_INS: Readonly<Record<string, readonly string[]>> = {
read_file: ["Read"], read_file: ["Read"],
write_file: ["Write"], write_file: ["Write", "Edit"],
list_files: ["Glob"], list_files: ["Glob"],
search_files: ["Grep"], search_files: ["Grep"],
bash: ["Bash"], bash: ["Bash"],
@@ -46,6 +47,7 @@ const ROLE_TOOL_TO_CLAUDE_BUILT_INS: Readonly<Record<string, readonly string[]>>
TodoWrite: ["TodoWrite"], TodoWrite: ["TodoWrite"],
Read: ["Read"], Read: ["Read"],
Write: ["Write"], Write: ["Write"],
Edit: ["Edit"],
Bash: ["Bash"], Bash: ["Bash"],
Glob: ["Glob"], Glob: ["Glob"],
Grep: ["Grep"], Grep: ["Grep"],
+2 -1
View File
@@ -114,7 +114,7 @@ describe("runAgent", () => {
allowDangerouslySkipPermissions: true, allowDangerouslySkipPermissions: true,
settingSources: [], settingSources: [],
settings: { disableBundledSkills: true, todoFeatureEnabled: true }, settings: { disableBundledSkills: true, todoFeatureEnabled: true },
tools: expect.arrayContaining(["Read", "Write", "Bash", "Glob", "Grep", "TodoWrite"]), tools: expect.arrayContaining(["Read", "Write", "Edit", "Bash", "Glob", "Grep", "TodoWrite"]),
allowedTools: expect.arrayContaining(["TodoWrite", "mcp__cph_hub__todo_write"]), allowedTools: expect.arrayContaining(["TodoWrite", "mcp__cph_hub__todo_write"]),
disallowedTools: expect.arrayContaining(["Agent", "SendMessage", "Task", "TeamCreate", "ScheduleWakeup"]), disallowedTools: expect.arrayContaining(["Agent", "SendMessage", "Task", "TeamCreate", "ScheduleWakeup"]),
sandbox: expect.objectContaining({ sandbox: expect.objectContaining({
@@ -151,6 +151,7 @@ describe("runAgent", () => {
expect(call?.options?.tools).toEqual([ expect(call?.options?.tools).toEqual([
"Read", "Read",
"Write", "Write",
"Edit",
"Bash", "Bash",
"Glob", "Glob",
"Grep", "Grep",