nuxt-ai-ready 0.0.2 → 0.1.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.
- package/dist/module.json +1 -1
- package/dist/module.mjs +18 -14
- package/dist/runtime/types.d.ts +18 -0
- package/package.json +4 -4
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -114,16 +114,7 @@ const module = defineNuxtModule({
|
|
|
114
114
|
},
|
|
115
115
|
moduleDependencies: {
|
|
116
116
|
"@nuxtjs/robots": {
|
|
117
|
-
version: ">=5.6.0"
|
|
118
|
-
defaults: {
|
|
119
|
-
groups: [
|
|
120
|
-
{
|
|
121
|
-
userAgent: "*",
|
|
122
|
-
contentUsage: ["train-ai=y"],
|
|
123
|
-
contentSignal: ["ai-train=yes", "search=yes", "ai-input=yes"]
|
|
124
|
-
}
|
|
125
|
-
]
|
|
126
|
-
}
|
|
117
|
+
version: ">=5.6.0"
|
|
127
118
|
},
|
|
128
119
|
"nuxt-site-config": {
|
|
129
120
|
version: ">=3"
|
|
@@ -168,6 +159,13 @@ const module = defineNuxtModule({
|
|
|
168
159
|
resolve$1("./runtime/server/utils"),
|
|
169
160
|
resolve$1("./runtime/server/mcp")
|
|
170
161
|
);
|
|
162
|
+
if (typeof config.contentSignal === "object") {
|
|
163
|
+
nuxt.options.robots.groups.push({
|
|
164
|
+
userAgent: "*",
|
|
165
|
+
contentUsage: [`train-ai=${config.contentSignal.aiTrain ? "y" : "n"}`],
|
|
166
|
+
contentSignal: [`ai-train=${config.contentSignal.aiTrain ? "yes" : "no"}`, `search=${config.contentSignal.search ? "yes" : "no"}`, `ai-input=${config.contentSignal.aiInput ? "yes" : "no"}`]
|
|
167
|
+
});
|
|
168
|
+
}
|
|
171
169
|
addTypeTemplate({
|
|
172
170
|
filename: "module/nuxt-ai-ready.d.ts",
|
|
173
171
|
getContents: (data) => {
|
|
@@ -195,7 +193,7 @@ export {}
|
|
|
195
193
|
if (config.bulkRoute !== false) {
|
|
196
194
|
const resolvedBulkRoute = withSiteUrl(config.bulkRoute);
|
|
197
195
|
defaultLlmsTxtSections.push({
|
|
198
|
-
title: "
|
|
196
|
+
title: "LLM Tools",
|
|
199
197
|
links: [
|
|
200
198
|
{
|
|
201
199
|
title: "Bulk Data",
|
|
@@ -228,7 +226,7 @@ Returns JSONL (newline-delimited JSON) with all indexed content.`
|
|
|
228
226
|
defaultLlmsTxtSections[0].links.push(mcpLink);
|
|
229
227
|
} else {
|
|
230
228
|
defaultLlmsTxtSections.push({
|
|
231
|
-
title: "
|
|
229
|
+
title: "LLM Tools",
|
|
232
230
|
links: [mcpLink]
|
|
233
231
|
});
|
|
234
232
|
}
|
|
@@ -289,7 +287,10 @@ Returns JSONL (newline-delimited JSON) with all indexed content.`
|
|
|
289
287
|
let bulkStreamEntries = 0;
|
|
290
288
|
nitro.hooks.hook("prerender:route", async (route) => {
|
|
291
289
|
const isHtml = route.fileName?.endsWith(".html") && route.contents.startsWith("<!DOCTYPE html");
|
|
292
|
-
if (!isHtml || !route.
|
|
290
|
+
if (!isHtml || !route.contents) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
if (typeof route._sitemap !== "undefined" && !route._sitemap) {
|
|
293
294
|
return;
|
|
294
295
|
}
|
|
295
296
|
let title = "";
|
|
@@ -329,8 +330,10 @@ Returns JSONL (newline-delimited JSON) with all indexed content.`
|
|
|
329
330
|
bulkStream = createWriteStream(bulkPath);
|
|
330
331
|
logger.info(`Bulk JSONL stream created at ${relative(nuxt.options.rootDir, bulkPath)}`);
|
|
331
332
|
}
|
|
333
|
+
logger.debug(`Processing chunks for route: ${route.route}`);
|
|
332
334
|
let idx = 0;
|
|
333
|
-
for (const chunk of chunksStream) {
|
|
335
|
+
for await (const chunk of chunksStream) {
|
|
336
|
+
logger.debug(` Chunk ${idx}: ${chunk.content.length} chars, headers: ${JSON.stringify(chunk.metadata?.headers)}`);
|
|
334
337
|
const bulkChunk = {
|
|
335
338
|
id: generateVectorId(route.route, idx),
|
|
336
339
|
route: route.route,
|
|
@@ -353,6 +356,7 @@ Returns JSONL (newline-delimited JSON) with all indexed content.`
|
|
|
353
356
|
bulkStreamEntries++;
|
|
354
357
|
idx++;
|
|
355
358
|
}
|
|
359
|
+
logger.debug(`Completed ${idx} chunks for ${route.route}`);
|
|
356
360
|
});
|
|
357
361
|
nitro.hooks.hook("prerender:done", () => {
|
|
358
362
|
if (bulkStream) {
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -44,6 +44,24 @@ export interface ModuleOptions {
|
|
|
44
44
|
* Structured llms.txt configuration
|
|
45
45
|
*/
|
|
46
46
|
llmsTxt?: LlmsTxtConfig;
|
|
47
|
+
/**
|
|
48
|
+
* Content Signal Directives
|
|
49
|
+
*/
|
|
50
|
+
contentSignal?: false | {
|
|
51
|
+
/**
|
|
52
|
+
* Allow Training or fine-tuning AI models.
|
|
53
|
+
*/
|
|
54
|
+
aiTrain?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Allow building a search index and providing search results (e.g., returning hyperlinks and short excerpts from your website's contents).
|
|
57
|
+
* Search does not include providing AI-generated search summaries.
|
|
58
|
+
*/
|
|
59
|
+
search?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Inputting content into one or more AI models (e.g., retrieval augmented generation, grounding, or other real-time taking of content for generative AI search answers).
|
|
62
|
+
*/
|
|
63
|
+
aiInput?: boolean;
|
|
64
|
+
};
|
|
47
65
|
}
|
|
48
66
|
/**
|
|
49
67
|
* Individual chunk entry in bulk.jsonl (one per chunk)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-ai-ready",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"description": "Best practice AI & LLM discoverability for Nuxt sites.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"@nuxtjs/color-mode": "^4.0.0",
|
|
56
56
|
"@nuxtjs/eslint-config-typescript": "^12.1.0",
|
|
57
57
|
"@nuxtjs/i18n": "^10.2.1",
|
|
58
|
-
"@nuxtjs/mcp-toolkit": "^0.
|
|
58
|
+
"@nuxtjs/mcp-toolkit": "^0.5.1",
|
|
59
59
|
"@nuxtjs/robots": "^5.6.0",
|
|
60
60
|
"@nuxtjs/sitemap": "^7.4.7",
|
|
61
|
-
"@vitest/coverage-v8": "^4.0.
|
|
61
|
+
"@vitest/coverage-v8": "^4.0.15",
|
|
62
62
|
"@vueuse/nuxt": "^14.1.0",
|
|
63
63
|
"better-sqlite3": "^12.5.0",
|
|
64
64
|
"bumpp": "^10.3.2",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"playwright-core": "^1.57.0",
|
|
72
72
|
"postgres": "^3.4.7",
|
|
73
73
|
"typescript": "^5.9.3",
|
|
74
|
-
"vitest": "^4.0.
|
|
74
|
+
"vitest": "^4.0.15",
|
|
75
75
|
"vue": "^3.5.25",
|
|
76
76
|
"vue-router": "^4.6.3",
|
|
77
77
|
"vue-tsc": "^3.1.5",
|