# RepoMap

**Kind:** Class

**Source:** [`atloria-monorepo/libs/agent-core/src/context/repo-map.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/agent-core/src/context/repo-map.ts#L106)

## Methods

| Method | Signature | Returns |
|---|---|---|
| `generate` | `generate(focusQuery: string, recentFiles: string[])` | `Promise<RepoMapResult>` |
| `invalidate` | `invalidate(files: string[])` | `void` |
| `clearCache` | `clearCache()` | `void` |

## Where it refuses work

- `RepoMap` stops the work with an early return when `results.length >= this.config.maxFiles`, in 2 places.
- `RepoMap` stops the work with an early return when `a.def.exported !== b.def.exported`.
- `RepoMap` stops the work with an early return when `b.score !== a.score`.
- `RepoMap` stops the work with an early return when `cached && cached.mtime === mtime`.
- `RepoMap` stops the work with an early return when `content.length > 200_000`.
- `RepoMap` stops the work with an early return when `n === 0`.

## When something fails

- `RepoMap` handles failure in 3 places: it turns it into a return value in all 3.
