@vercel/geistdocs 2.14.6 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/cli/index.js +1 -1
  2. package/dist/components/command-prompt.d.ts.map +1 -1
  3. package/dist/components/command-prompt.js +59 -61
  4. package/dist/controls.d.ts +3 -40
  5. package/dist/controls.d.ts.map +1 -1
  6. package/dist/controls.js +5 -96
  7. package/dist/internal/chat-rate-limit.d.ts +10 -0
  8. package/dist/internal/chat-rate-limit.d.ts.map +1 -0
  9. package/dist/internal/chat-rate-limit.js +35 -0
  10. package/dist/internal/command-prompt-transition.d.ts +2 -0
  11. package/dist/internal/command-prompt-transition.d.ts.map +1 -0
  12. package/dist/internal/command-prompt-transition.js +17 -0
  13. package/dist/internal/controls-client.d.ts +40 -0
  14. package/dist/internal/controls-client.d.ts.map +1 -0
  15. package/dist/internal/controls-client.js +87 -0
  16. package/dist/internal/language-selector.d.ts +2 -0
  17. package/dist/internal/language-selector.d.ts.map +1 -0
  18. package/dist/internal/language-selector.js +12 -0
  19. package/dist/internal/navbar/mobile-menu.js +1 -1
  20. package/dist/internal/page-action-options.d.ts +37 -0
  21. package/dist/internal/page-action-options.d.ts.map +1 -0
  22. package/dist/internal/page-action-options.js +39 -0
  23. package/dist/internal/page-actions-client.d.ts +1 -31
  24. package/dist/internal/page-actions-client.d.ts.map +1 -1
  25. package/dist/internal/page-actions-client.js +5 -103
  26. package/dist/internal/page-actions-gate.d.ts +3 -0
  27. package/dist/internal/page-actions-gate.d.ts.map +1 -0
  28. package/dist/internal/page-actions-gate.js +15 -0
  29. package/dist/internal/provider-client.d.ts.map +1 -1
  30. package/dist/internal/provider-client.js +26 -1
  31. package/dist/internal/relative-docs-link.d.ts +7 -0
  32. package/dist/internal/relative-docs-link.d.ts.map +1 -0
  33. package/dist/internal/relative-docs-link.js +22 -0
  34. package/dist/internal/sidebar.d.ts.map +1 -1
  35. package/dist/internal/sidebar.js +1 -1
  36. package/dist/internal/toc-actions-client.d.ts +9 -0
  37. package/dist/internal/toc-actions-client.d.ts.map +1 -0
  38. package/dist/internal/toc-actions-client.js +78 -0
  39. package/dist/mdx.d.ts.map +1 -1
  40. package/dist/mdx.js +5 -2
  41. package/dist/navbar.js +1 -1
  42. package/dist/pages/changelog.js +1 -1
  43. package/dist/pages/docs.d.ts.map +1 -1
  44. package/dist/pages/docs.js +4 -3
  45. package/dist/routes/chat.d.ts +13 -4
  46. package/dist/routes/chat.d.ts.map +1 -1
  47. package/dist/routes/chat.js +7 -3
  48. package/dist/source-config.js +1 -1
  49. package/docs/agents.md +1 -1
  50. package/docs/llms.txt +24 -16
  51. package/docs/manifest.json +1 -1
  52. package/docs/pages/agent-readiness.md +1 -1
  53. package/docs/pages/ask-ai.md +19 -14
  54. package/docs/pages/provider.md +3 -0
  55. package/package.json +2 -2
  56. package/source-config.js +1 -1
  57. package/template/AGENTS.md +1 -1
  58. package/template/content/docs/agent-readiness.mdx +1 -1
  59. package/template/content/docs/ask-ai.cn.mdx +1 -1
  60. package/template/content/docs/ask-ai.mdx +19 -14
  61. package/template/content/docs/provider.mdx +3 -0
  62. package/template/package.json +1 -2
@@ -299,7 +299,7 @@ In this mode, Geistdocs uses the local `search_docs` tool during the AI SDK `str
299
299
 
300
300
  #### Choose a model
301
301
 
302
- Pass the `model` option to `createChatRoute` to control which model answers Ask AI requests. It accepts any AI SDK `LanguageModel`, including AI Gateway model strings, and defaults to `openai/gpt-5.6-sol`.
302
+ Pass the `model` option to `createChatRoute` to control which model answers Ask AI requests. It accepts any AI SDK `LanguageModel`, including AI Gateway model strings, and defaults to `openai/gpt-6-luna` in standard mode.
303
303
 
304
304
  ```ts title="app/api/chat/route.ts"
305
305
  import { createChatRoute } from "@vercel/geistdocs/routes/chat";
@@ -682,28 +682,33 @@ export const { POST, maxDuration } = createChatRoute({
682
682
 
683
683
  In Vertex-backed proxy mode, the platform `/vertex` route also limits requests to 1,000,000 bytes and 200 messages. Increasing `maxRequestBytes` or `maxMessages` above those values does not raise the platform limits.
684
684
 
685
- Request size limits don't control how often a client can call the route. `/api/chat` is public, and every accepted request calls a model or agent on your account, so wrap the route with your own rate limiting. For example, install `@vercel/firewall`, create a [Firewall rate limit rule](https://vercel.com/docs/vercel-firewall/vercel-waf/rate-limiting-sdk) with the rate limit ID `ask-ai`, and check it before calling `POST`:
685
+ ## Rate limiting
686
+
687
+ Request size limits don't control how often a client can call the route. Opt in to Vercel Firewall with `createChatRoute({ rateLimit: { ids: ["ask-ai"] } })`. Geistdocs includes the SDK and handles checks, timeouts, and error responses; no app-level SDK dependency or `POST` wrapper is required. Upgrading alone does not enable rate limiting.
688
+
689
+ First, publish a [Firewall SDK rate limit rule](https://vercel.com/docs/vercel-firewall/vercel-waf/rate-limiting-sdk) with the ID `ask-ai` in the consumer site's Vercel project. Use the `@vercel/firewall` condition (`rate_limit_api_id`), count by `header:x-vercel-rate-limit-key` for the SDK's default per-client-IP buckets, and choose the request limit and window for your site. Start in log mode, verify enforcement in preview, then switch the exceeded-limit action to `rate_limit` in production. Installing Geistdocs does not create these project rules.
690
+
691
+ Then enable the rule in the chat route:
686
692
 
687
693
  ```ts title="app/api/chat/route.ts"
688
- import { checkRateLimit } from "@vercel/firewall";
689
694
  import { createChatRoute } from "@vercel/geistdocs/routes/chat";
690
695
  import { config } from "@/lib/geistdocs/config";
691
696
  import { geistdocsSource } from "@/lib/geistdocs/source";
692
697
 
693
- const chat = createChatRoute({ config, sources: [geistdocsSource] });
698
+ export const { POST, maxDuration } = createChatRoute({
699
+ config,
700
+ sources: [geistdocsSource],
701
+ rateLimit: { ids: ["ask-ai"] },
702
+ });
703
+ ```
694
704
 
695
- export const maxDuration = 800;
705
+ For separate burst and hourly limits, publish two rules and pass both IDs, for example `rateLimit: { ids: ["ask-ai-minute", "ask-ai-hour"] }`. Every check must pass; duplicate IDs are checked once. Empty lists and blank IDs throw at route creation.
696
706
 
697
- export const POST = async (request: Request) => {
698
- const { rateLimited } = await checkRateLimit("ask-ai", { request });
707
+ When enabled, checks run before every chat POST in AI Gateway, proxy, and eve agent modes, including prewarm requests. Prewarming and sending each count as a request, so allow for both when choosing limits. Checks run concurrently with a one-second timeout each. Limited requests receive `429`; missing rules, network failures, and timeouts receive `503` before any model, retrieval, proxy, or agent call. Both errors are uncached plain text, displayed by the chat's error toast.
699
708
 
700
- if (rateLimited) {
701
- return Response.json({ error: "Too many requests." }, { status: 429 });
702
- }
709
+ Omit `rateLimit` to keep the existing behavior without firewall calls. The SDK skips checks when `NODE_ENV` is not `production`; `next dev` needs no rules. Local `next start` needs Vercel request headers and firewall access. Protected Vercel previews require Protection Bypass for Automation and exposed system environment variables. Counters are per region, not a global spending cap.
703
710
 
704
- return chat.POST(request);
705
- };
706
- ```
711
+ If your site already wraps `POST` with these SDK checks, replace the wrapper with `rateLimit` after upgrading and keep the same published rule IDs. Remove the app's direct `@vercel/firewall` dependency only if no other route uses it. Do not keep both checks, or each request will be counted twice.
707
712
 
708
713
  ## Features
709
714
 
@@ -770,7 +775,7 @@ The chat interface adapts to different screen sizes:
770
775
 
771
776
  The environment variables `AI_GATEWAY_API_KEY` and `NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL` must be set for the default AI Gateway mode. Set `GEISTDOCS_CHAT_PROXY_URL` to route Ask AI through a Vertex-backed proxy instead. Eve agent mode needs `GEISTDOCS_CHAT_SECRET` for multi-turn sessions and prewarming. You can read more in the [Environment Variables](/docs/env) section.
772
777
 
773
- In default AI Gateway mode, Geistdocs uses `openai/gpt-5.6-sol` via the Vercel AI Gateway. In Vertex-backed proxy mode, the configured proxy controls the upstream model.
778
+ In default AI Gateway mode, Geistdocs uses `openai/gpt-6-luna` via the Vercel AI Gateway. In proxy and eve agent modes, the external responder controls the upstream model.
774
779
 
775
780
  ## Suggested Prompts
776
781
 
@@ -23,6 +23,9 @@ The provider handles these behaviors:
23
23
  2. **Analytics**: Integrates Vercel Analytics and Speed Insights when the local adapter includes them.
24
24
  3. **Search**: Configures the search dialog and connects it to your search API.
25
25
  4. **Ask AI**: Provides the client state used by the chat sidebar and page actions.
26
+ 5. **Theme shortcut**: Press `T` with no modifiers while the page has focus to switch between light and dark themes. The shortcut is disabled when a theme is forced.
27
+
28
+ The shortcut is part of the package provider, so generated consumer projects get it by default. It does not run while an input, button, link, or other element has focus.
26
29
 
27
30
  ## Usage
28
31
 
@@ -17,7 +17,7 @@
17
17
  "@streamdown/code": "^1.0.1",
18
18
  "@vercel/agent-readability": "^0.7.0",
19
19
  "@vercel/analytics": "^1.6.1",
20
- "@vercel/geistdocs": "2.14.6",
20
+ "@vercel/geistdocs": "2.15.0",
21
21
  "@vercel/speed-insights": "^1.3.1",
22
22
  "ai": "^6.0.132",
23
23
  "clsx": "^2.1.1",
@@ -30,7 +30,6 @@
30
30
  "geist": "1.7.1",
31
31
  "jotai": "^2.15.2",
32
32
  "mermaid": "^11.12.2",
33
- "motion": "^12.23.25",
34
33
  "nanoid": "^5.1.6",
35
34
  "next": "16.3.3",
36
35
  "next-themes": "^0.4.6",