Commit Graph

3 Commits

Author SHA1 Message Date
Mitul Shah 3d784a5edb Content negation for cookbook route (#1752)
* cookbook md

* Update proxy.ts
2026-04-15 18:55:33 -04:00
Rich Haines bfb1a60040 Add AI agent detection and automatic markdown rewrites (#1532)
* Add AI agent detection and automatic markdown rewrites

When AI agents (Claude, ChatGPT, Cursor, etc.) request docs pages,
the proxy now detects them and transparently rewrites to the markdown
route — matching the geistdocs template default.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix: Missing import for `isAIAgent` in `docs/proxy.ts` causes a ReferenceError at runtime when the AI agent detection code path is reached.

This commit fixes the issue reported at docs/proxy.ts:68

**Bug explanation:**

In `docs/proxy.ts`, the function `isAIAgent` is called on line 68 (`const agentResult = isAIAgent(request)`) within the AI agent detection block (lines 63-87). However, this function was never imported into the file. The function is defined and exported in `docs/lib/ai-agent-detection.ts`, but the import statement was omitted when the AI agent detection feature was added to `proxy.ts`.

This would cause a `ReferenceError: isAIAgent is not defined` at runtime whenever a request matches the condition on lines 64-67 (any request to `/docs` or `/docs/*` that doesn't include `/llms.mdx/`). This is a critical path — every docs page request would hit this code.

**Fix explanation:**

Added the missing import statement: `import { isAIAgent } from '@/lib/ai-agent-detection';` at line 10 of `proxy.ts`, after the existing imports. This correctly resolves the `isAIAgent` reference to the exported function in `docs/lib/ai-agent-detection.ts`.

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: molebox <hello@richardhaines.dev>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
2026-03-27 11:20:44 -07:00
Hayden Bleasel 2cc8c3dc9c Update docs (#1010)
* Run update script

* Update deps

* Restore code block modifications

* Reapply navbar patch

* Restore custom proxy config

* Add md-metadata

* Add new frontmatter
2026-02-12 19:27:52 +00:00