nuxt-ai-ready 3.6.0 → 3.6.2

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 (161) hide show
  1. package/dist/agent-skills-config-CmZq9uWW.mjs +18 -0
  2. package/dist/agent-skills-zGLgFB6H.mjs +468 -0
  3. package/dist/cli.d.mts +1 -0
  4. package/dist/cli.mjs +656 -570
  5. package/dist/devtools/pages/ai-ready/debug.vue +9 -3
  6. package/dist/devtools/pages/ai-ready/index.vue +3 -1
  7. package/dist/devtools/pages/ai-ready/llms-txt.vue +15 -4
  8. package/dist/devtools/pages/ai-ready.vue +28 -4
  9. package/dist/module.d.mts +106 -112
  10. package/dist/module.json +3 -3
  11. package/dist/module.mjs +2732 -26
  12. package/dist/package-metadata-B1darl8W.mjs +28 -0
  13. package/dist/prerender-QMv07W4h.mjs +650 -0
  14. package/dist/runtime/app/composables/webmcp.js +90 -97
  15. package/dist/runtime/app/plugins/md-alternate.server.js +29 -26
  16. package/dist/runtime/app/plugins/md-hints.prerender.js +13 -15
  17. package/dist/runtime/app/plugins/webmcp.client.js +49 -53
  18. package/dist/runtime/app/webmcp-config.js +2 -2
  19. package/dist/runtime/cache-control.js +16 -10
  20. package/dist/runtime/i18n-url.js +6 -6
  21. package/dist/runtime/index.js +4 -12
  22. package/dist/runtime/llms-txt-directive.js +20 -13
  23. package/dist/runtime/llms-txt-files.js +188 -187
  24. package/dist/runtime/llms-txt-format.js +54 -55
  25. package/dist/runtime/llms-txt-i18n.js +22 -19
  26. package/dist/runtime/llms-txt-utils.js +140 -95
  27. package/dist/runtime/markdown-links.js +45 -39
  28. package/dist/runtime/markdown-path.js +29 -9
  29. package/dist/runtime/markdown-text.js +2 -1
  30. package/dist/runtime/mcp.js +5 -1
  31. package/dist/runtime/route-path.js +14 -8
  32. package/dist/runtime/server/db/drizzle/client.js +71 -75
  33. package/dist/runtime/server/db/drizzle/index.js +16 -28
  34. package/dist/runtime/server/db/drizzle/providers/bun.d.ts +2 -1
  35. package/dist/runtime/server/db/drizzle/providers/bun.js +10 -7
  36. package/dist/runtime/server/db/drizzle/providers/d1.js +16 -13
  37. package/dist/runtime/server/db/drizzle/providers/dbPath.js +60 -37
  38. package/dist/runtime/server/db/drizzle/providers/libsql.js +23 -11
  39. package/dist/runtime/server/db/drizzle/providers/neon.js +13 -10
  40. package/dist/runtime/server/db/drizzle/providers/node-sqlite.js +10 -7
  41. package/dist/runtime/server/db/drizzle/providers/postgres.js +13 -10
  42. package/dist/runtime/server/db/drizzle/queries.js +633 -532
  43. package/dist/runtime/server/db/drizzle/raw.js +200 -176
  44. package/dist/runtime/server/db/index.js +3 -0
  45. package/dist/runtime/server/db/queries.js +816 -607
  46. package/dist/runtime/server/db/schema/postgres.js +56 -50
  47. package/dist/runtime/server/db/schema/sqlite.js +56 -50
  48. package/dist/runtime/server/db/schema-sql.js +35 -38
  49. package/dist/runtime/server/db/seed.js +60 -45
  50. package/dist/runtime/server/db/shared.js +300 -213
  51. package/dist/runtime/server/index.js +1 -17
  52. package/dist/runtime/server/mcp/cache-key.js +5 -1
  53. package/dist/runtime/server/mcp/resources/pages.js +32 -33
  54. package/dist/runtime/server/mcp/tools/get-page-markdown.js +41 -27
  55. package/dist/runtime/server/mcp/tools/list-pages.js +40 -34
  56. package/dist/runtime/server/mcp/tools/search-pages.js +24 -16
  57. package/dist/runtime/server/middleware/markdown.d.ts +1 -1
  58. package/dist/runtime/server/middleware/markdown.js +15 -13
  59. package/dist/runtime/server/middleware/markdown.prerender.d.ts +1 -1
  60. package/dist/runtime/server/middleware/markdown.prerender.js +135 -119
  61. package/dist/runtime/server/middleware/render-markdown.d.ts +1 -1
  62. package/dist/runtime/server/middleware/render-markdown.js +164 -144
  63. package/dist/runtime/server/plugins/ai-terms.d.ts +1 -1
  64. package/dist/runtime/server/plugins/ai-terms.js +4 -8
  65. package/dist/runtime/server/plugins/content-signal-capture-nitro3.prerender.d.ts +1 -1
  66. package/dist/runtime/server/plugins/content-signal-capture-nitro3.prerender.js +7 -8
  67. package/dist/runtime/server/plugins/content-signal-capture.prerender.d.ts +1 -1
  68. package/dist/runtime/server/plugins/content-signal-capture.prerender.js +7 -7
  69. package/dist/runtime/server/plugins/db-lifecycle-nitro3.d.ts +1 -1
  70. package/dist/runtime/server/plugins/db-lifecycle-nitro3.js +13 -14
  71. package/dist/runtime/server/plugins/db-lifecycle.js +13 -11
  72. package/dist/runtime/server/plugins/html-capture.prerender.js +6 -6
  73. package/dist/runtime/server/plugins/link-header-nitro3.d.ts +1 -1
  74. package/dist/runtime/server/plugins/link-header-nitro3.js +23 -13
  75. package/dist/runtime/server/plugins/link-header.d.ts +1 -1
  76. package/dist/runtime/server/plugins/link-header.js +30 -30
  77. package/dist/runtime/server/plugins/llms-txt-directive-html.d.ts +1 -1
  78. package/dist/runtime/server/plugins/llms-txt-directive-html.js +4 -3
  79. package/dist/runtime/server/plugins/markdown-negotiation.d.ts +1 -1
  80. package/dist/runtime/server/plugins/markdown-negotiation.js +64 -45
  81. package/dist/runtime/server/plugins/sitemap-seeder.js +144 -112
  82. package/dist/runtime/server/routes/__ai-ready/cron.get.d.ts +1 -1
  83. package/dist/runtime/server/routes/__ai-ready/cron.get.js +17 -11
  84. package/dist/runtime/server/routes/__ai-ready/devtools.get.d.ts +1 -1
  85. package/dist/runtime/server/routes/__ai-ready/devtools.get.js +60 -45
  86. package/dist/runtime/server/routes/__ai-ready/pages.get.d.ts +36 -1
  87. package/dist/runtime/server/routes/__ai-ready/pages.get.js +44 -40
  88. package/dist/runtime/server/routes/__ai-ready/poll.post.d.ts +15 -1
  89. package/dist/runtime/server/routes/__ai-ready/poll.post.js +30 -30
  90. package/dist/runtime/server/routes/__ai-ready/prune.post.d.ts +13 -1
  91. package/dist/runtime/server/routes/__ai-ready/prune.post.js +29 -15
  92. package/dist/runtime/server/routes/__ai-ready/reindex.post.d.ts +22 -1
  93. package/dist/runtime/server/routes/__ai-ready/reindex.post.js +31 -21
  94. package/dist/runtime/server/routes/__ai-ready/restore.post.d.ts +4 -1
  95. package/dist/runtime/server/routes/__ai-ready/restore.post.js +28 -22
  96. package/dist/runtime/server/routes/__ai-ready/status.get.d.ts +1 -1
  97. package/dist/runtime/server/routes/__ai-ready/status.get.js +52 -53
  98. package/dist/runtime/server/routes/__ai-ready-debug.get.d.ts +83 -1
  99. package/dist/runtime/server/routes/__ai-ready-debug.get.js +209 -189
  100. package/dist/runtime/server/routes/agent-skills-artifact.d.ts +1 -1
  101. package/dist/runtime/server/routes/agent-skills-artifact.js +16 -14
  102. package/dist/runtime/server/routes/agent-skills-index.d.ts +1 -1
  103. package/dist/runtime/server/routes/agent-skills-index.js +8 -6
  104. package/dist/runtime/server/routes/ai-catalog.js +19 -19
  105. package/dist/runtime/server/routes/ai-terms.js +23 -19
  106. package/dist/runtime/server/routes/api-catalog.js +23 -23
  107. package/dist/runtime/server/routes/llms-full.txt.get.d.ts +1 -1
  108. package/dist/runtime/server/routes/llms-full.txt.get.js +42 -41
  109. package/dist/runtime/server/routes/llms.txt.get.d.ts +1 -1
  110. package/dist/runtime/server/routes/llms.txt.get.js +38 -33
  111. package/dist/runtime/server/routes/mcp-server-card.js +19 -19
  112. package/dist/runtime/server/routes/sitemap.md.get.d.ts +1 -1
  113. package/dist/runtime/server/routes/sitemap.md.get.js +38 -39
  114. package/dist/runtime/server/tasks/ai-ready-cron.d.ts +1 -1
  115. package/dist/runtime/server/tasks/ai-ready-cron.js +17 -14
  116. package/dist/runtime/server/utils/auth.js +76 -53
  117. package/dist/runtime/server/utils/batchIndex.js +72 -60
  118. package/dist/runtime/server/utils/checkStale.js +181 -134
  119. package/dist/runtime/server/utils/cloudflare-prerendered.js +23 -20
  120. package/dist/runtime/server/utils/cloudflare.js +69 -51
  121. package/dist/runtime/server/utils/content-negotiation.js +30 -18
  122. package/dist/runtime/server/utils/content.js +4 -1
  123. package/dist/runtime/server/utils/context.js +30 -19
  124. package/dist/runtime/server/utils/cron-plan.js +6 -6
  125. package/dist/runtime/server/utils/discovery-response.js +5 -6
  126. package/dist/runtime/server/utils/fetch.js +2 -1
  127. package/dist/runtime/server/utils/frontmatter.js +44 -57
  128. package/dist/runtime/server/utils/i18n.js +3 -8
  129. package/dist/runtime/server/utils/indexPage.js +152 -113
  130. package/dist/runtime/server/utils/keywords.js +278 -277
  131. package/dist/runtime/server/utils/link-header.js +67 -56
  132. package/dist/runtime/server/utils/llms-full.js +39 -49
  133. package/dist/runtime/server/utils/markdown-redirect.js +26 -14
  134. package/dist/runtime/server/utils/markdown-request.js +62 -47
  135. package/dist/runtime/server/utils/negotiation-decision.d.ts +8 -0
  136. package/dist/runtime/server/utils/negotiation-decision.js +106 -34
  137. package/dist/runtime/server/utils/negotiation-response.d.ts +1 -1
  138. package/dist/runtime/server/utils/negotiation-response.js +195 -144
  139. package/dist/runtime/server/utils/page-updated-at.js +23 -15
  140. package/dist/runtime/server/utils/prerender-html.js +31 -17
  141. package/dist/runtime/server/utils/runCron.js +263 -192
  142. package/dist/runtime/server/utils/sitemap-crawl-state.js +57 -39
  143. package/dist/runtime/server/utils/sitemap-lastmod.js +16 -14
  144. package/dist/runtime/server/utils/sitemap-md.js +39 -50
  145. package/dist/runtime/server/utils/sitemap-routes.js +7 -7
  146. package/dist/runtime/server/utils/sitemap.js +459 -414
  147. package/dist/runtime/server/utils.js +141 -122
  148. package/dist/runtime/site-tool-catalog.js +39 -43
  149. package/dist/runtime/site-tool-config.js +1 -0
  150. package/dist/runtime/sync-secret.js +11 -11
  151. package/dist/runtime/types.js +1 -0
  152. package/dist/runtime/webmcp-site-tools.js +278 -250
  153. package/dist/runtime/webmcp.js +53 -42
  154. package/dist/static-headers-G7hFL3wE.mjs +328 -0
  155. package/dist/types.d.mts +1 -9
  156. package/package.json +20 -24
  157. package/skills/nuxt-ai-ready/SKILL.md +8 -2
  158. package/dist/chunks/agent-skills.mjs +0 -383
  159. package/dist/chunks/prerender.mjs +0 -683
  160. package/dist/shared/nuxt-ai-ready.Bzx0dNWj.mjs +0 -3034
  161. package/dist/shared/nuxt-ai-ready.DCd-1s1G.mjs +0 -29
@@ -3,64 +3,53 @@ import { escapeMarkdownHtml } from "../../markdown-text.js";
3
3
  import { toDeployedRoute } from "../../route-path.js";
4
4
  export const SITEMAP_MD_ROUTE = "/sitemap.md";
5
5
  function topSegment(route) {
6
- return route.split("/").filter(Boolean)[0] || "";
6
+ return route.split("/").filter(Boolean)[0] || "";
7
7
  }
8
8
  function escapeTitle(title) {
9
- return escapeMarkdownHtml(title).replaceAll("[", "\\[").replaceAll("]", "\\]");
9
+ return escapeMarkdownHtml(title).replaceAll("[", "\\[").replaceAll("]", "\\]");
10
10
  }
11
11
  function formatEntry(entry, resolveHref) {
12
- const title = escapeTitle(entry.title?.trim() || entry.route);
13
- const href = resolveHref(entry.route);
14
- if (entry.updatedAt) {
15
- const parsed = new Date(entry.updatedAt);
16
- if (!Number.isNaN(parsed.getTime()))
17
- return `- [${title}](${href} "${parsed.toISOString()}")`;
18
- }
19
- return `- [${title}](${href})`;
12
+ const title = escapeTitle(entry.title?.trim() || entry.route);
13
+ const href = resolveHref(entry.route);
14
+ if (entry.updatedAt) {
15
+ const parsed = new Date(entry.updatedAt);
16
+ if (!Number.isNaN(parsed.getTime())) return `- [${title}](${href} "${parsed.toISOString()}")`;
17
+ }
18
+ return `- [${title}](${href})`;
20
19
  }
21
20
  export function buildSitemapMd(entries, options = {}) {
22
- const resolveHref = options.resolveHref || toMarkdownPath;
23
- const groups = /* @__PURE__ */ new Map();
24
- for (const entry of [...entries].sort((a, b) => a.route.localeCompare(b.route))) {
25
- const key = topSegment(entry.route);
26
- const group = groups.get(key);
27
- if (group)
28
- group.push(entry);
29
- else
30
- groups.set(key, [entry]);
31
- }
32
- const keys = [...groups.keys()].sort((a, b) => {
33
- if (a === "")
34
- return -1;
35
- if (b === "")
36
- return 1;
37
- return a.localeCompare(b);
38
- });
39
- const parts = [`# ${escapeMarkdownHtml(options.siteName || "Site")} Sitemap`, "", "All pages in Markdown format."];
40
- for (const key of keys) {
41
- parts.push("", `## ${key || "Root"}`);
42
- for (const entry of groups.get(key))
43
- parts.push(formatEntry(entry, resolveHref));
44
- }
45
- return `${parts.join("\n")}
46
- `;
21
+ const resolveHref = options.resolveHref || toMarkdownPath;
22
+ const groups = new Map();
23
+ for (const entry of [...entries].sort((a, b) => a.route.localeCompare(b.route))) {
24
+ const key = topSegment(entry.route);
25
+ const group = groups.get(key);
26
+ if (group) group.push(entry);
27
+ else groups.set(key, [entry]);
28
+ }
29
+ const keys = [...groups.keys()].sort((a, b) => {
30
+ if (a === "") return -1;
31
+ if (b === "") return 1;
32
+ return a.localeCompare(b);
33
+ });
34
+ const parts = [
35
+ `# ${escapeMarkdownHtml(options.siteName || "Site")} Sitemap`,
36
+ "",
37
+ "All pages in Markdown format."
38
+ ];
39
+ for (const key of keys) {
40
+ parts.push("", `## ${key || "Root"}`);
41
+ for (const entry of groups.get(key)) parts.push(formatEntry(entry, resolveHref));
42
+ }
43
+ return `${parts.join("\n")}\n`;
47
44
  }
48
45
  export function appendSitemapSection(markdown, sitemapHref = SITEMAP_MD_ROUTE) {
49
- const section = `## Sitemap
50
-
51
- See the full [sitemap](${sitemapHref}) for all pages.`;
52
- const trimmed = markdown.trimEnd();
53
- if (trimmed.endsWith(section))
54
- return `${trimmed}
55
- `;
56
- return `${trimmed}
57
-
58
- ${section}
59
- `;
46
+ const section = `## Sitemap\n\nSee the full [sitemap](${sitemapHref}) for all pages.`;
47
+ const trimmed = markdown.trimEnd();
48
+ if (trimmed.endsWith(section)) return `${trimmed}\n`;
49
+ return `${trimmed}\n\n${section}\n`;
60
50
  }
61
51
  export function isSitemapMdRequest(path, baseURL, enabled) {
62
- if (!enabled)
63
- return false;
64
- const withoutQuery = path.split("?")[0] || path;
65
- return withoutQuery === SITEMAP_MD_ROUTE || withoutQuery === toDeployedRoute(SITEMAP_MD_ROUTE, baseURL);
52
+ if (!enabled) return false;
53
+ const withoutQuery = path.split("?")[0] || path;
54
+ return withoutQuery === SITEMAP_MD_ROUTE || withoutQuery === toDeployedRoute(SITEMAP_MD_ROUTE, baseURL);
66
55
  }
@@ -1,10 +1,10 @@
1
1
  import { hasMarkdownTwin } from "../../markdown-path.js";
2
+ /** Normalize sitemap URL records into the route map used by the page store. */
2
3
  export function mapSitemapRoutes(urls) {
3
- const routeToUrl = /* @__PURE__ */ new Map();
4
- for (const url of urls) {
5
- const route = url._path?.pathname ?? (url.loc.startsWith("/") ? url.loc.split("?")[0] ?? url.loc : new URL(url.loc).pathname);
6
- if (hasMarkdownTwin(route))
7
- routeToUrl.set(route, url);
8
- }
9
- return routeToUrl;
4
+ const routeToUrl = new Map();
5
+ for (const url of urls) {
6
+ const route = url._path?.pathname ?? (url.loc.startsWith("/") ? url.loc.split("?")[0] ?? url.loc : new URL(url.loc).pathname);
7
+ if (hasMarkdownTwin(route)) routeToUrl.set(route, url);
8
+ }
9
+ return routeToUrl;
10
10
  }