(
name: string,
displayName: string,
canUpdateOutput = false,
shouldConfirm = false,
isOutputMarkdown = false,
)
| 94 | |
| 95 | class MockTool extends BaseDeclarativeTool<object, ToolResult> { |
| 96 | constructor( |
| 97 | name: string, |
| 98 | displayName: string, |
| 99 | canUpdateOutput = false, |
| 100 | shouldConfirm = false, |
| 101 | isOutputMarkdown = false, |
| 102 | ) { |
| 103 | super( |
| 104 | name, |
| 105 | displayName, |
| 106 | 'A mock tool for testing', |
| 107 | Kind.Other, |
| 108 | {}, |
| 109 | isOutputMarkdown, |
| 110 | canUpdateOutput, |
| 111 | ); |
| 112 | if (shouldConfirm) { |
| 113 | this.shouldConfirmExecute.mockImplementation( |
| 114 | async (): Promise<ToolCallConfirmationDetails | false> => ({ |
| 115 | type: 'edit', |
| 116 | title: 'Mock Tool Requires Confirmation', |
| 117 | onConfirm: mockOnUserConfirmForToolConfirmation, |
| 118 | filePath: 'mock', |
| 119 | fileName: 'mockToolRequiresConfirmation.ts', |
| 120 | fileDiff: 'Mock tool requires confirmation', |
| 121 | originalContent: 'Original content', |
| 122 | newContent: 'New content', |
| 123 | }), |
| 124 | ); |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | execute = vi.fn(); |
| 129 | shouldConfirmExecute = vi.fn(); |
nothing calls this directly
no outgoing calls
no test coverage detected