(input, { abortController, getAppState, globLimits })
| 152 | return filenames.join('\n') |
| 153 | }, |
| 154 | async call(input, { abortController, getAppState, globLimits }) { |
| 155 | const start = Date.now() |
| 156 | const appState = getAppState() |
| 157 | const limit = globLimits?.maxResults ?? 100 |
| 158 | const { files, truncated } = await glob( |
| 159 | input.pattern, |
| 160 | GlobTool.getPath(input), |
| 161 | { limit, offset: 0 }, |
| 162 | abortController.signal, |
| 163 | appState.toolPermissionContext, |
| 164 | ) |
| 165 | // Relativize paths under cwd to save tokens (same as GrepTool) |
| 166 | const filenames = files.map(toRelativePath) |
| 167 | const output: Output = { |
| 168 | filenames, |
| 169 | durationMs: Date.now() - start, |
| 170 | numFiles: filenames.length, |
| 171 | truncated, |
| 172 | } |
| 173 | return { |
| 174 | data: output, |
| 175 | } |
| 176 | }, |
| 177 | mapToolResultToToolResultBlockParam(output, toolUseID) { |
| 178 | if (output.filenames.length === 0) { |
| 179 | return { |
nothing calls this directly
no test coverage detected