nuxt-ai-ready 0.3.7 → 0.4.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 (41) hide show
  1. package/README.md +8 -14
  2. package/dist/module.d.mts +13 -20
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +384 -380
  5. package/dist/runtime/{llms-txt.d.ts → llms-txt-utils.d.ts} +2 -0
  6. package/dist/runtime/llms-txt-utils.js +114 -0
  7. package/dist/runtime/nuxt/plugins/{prerender.js → md-hints.prerender.js} +1 -1
  8. package/dist/runtime/server/mcp/resources/pages.d.ts +17 -0
  9. package/dist/runtime/server/mcp/{dev/resources → resources}/pages.js +5 -4
  10. package/dist/runtime/server/mcp/tools/list-pages.d.ts +16 -0
  11. package/dist/runtime/server/mcp/tools/list-pages.js +11 -0
  12. package/dist/runtime/server/mcp/tools/search-pages-fuzzy.d.ts +3 -0
  13. package/dist/runtime/server/mcp/tools/search-pages-fuzzy.js +25 -0
  14. package/dist/runtime/server/middleware/markdown.js +62 -0
  15. package/dist/runtime/server/middleware/markdown.prerender.d.ts +2 -0
  16. package/dist/runtime/server/middleware/markdown.prerender.js +35 -0
  17. package/dist/runtime/server/routes/llms-full.txt.get.d.ts +2 -0
  18. package/dist/runtime/server/routes/llms-full.txt.get.js +5 -0
  19. package/dist/runtime/server/routes/llms.txt.get.js +18 -18
  20. package/dist/runtime/server/utils/pageData.d.ts +25 -0
  21. package/dist/runtime/server/utils/pageData.js +25 -0
  22. package/dist/runtime/server/utils/sitemap.d.ts +6 -0
  23. package/dist/runtime/server/utils/sitemap.js +25 -0
  24. package/dist/runtime/server/utils.d.ts +15 -3
  25. package/dist/runtime/server/utils.js +93 -45
  26. package/dist/runtime/types.d.ts +25 -52
  27. package/dist/types.d.mts +1 -1
  28. package/package.json +16 -15
  29. package/dist/runtime/llms-txt.js +0 -35
  30. package/dist/runtime/server/mcp/dev/tools/list-pages.js +0 -10
  31. package/dist/runtime/server/mcp/dev/utils.js +0 -34
  32. package/dist/runtime/server/mcp/prod/resources/pages-chunks.js +0 -25
  33. package/dist/runtime/server/mcp/prod/resources/pages.js +0 -25
  34. package/dist/runtime/server/mcp/prod/tools/list-pages.js +0 -21
  35. package/dist/runtime/server/mcp/utils.d.ts +0 -3
  36. package/dist/runtime/server/mcp/utils.js +0 -7
  37. package/dist/runtime/server/middleware/mdream.js +0 -148
  38. package/dist/runtime/server/plugins/sitemap-lastmod.d.ts +0 -2
  39. package/dist/runtime/server/plugins/sitemap-lastmod.js +0 -22
  40. /package/dist/runtime/nuxt/plugins/{prerender.d.ts → md-hints.prerender.d.ts} +0 -0
  41. /package/dist/runtime/server/middleware/{mdream.d.ts → markdown.d.ts} +0 -0
package/README.md CHANGED
@@ -8,26 +8,20 @@
8
8
 
9
9
  ## Why Nuxt AI Ready?
10
10
 
11
- Search is changing. Outside of search engines, people now get answers directly from [ChatGPT](https://chatgpt.com/), [Claude](https://claude.ai/), and other AI assistants. When these LLMs answer questions about topics related to your site, you want your content to be the source they cite
12
- to drive traffic and engagement back to you.
11
+ ChatGPT search interest doubled in the past year. Users now ask AI assistants questions your site could answer—but LLMs only cite sources they can parse.
13
12
 
14
- For that to happen, AI systems need to understand your content. New standards are being shaped like [llms.txt](https://llmstxt.org/) for discoverability and [MCP](https://modelcontextprotocol.io/) for letting agents query your site directly. But these standards are still evolving, and implementing them correctly
15
- can be complex and time-consuming.
13
+ Two standards are emerging: [llms.txt](https://llmstxt.org/) (4,400 searches/mo, +26,900% YoY) for AI-readable site summaries, and [MCP](https://modelcontextprotocol.io/) (22,200 searches/mo) for letting agents query your content directly.
16
14
 
17
- - **📈 Increase citations by LLMs**: AI assistants pull from sources they can parse easily. Structured, AI-friendly content gets referenced more often.
18
- - **🔗 Direct site queries for LLMs**: MCP support means assistants can pull live data from you, not just static snippets from their training.
19
-
20
- Nuxt AI Ready converts your indexable pages into clean markdown that AI systems can consume, generates the right artifacts at build time, and serves AI-friendly formats to bots automatically.
15
+ Nuxt AI Ready implements both. It converts your pages to markdown, generates llms.txt at build time, and exposes an MCP server for AI agents to search your site.
21
16
 
22
17
  ## Features
23
18
 
24
- - 📄 **LLM Optimized Output**: Generate `llms.txt` artifacts including [TOON format](https://toonformat.dev)
19
+ - 📄 **llms.txt Generation**: Auto-generate `llms.txt` and `llms-full.txt` with page metadata and full markdown content
25
20
  - 🚀 **On-Demand Markdown**: Any route available as `.md` (e.g., `/about` → `/about.md`), automatically served to AI crawlers
26
- - 📡 **Content Signals**: Signals AI Crawlers using [Nuxt Robots](https://nuxtseo.com/robots)
27
- - 🌐 **Indexable Pages**: Integrating with [Nuxt Sitemap](https://nuxtseo.com/sitemap) to index only AI-allowed pages
28
- - 📦 **Bulk Chunk Export**: Exported token optimized chunks ready for RAG and semantic search
29
- - **MCP Integration**: Let AI agents query your site directly
30
- - ⏱️ **Automatic Last Updated**: Content freshness automatically tracked and added to your [sitemap.xml](https://nuxtseo.com/docs/ai-ready/guides/automatic-updated-at)
21
+ - 📡 **Content Signals**: Configure AI training/search/input permissions via [Nuxt Robots](https://nuxtseo.com/robots)
22
+ - 🌐 **Sitemap Integration**: Index AI-allowed pages via [Nuxt Sitemap](https://nuxtseo.com/sitemap)
23
+ - **MCP Server**: `list_pages` and `search_pages_fuzzy` tools for AI agents to query your site
24
+ - 🧠 **[RAG Ready](https://nuxtseo.com/ai-ready/advanced/rag-example)**: Markdown output optimized for vectorizing and semantic search
31
25
 
32
26
  ## Installation
33
27
 
package/dist/module.d.mts CHANGED
@@ -1,24 +1,22 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- import { BulkChunk, LlmsTxtConfig, ModuleOptions } from '../dist/runtime/types.js';
3
- export { BulkChunk, ModuleOptions } from '../dist/runtime/types.js';
2
+ import { ModuleOptions, LlmsTxtConfig } from '../dist/runtime/types.js';
3
+ export { ModuleOptions } from '../dist/runtime/types.js';
4
+
5
+ interface ParsedMarkdownResult {
6
+ markdown: string;
7
+ title: string;
8
+ description: string;
9
+ headings: Array<Record<string, string>>;
10
+ updatedAt?: string;
11
+ }
4
12
 
5
13
  interface ModuleHooks {
6
14
  /**
7
- * Hook to add routes to the AI ready
8
- * Other modules can register their own API routes
15
+ * Hook called when page markdown is generated during prerendering.
16
+ * Called with route and markdown content when content has changed.
9
17
  */
10
- 'ai-ready:routes': (payload: {
11
- routes: Record<string, string>;
12
- }) => void | Promise<void>;
13
- /**
14
- * Hook called for each chunk generated during prerendering for bulk export
15
- */
16
- 'ai-ready:chunk': (context: {
17
- chunk: BulkChunk;
18
+ 'ai-ready:page:markdown': (context: ParsedMarkdownResult & {
18
19
  route: string;
19
- title: string;
20
- description: string;
21
- headings: Array<Record<string, string>>;
22
20
  }) => void | Promise<void>;
23
21
  /**
24
22
  * Hook to modify llms.txt configuration before it is finalized
@@ -36,10 +34,5 @@ interface ModulePublicRuntimeConfig {
36
34
  }
37
35
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
38
36
 
39
- declare module '@nuxt/schema' {
40
- interface NuxtHooks extends ModuleHooks {
41
- }
42
- }
43
-
44
37
  export { _default as default };
45
38
  export type { ModuleHooks, ModulePublicRuntimeConfig };
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "nuxt": ">=4.0.0"
5
5
  },
6
6
  "configKey": "aiReady",
7
- "version": "0.3.7",
7
+ "version": "0.4.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"