Repository navigation
feat(tools): add list_repos MCP tool - #52
Merged
Merged
Conversation
There was no way to discover which repos have stored memories. Add a list_repos tool: a thin wrapper over a new listRepos() lib function that groups memories by canonical repo key and returns per-repo live / superseded / pinned counts plus the last-updated date, ordered by live count. Memories are already stored under canonical keys, so grouping by repo yields canonical keys directly. Logic lives in src/lib/repo.ts per the thin-tools convention; the tool just formats the result. Covered by tests for empty db, ordering, the live/superseded split, and that pinned only counts live memories.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #34.
Problem
There was no way for an agent or user to discover which repos Fossel has memories for, or how many. For people using Fossel across many projects, that is a visibility gap.
Fix
A new
list_reposMCP tool backed by alistRepos()function insrc/lib/repo.ts(logic in lib, thin tool, per AGENTS.md). It groups memories byrepoand returns per-repo counts:valid_to IS NULL)Ordered by live count descending, then repo key for a stable tie-break. Memories are always written under their canonical repo key (aliases are resolved on write and merged by
mergeRepoKeys), so grouping byrepoyields canonical keys - no extra alias resolution needed.Example output:
Tests
tests/list-repos.test.ts: empty db, per-repo counts and ordering, the live/superseded split, and thatpinnedonly counts live memories (a pinned-then-superseded memory counts as superseded, not pinned).Verification
npm run typecheckclean; full suite 256/256 pass;npm run smokepasses;npm run buildsucceeds.