MCPcopy Create free account
hub / github.com/Waishnav/devspace / findAvailableAgentsFiles

Method findAvailableAgentsFiles

src/workspaces.ts:257–273  ·  view source on GitHub ↗
(
    root: string,
    loadedFiles: LoadedAgentsFile[],
  )

Source from the content-addressed store, hash-verified

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
276const CONTEXT_FILE_NAMES = new Set(["AGENTS.md", "AGENTS.MD", "CLAUDE.md", "CLAUDE.MD"]);

Callers 1

Calls 1

walkWorkspaceFunction · 0.85

Tested by

no test coverage detected