(args: { file_path: string }, context: ToolContext)
| 33 | required: ['file_path'] |
| 34 | }, |
| 35 | async execute(args: { file_path: string }, context: ToolContext): Promise<ToolResult> { |
| 36 | try { |
| 37 | const filePath = resolveWorkspacePath(context.workingDirectory, args.file_path); |
| 38 | const content = await readFile(filePath, 'utf-8'); |
| 39 | return { |
| 40 | success: true, |
| 41 | data: { content, path: args.file_path } |
| 42 | }; |
| 43 | } catch (error) { |
| 44 | return { |
| 45 | success: false, |
| 46 | error: error instanceof Error ? error.message : String(error) |
| 47 | }; |
| 48 | } |
| 49 | } |
| 50 | }; |
| 51 | |
| 52 | export const writeTool: Tool = { |
nothing calls this directly
no test coverage detected