Repository navigation
Conversation
Add a fetch_<repo>_wiki tool to the default repository handler. Without a page it lists the wiki pages and returns the Home page; with a page name, title or wiki URL it returns that page's Markdown from raw.githubusercontent.com, falling back to a case-insensitive match and listing the available pages when the page is not found. Requests go through the existing robots.txt check. Closes idosal#159
VOUCHAVOUCHA is currently in early access and is not enabled for this repository yet. To request access, contact @idosal. VOUCHA has not added a comprehension check to this PR. |
This branch has not been 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.
Problem
Many projects keep guides, FAQs and design notes in their GitHub wiki, which GitMCP cannot currently reach: the wiki is a separate git repository, so neither the documentation fetch nor code search sees it (#159).
Changes
fetch_<repo-name>_wikitool on the default repository handler (read-only, optionalpageparameter).page: lists the wiki pages (parsed fromgithub.com/{owner}/{repo}/wiki/_pages) and returns the Home page.page: accepts a title (Getting Started), slug (Getting-Started), file name (Getting-Started.md) or full wiki URL, and returns the page Markdown fromraw.githubusercontent.com/wiki/{owner}/{repo}/{Page}.md.fetchFileWithRobotsTxtCheck. A clear message is returned when the repository has no wiki.src/api/utils/wiki.ts, and the tool name usesenforceToolNameLengthLimitlike the other tools.Tests
New unit tests in
src/api/utils/wiki.test.tsandsrc/api/tools/wiki.test.ts. They mockfetch, so no network is used.src/api/tools/index.test.tsnow expects the new tool.pnpm test(vitest run): 9 files, 57 tests passed (37 before this change).pnpm build: succeeds.npx prettier --checkon the changed source and test files: clean.npx tsc -p tsconfig.cloudflare.json --noEmit: reports the same 8 errors asmain. They are inapp/chat/lib/user-id.ts,app/routes/_index.tsx,commonTools.ts(AutoRAG types),cache.tsandindex.ts, and this change adds none.Closes #159