(args: z.infer<typeof ArgsSchema>, ctx: ToolContext)
| 23 | argsSchema = ArgsSchema; |
| 24 | |
| 25 | async execute(args: z.infer<typeof ArgsSchema>, ctx: ToolContext): Promise<ToolResult> { |
| 26 | const target = args.path |
| 27 | ? (path.isAbsolute(args.path) ? args.path : path.resolve(ctx.cwd, args.path)) |
| 28 | : ctx.cwd; |
| 29 | const maxResults = args.max_results ?? 100; |
| 30 | const outputMode = args.output_mode ?? 'content'; |
| 31 | |
| 32 | if (await hasRipgrep()) { |
| 33 | return await this.runRipgrep(args, target, maxResults, outputMode, ctx); |
| 34 | } |
| 35 | return await this.runNative(args, target, maxResults, outputMode); |
| 36 | } |
| 37 | |
| 38 | private async runRipgrep( |
| 39 | args: z.infer<typeof ArgsSchema>, |
nothing calls this directly
no test coverage detected