diff --git a/src/core/tools/__tests__/newTaskTool.test.ts b/src/core/tools/__tests__/newTaskTool.test.ts index dc190cdd30..192b7fe8ba 100644 --- a/src/core/tools/__tests__/newTaskTool.test.ts +++ b/src/core/tools/__tests__/newTaskTool.test.ts @@ -65,9 +65,9 @@ describe("newTaskTool", () => { }) it("should correctly un-escape \\\\@ to \\@ in the message passed to the new task", async () => { - const block: ToolDirective = { - type: "tool_use", // Add required 'type' property - name: "new_task", // Correct property name + const block: NewTaskToolDirective = { + type: "tool_use", + name: "new_task", params: { mode: "code", message: "Review this: \\\\@file1.txt and also \\\\\\\\@file2.txt", // Input with \\@ and \\\\@ @@ -77,7 +77,7 @@ describe("newTaskTool", () => { await newTaskTool( mockCline as any, // Use 'as any' for simplicity in mocking complex type - block as NewTaskToolDirective, + block, mockAskApproval, // Now correctly typed mockHandleError, mockPushToolResult, @@ -102,9 +102,9 @@ describe("newTaskTool", () => { }) it("should not un-escape single escaped \@", async () => { - const block: ToolDirective = { - type: "tool_use", // Add required 'type' property - name: "new_task", // Correct property name + const block: NewTaskToolDirective = { + type: "tool_use", + name: "new_task", params: { mode: "code", message: "This is already unescaped: \\@file1.txt", @@ -114,7 +114,7 @@ describe("newTaskTool", () => { await newTaskTool( mockCline as any, - block as NewTaskToolDirective, + block, mockAskApproval, // Now correctly typed mockHandleError, mockPushToolResult, @@ -129,9 +129,9 @@ describe("newTaskTool", () => { }) it("should not un-escape non-escaped @", async () => { - const block: ToolDirective = { - type: "tool_use", // Add required 'type' property - name: "new_task", // Correct property name + const block: NewTaskToolDirective = { + type: "tool_use", + name: "new_task", params: { mode: "code", message: "A normal mention @file1.txt", @@ -141,7 +141,7 @@ describe("newTaskTool", () => { await newTaskTool( mockCline as any, - block as NewTaskToolDirective, + block, mockAskApproval, // Now correctly typed mockHandleError, mockPushToolResult, @@ -156,9 +156,9 @@ describe("newTaskTool", () => { }) it("should handle mixed escaping scenarios", async () => { - const block: ToolDirective = { - type: "tool_use", // Add required 'type' property - name: "new_task", // Correct property name + const block: NewTaskToolDirective = { + type: "tool_use", + name: "new_task", params: { mode: "code", message: "Mix: @file0.txt, \\@file1.txt, \\\\@file2.txt, \\\\\\\\@file3.txt", @@ -168,7 +168,7 @@ describe("newTaskTool", () => { await newTaskTool( mockCline as any, - block as NewTaskToolDirective, + block, mockAskApproval, // Now correctly typed mockHandleError, mockPushToolResult,