(
root: string,
loadedFiles: LoadedAgentsFile[],
)
| 255 | } |
| 256 | |
| 257 | private async findAvailableAgentsFiles( |
| 258 | root: string, |
| 259 | loadedFiles: LoadedAgentsFile[], |
| 260 | ): Promise<AvailableAgentsFile[]> { |
| 261 | const loadedPaths = new Set(loadedFiles.map((file) => resolve(file.path))); |
| 262 | const discovered: AvailableAgentsFile[] = []; |
| 263 | |
| 264 | await walkWorkspace(root, async (path, entry) => { |
| 265 | if (!entry.isFile()) return; |
| 266 | if (!CONTEXT_FILE_NAMES.has(entry.name)) return; |
| 267 | if (loadedPaths.has(path)) return; |
| 268 | |
| 269 | discovered.push({ path }); |
| 270 | }); |
| 271 | |
| 272 | return discovered.sort((a, b) => a.path.localeCompare(b.path)); |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | const CONTEXT_FILE_NAMES = new Set(["AGENTS.md", "AGENTS.MD", "CLAUDE.md", "CLAUDE.MD"]); |
no test coverage detected