Skip to content

fix(tools): fetch documentation from base/docs with candidate path resolution - #12

Open
Lesnak1 wants to merge 1 commit into
base:masterfrom
Lesnak1:fix/docs-raw-url-and-candidate-resolution
Open

fix(tools): fetch documentation from base/docs with candidate path resolution#12
Lesnak1 wants to merge 1 commit into
base:masterfrom
Lesnak1:fix/docs-raw-url-and-candidate-resolution

Conversation

@Lesnak1

@Lesnak1 Lesnak1 commented Aug 15, 2026

Copy link
Copy Markdown

Summary

The getGuide tool in tools.ts previously attempted to fetch documentation markdown from the deprecated base/web repository (https://raw.githubusercontent.com/base/web/refs/heads/master/apps/base-docs/docs/pages...), which returns 404 Not Found for all guide requests.

This PR updates the raw documentation source to target the official active base/docs repository with robust candidate extension resolution (.mdx, .md, and /index.*).

Changes

  • tools.ts:
    • Target https://raw.githubusercontent.com/base/docs/master/docs/.
    • Normalize incoming guideLink (strip base URL, leading/trailing slashes, and explicit extensions).
    • Iterate through candidate file paths (.mdx, .md, /index.mdx, /index.md) to resolve documentation files reliably.
  • utils.ts:
    • Update example guide link in findGuideParamsPrompt to point to current Base Account documentation (/base-account/guides/sign-and-verify-typed-data).
  • sidebar.ts:
    • Gracefully handle sidebar content initialization without failing on the deprecated base/web URL.

Verification

  • Tested fetching full URLs (e.g. https://docs.base.org/agents/guides/batch-calls).
  • Tested relative paths (e.g. /get-started/get-funded).
  • Tested explicit .mdx paths and verified invalid paths return a clean error response without throwing.
  • Confirmed TypeScript builds cleanly (npx tsc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant