nuxt-ai-ready 1.3.9 → 1.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 (33) hide show
  1. package/dist/devtools/lib/ai-ready/rpc.ts +6 -0
  2. package/dist/devtools/lib/ai-ready/state.ts +21 -0
  3. package/dist/devtools/lib/ai-ready/types.ts +50 -0
  4. package/dist/devtools/nuxt.config.ts +3 -0
  5. package/dist/devtools/pages/ai-ready/debug.vue +27 -0
  6. package/dist/devtools/pages/ai-ready/docs.vue +3 -0
  7. package/dist/devtools/pages/ai-ready/index.vue +177 -0
  8. package/dist/devtools/pages/ai-ready/llms-txt.vue +172 -0
  9. package/dist/devtools/pages/ai-ready.vue +50 -0
  10. package/dist/module.json +1 -1
  11. package/dist/module.mjs +1 -1
  12. package/package.json +14 -14
  13. package/dist/devtools/200.html +0 -1
  14. package/dist/devtools/404.html +0 -1
  15. package/dist/devtools/_nuxt/B75sBxVw.js +0 -1
  16. package/dist/devtools/_nuxt/C5qFqPjv.js +0 -2
  17. package/dist/devtools/_nuxt/CUvdyac7.js +0 -1
  18. package/dist/devtools/_nuxt/D9Lze2B3.js +0 -1
  19. package/dist/devtools/_nuxt/D9pLQdnz.js +0 -38
  20. package/dist/devtools/_nuxt/DevtoolsPanel.BTjFkHvn.css +0 -1
  21. package/dist/devtools/_nuxt/DiEjVMsr.js +0 -1
  22. package/dist/devtools/_nuxt/Es9IinpI.js +0 -1
  23. package/dist/devtools/_nuxt/builds/latest.json +0 -1
  24. package/dist/devtools/_nuxt/builds/meta/f26345f8-0602-46ab-916a-0529f3a14be9.json +0 -1
  25. package/dist/devtools/_nuxt/entry.C01PFCnM.css +0 -1
  26. package/dist/devtools/_nuxt/fira-code.Bc8wnsZt.woff2 +0 -0
  27. package/dist/devtools/_nuxt/hubot-sans.DLGyhQVu.woff2 +0 -0
  28. package/dist/devtools/_nuxt/index.Cz-FJ6Du.css +0 -1
  29. package/dist/devtools/debug/index.html +0 -1
  30. package/dist/devtools/docs/index.html +0 -1
  31. package/dist/devtools/index.html +0 -1
  32. package/dist/devtools/llms-txt/index.html +0 -1
  33. package/dist/devtools/pages/index.html +0 -1
@@ -0,0 +1,6 @@
1
+ import { useDevtoolsConnection } from 'nuxtseo-layer-devtools/composables/rpc'
2
+
3
+ // The layer owns host fetch + route tracking and refreshes on connect; ai-ready's
4
+ // state.ts watches refreshTime to reload the global debug data, so no module-level
5
+ // host access is needed here.
6
+ useDevtoolsConnection()
@@ -0,0 +1,21 @@
1
+ import type { DevtoolsGlobalData } from './types'
2
+ import { appFetch } from 'nuxtseo-layer-devtools/composables/rpc'
3
+ import { productionUrl, refreshTime } from 'nuxtseo-layer-devtools/composables/state'
4
+ import { ref, watch } from 'vue'
5
+
6
+ export const data = ref<DevtoolsGlobalData | null>(null)
7
+ export const loading = ref(true)
8
+
9
+ export async function refreshSources() {
10
+ if (!appFetch.value || typeof appFetch.value !== 'function')
11
+ return
12
+ data.value = await appFetch.value('/__ai-ready__/debug.json', { responseType: 'json' }).catch(() => null)
13
+ loading.value = false
14
+ if (data.value?.siteConfigUrl)
15
+ productionUrl.value = data.value.siteConfigUrl
16
+ }
17
+
18
+ // Re-fetch the global debug data when the host connection or manual refresh changes
19
+ watch([appFetch, refreshTime], () => {
20
+ refreshSources()
21
+ })
@@ -0,0 +1,50 @@
1
+ export interface DevtoolsConfig {
2
+ database: { type: string }
3
+ runtimeSync: { enabled: boolean, ttl: number, batchSize: number, pruneTtl: number }
4
+ indexNow: boolean
5
+ sitemapPrerendered: boolean
6
+ markdownCacheHeaders: { maxAge: number, swr: boolean }
7
+ llmsTxtCacheSeconds: number
8
+ contentSignal: false | { aiTrain: boolean, search: boolean, aiInput: boolean }
9
+ mcp: { enabled: boolean, tools: boolean, resources: boolean }
10
+ cron: boolean
11
+ }
12
+
13
+ export interface LlmsTxtLink {
14
+ title: string
15
+ description?: string
16
+ href: string
17
+ }
18
+
19
+ export interface LlmsTxtSection {
20
+ title: string
21
+ description?: string | string[]
22
+ links?: LlmsTxtLink[]
23
+ }
24
+
25
+ export interface LlmsTxtConfig {
26
+ sections?: LlmsTxtSection[]
27
+ notes?: string | string[]
28
+ }
29
+
30
+ export interface PageSummary {
31
+ route: string
32
+ title: string
33
+ description: string
34
+ updatedAt: string | null
35
+ }
36
+
37
+ export interface DevtoolsGlobalData {
38
+ version: string
39
+ siteConfigUrl: string
40
+ isDev: boolean
41
+ config: DevtoolsConfig
42
+ llmsTxt: LlmsTxtConfig
43
+ stats?: {
44
+ total: number
45
+ indexed: number
46
+ pending: number
47
+ errors: number
48
+ }
49
+ pages?: PageSummary[]
50
+ }
@@ -0,0 +1,3 @@
1
+ // Nuxt SEO devtools panel, shipped as a layer (Model C). The unified devtools client
2
+ // (assembled by nuxtseo-shared in the user's project) extends this to render /ai-ready.
3
+ export default defineNuxtConfig({})
@@ -0,0 +1,27 @@
1
+ <script lang="ts" setup>
2
+ import { computed } from 'vue'
3
+ import { data } from '../../lib/ai-ready/state'
4
+
5
+ const config = computed(() => data.value?.config)
6
+ const llmsTxt = computed(() => data.value?.llmsTxt)
7
+
8
+ const configJson = computed(() => config.value ? JSON.stringify(config.value, null, 2) : '')
9
+ const llmsTxtJson = computed(() => llmsTxt.value ? JSON.stringify(llmsTxt.value, null, 2) : '')
10
+ const fullJson = computed(() => data.value ? JSON.stringify(data.value, null, 2) : '')
11
+ </script>
12
+
13
+ <template>
14
+ <div class="space-y-4">
15
+ <DevtoolsSection text="Module Config" icon="carbon:settings" :open="true">
16
+ <DevtoolsSnippet v-if="configJson" :code="configJson" lang="json" />
17
+ </DevtoolsSection>
18
+
19
+ <DevtoolsSection text="llms.txt Config" icon="carbon:document" :open="true">
20
+ <DevtoolsSnippet v-if="llmsTxtJson" :code="llmsTxtJson" lang="json" />
21
+ </DevtoolsSection>
22
+
23
+ <DevtoolsSection text="Full Response" icon="carbon:code" :open="false">
24
+ <DevtoolsSnippet v-if="fullJson" :code="fullJson" lang="json" />
25
+ </DevtoolsSection>
26
+ </div>
27
+ </template>
@@ -0,0 +1,3 @@
1
+ <template>
2
+ <DevtoolsDocs url="https://nuxtseo.com/ai-ready" />
3
+ </template>
@@ -0,0 +1,177 @@
1
+ <script lang="ts" setup>
2
+ import { appFetch } from 'nuxtseo-layer-devtools/composables/rpc'
3
+ import { hasProductionUrl, isProductionMode, previewSource } from 'nuxtseo-layer-devtools/composables/state'
4
+ import { computed, ref } from 'vue'
5
+ import { useAsyncData } from '#imports'
6
+ import { data as globalData } from '../../lib/ai-ready/state'
7
+
8
+ const isDev = computed(() => globalData?.value?.isDev ?? true)
9
+ const stats = computed(() => globalData?.value?.stats)
10
+ const pages = computed(() => globalData?.value?.pages || [])
11
+
12
+ const search = ref('')
13
+ const selectedRoute = ref<string | null>(null)
14
+
15
+ const filteredPages = computed(() => {
16
+ if (!search.value)
17
+ return pages.value
18
+ const q = search.value.toLowerCase()
19
+ return pages.value.filter(p =>
20
+ p.route.toLowerCase().includes(q)
21
+ || p.title?.toLowerCase().includes(q)
22
+ || p.description?.toLowerCase().includes(q),
23
+ )
24
+ })
25
+
26
+ // Fetch markdown for selected page
27
+ const { data: markdownContent, status: mdStatus } = useAsyncData('page-markdown', async () => {
28
+ if (!appFetch.value || !selectedRoute.value)
29
+ return null
30
+ try {
31
+ const mdRoute = selectedRoute.value === '/' ? '/index.md' : `${selectedRoute.value}.md`
32
+ return await appFetch.value(mdRoute, { responseType: 'text' }) as string
33
+ }
34
+ catch {
35
+ return null
36
+ }
37
+ }, {
38
+ watch: [selectedRoute, appFetch],
39
+ })
40
+ </script>
41
+
42
+ <template>
43
+ <div class="space-y-4">
44
+ <!-- Dev mode empty state -->
45
+ <template v-if="isDev && !isProductionMode">
46
+ <DevtoolsEmptyState
47
+ icon="carbon:list"
48
+ title="No pages in development"
49
+ description="Pages are indexed during prerendering or via runtime sync. The database is empty in dev mode."
50
+ >
51
+ <div class="mt-4 space-y-2">
52
+ <button
53
+ v-if="hasProductionUrl"
54
+ type="button"
55
+ class="inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md bg-[var(--seo-green)] text-white hover:opacity-90 transition-opacity cursor-pointer"
56
+ @click="previewSource = 'production'"
57
+ >
58
+ <UIcon name="carbon:cloud" class="w-3.5 h-3.5" />
59
+ Switch to Production
60
+ </button>
61
+ <p class="text-xs text-[var(--color-text-muted)]">
62
+ Or run <code class="px-1 py-0.5 rounded bg-[var(--color-surface-elevated)]">nuxi generate</code> to populate page data.
63
+ </p>
64
+ </div>
65
+ </DevtoolsEmptyState>
66
+ </template>
67
+
68
+ <!-- Page browser (production mode or has pages) -->
69
+ <template v-else>
70
+ <!-- Stats -->
71
+ <div v-if="stats" class="grid grid-cols-2 sm:grid-cols-4 gap-3">
72
+ <DevtoolsMetric
73
+ label="Total Pages"
74
+ :value="stats.total"
75
+ icon="carbon:document-multiple"
76
+ />
77
+ <DevtoolsMetric
78
+ label="Indexed"
79
+ :value="stats.indexed"
80
+ icon="carbon:checkmark-filled"
81
+ variant="success"
82
+ />
83
+ <DevtoolsMetric
84
+ label="Pending"
85
+ :value="stats.pending"
86
+ icon="carbon:time"
87
+ :variant="stats.pending > 0 ? 'warning' : 'default'"
88
+ />
89
+ <DevtoolsMetric
90
+ label="Errors"
91
+ :value="stats.errors"
92
+ icon="carbon:warning-alt"
93
+ :variant="stats.errors > 0 ? 'danger' : 'default'"
94
+ />
95
+ </div>
96
+
97
+ <!-- Search -->
98
+ <div class="flex items-center gap-2">
99
+ <div class="relative flex-1">
100
+ <UIcon name="carbon:search" class="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-muted)]" />
101
+ <input
102
+ v-model="search"
103
+ type="text"
104
+ placeholder="Search pages..."
105
+ class="w-full pl-9 pr-3 py-2 text-sm rounded-lg bg-[var(--color-surface-sunken)] border border-[var(--color-border)] text-[var(--color-text)] placeholder:text-[var(--color-text-muted)] outline-none focus:border-[var(--seo-green)] transition-colors"
106
+ >
107
+ </div>
108
+ <span class="text-xs text-[var(--color-text-muted)] shrink-0">
109
+ {{ filteredPages.length }} page{{ filteredPages.length === 1 ? '' : 's' }}
110
+ </span>
111
+ </div>
112
+
113
+ <!-- Page list -->
114
+ <div v-if="filteredPages.length" class="space-y-1">
115
+ <button
116
+ v-for="page in filteredPages"
117
+ :key="page.route"
118
+ type="button"
119
+ class="w-full text-left p-3 rounded-lg border transition-all cursor-pointer"
120
+ :class="selectedRoute === page.route
121
+ ? 'bg-[var(--color-surface-elevated)] border-[var(--seo-green)]'
122
+ : 'bg-[var(--color-surface)] border-[var(--color-border)] hover:bg-[var(--color-surface-elevated)]'"
123
+ @click="selectedRoute = selectedRoute === page.route ? null : page.route"
124
+ >
125
+ <div class="flex items-start justify-between gap-2">
126
+ <div class="min-w-0">
127
+ <div class="text-xs font-mono text-[var(--seo-green)] truncate">
128
+ {{ page.route }}
129
+ </div>
130
+ <div v-if="page.title" class="text-sm font-medium text-[var(--color-text)] truncate mt-0.5">
131
+ {{ page.title }}
132
+ </div>
133
+ <div v-if="page.description" class="text-xs text-[var(--color-text-muted)] line-clamp-2 mt-0.5">
134
+ {{ page.description }}
135
+ </div>
136
+ </div>
137
+ <div v-if="page.updatedAt" class="text-[10px] text-[var(--color-text-subtle)] shrink-0">
138
+ {{ new Date(page.updatedAt).toLocaleDateString() }}
139
+ </div>
140
+ </div>
141
+ </button>
142
+ </div>
143
+
144
+ <DevtoolsEmptyState
145
+ v-else-if="search"
146
+ icon="carbon:search"
147
+ title="No matching pages"
148
+ :description="`No pages match &quot;${search}&quot;`"
149
+ />
150
+
151
+ <DevtoolsEmptyState
152
+ v-else
153
+ icon="carbon:list"
154
+ title="No pages indexed"
155
+ description="The production site has no indexed pages yet. Ensure prerendering has run."
156
+ />
157
+
158
+ <!-- Markdown preview panel -->
159
+ <DevtoolsPanel
160
+ v-if="selectedRoute"
161
+ :title="`${selectedRoute}.md`"
162
+ icon="carbon:document"
163
+ >
164
+ <div v-if="mdStatus === 'pending'" class="py-4">
165
+ <DevtoolsLoading />
166
+ </div>
167
+ <div v-else-if="markdownContent" class="relative">
168
+ <DevtoolsCopyButton :text="markdownContent" class="absolute top-2 right-2 z-10" />
169
+ <pre class="text-xs font-mono whitespace-pre-wrap p-4 rounded-lg bg-[var(--color-surface-sunken)] text-[var(--color-text)] overflow-auto max-h-[500px]">{{ markdownContent }}</pre>
170
+ </div>
171
+ <p v-else class="text-xs text-[var(--color-text-muted)] p-4">
172
+ Could not load markdown for this route.
173
+ </p>
174
+ </DevtoolsPanel>
175
+ </template>
176
+ </div>
177
+ </template>
@@ -0,0 +1,172 @@
1
+ <script lang="ts" setup>
2
+ import { appFetch } from 'nuxtseo-layer-devtools/composables/rpc'
3
+ import { isProductionMode, refreshTime } from 'nuxtseo-layer-devtools/composables/state'
4
+ import { computed, ref } from 'vue'
5
+ import { useAsyncData } from '#imports'
6
+ import { data as globalData } from '../../lib/ai-ready/state'
7
+
8
+ const isDev = computed(() => globalData?.value?.isDev ?? true)
9
+ const llmsTxtConfig = computed(() => globalData?.value?.llmsTxt)
10
+
11
+ const activeTab = ref<'llms-txt' | 'llms-full'>('llms-txt')
12
+
13
+ // Fetch actual llms.txt content
14
+ const { data: llmsTxtContent } = useAsyncData('llms-txt-content', async () => {
15
+ if (!appFetch.value)
16
+ return null
17
+ try {
18
+ return await appFetch.value('/llms.txt', { responseType: 'text' }) as string
19
+ }
20
+ catch {
21
+ return null
22
+ }
23
+ }, {
24
+ watch: [appFetch, refreshTime],
25
+ })
26
+
27
+ const { data: llmsFullContent, status: fullStatus } = useAsyncData('llms-full-content', async () => {
28
+ if (!appFetch.value || activeTab.value !== 'llms-full')
29
+ return null
30
+ try {
31
+ return await appFetch.value('/llms-full.txt', { responseType: 'text' }) as string
32
+ }
33
+ catch {
34
+ return null
35
+ }
36
+ }, {
37
+ watch: [appFetch, refreshTime, activeTab],
38
+ })
39
+
40
+ const displayContent = computed(() => {
41
+ if (activeTab.value === 'llms-full')
42
+ return llmsFullContent.value
43
+ return llmsTxtContent.value
44
+ })
45
+
46
+ // Build a template preview from config (for dev mode)
47
+ const templatePreview = computed(() => {
48
+ const config = llmsTxtConfig.value
49
+ if (!config)
50
+ return ''
51
+
52
+ const lines: string[] = ['# {Site Name}', '', '> {Site Description}', '']
53
+
54
+ for (const section of config.sections || []) {
55
+ lines.push(`## ${section.title}`)
56
+ if (section.description) {
57
+ const descs = Array.isArray(section.description) ? section.description : [section.description]
58
+ for (const d of descs)
59
+ lines.push('', d)
60
+ }
61
+ for (const link of section.links || []) {
62
+ const desc = link.description ? `: ${link.description}` : ''
63
+ lines.push(`- [${link.title}](${link.href})${desc}`)
64
+ }
65
+ lines.push('')
66
+ }
67
+
68
+ if (config.notes) {
69
+ const notes = Array.isArray(config.notes) ? config.notes : [config.notes]
70
+ for (const note of notes)
71
+ lines.push(note)
72
+ }
73
+
74
+ return lines.join('\n')
75
+ })
76
+ </script>
77
+
78
+ <template>
79
+ <div class="space-y-4">
80
+ <!-- Tab switcher -->
81
+ <div class="flex items-center gap-2">
82
+ <button
83
+ v-for="tab in [{ key: 'llms-txt', label: 'llms.txt' }, { key: 'llms-full', label: 'llms-full.txt' }]"
84
+ :key="tab.key"
85
+ type="button"
86
+ class="px-3 py-1.5 text-xs font-medium rounded-md transition-all cursor-pointer"
87
+ :class="activeTab === tab.key
88
+ ? 'bg-[var(--seo-green)] text-white'
89
+ : 'bg-[var(--color-surface-elevated)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]'"
90
+ @click="activeTab = tab.key as any"
91
+ >
92
+ {{ tab.label }}
93
+ </button>
94
+ </div>
95
+
96
+ <!-- Dev mode: template preview hint -->
97
+ <DevtoolsAlert
98
+ v-if="isDev && !isProductionMode"
99
+ variant="info"
100
+ >
101
+ <p class="font-medium mb-1">
102
+ Template Preview
103
+ </p>
104
+ <p class="text-sm opacity-80">
105
+ This shows the llms.txt structure from your config. Actual content with page data is generated during prerendering.
106
+ Switch to production mode to see live content.
107
+ </p>
108
+ </DevtoolsAlert>
109
+
110
+ <!-- Content display -->
111
+ <DevtoolsPanel :title="activeTab === 'llms-txt' ? 'llms.txt' : 'llms-full.txt'">
112
+ <!-- Loading state for llms-full.txt -->
113
+ <div v-if="activeTab === 'llms-full' && fullStatus === 'pending'" class="py-8 text-center">
114
+ <DevtoolsLoading />
115
+ </div>
116
+
117
+ <!-- Show content or template -->
118
+ <template v-else>
119
+ <div v-if="displayContent" class="relative">
120
+ <DevtoolsCopyButton :text="displayContent" class="absolute top-2 right-2 z-10" />
121
+ <pre class="text-xs font-mono whitespace-pre-wrap p-4 rounded-lg bg-[var(--color-surface-sunken)] text-[var(--color-text)] overflow-auto max-h-[600px]">{{ displayContent }}</pre>
122
+ </div>
123
+
124
+ <!-- Fallback: show template preview in dev -->
125
+ <div v-else-if="isDev && templatePreview" class="relative">
126
+ <pre class="text-xs font-mono whitespace-pre-wrap p-4 rounded-lg bg-[var(--color-surface-sunken)] text-[var(--color-text-muted)] overflow-auto max-h-[600px]">{{ templatePreview }}</pre>
127
+ </div>
128
+
129
+ <DevtoolsEmptyState
130
+ v-else
131
+ icon="carbon:document"
132
+ title="No content available"
133
+ description="llms.txt content is generated during prerendering. Run `nuxi generate` or switch to production mode."
134
+ />
135
+ </template>
136
+ </DevtoolsPanel>
137
+
138
+ <!-- llms.txt Structure (always visible) -->
139
+ <DevtoolsSection text="Configured Sections" icon="carbon:list-boxes">
140
+ <div v-if="llmsTxtConfig?.sections?.length" class="space-y-3">
141
+ <div
142
+ v-for="(section, i) in llmsTxtConfig.sections"
143
+ :key="i"
144
+ class="p-3 rounded-lg bg-[var(--color-surface-elevated)] border border-[var(--color-border)]"
145
+ >
146
+ <h4 class="text-sm font-semibold text-[var(--color-text)] mb-1">
147
+ {{ section.title }}
148
+ </h4>
149
+ <div v-if="section.links?.length" class="space-y-1 mt-2">
150
+ <div
151
+ v-for="(link, j) in section.links"
152
+ :key="j"
153
+ class="flex items-start gap-2 text-xs"
154
+ >
155
+ <UIcon name="carbon:link" class="w-3 h-3 mt-0.5 text-[var(--color-text-muted)]" />
156
+ <div>
157
+ <span class="font-medium text-[var(--color-text)]">{{ link.title }}</span>
158
+ <span v-if="link.description" class="text-[var(--color-text-muted)]">, {{ link.description }}</span>
159
+ <div class="font-mono text-[var(--color-text-subtle)]">
160
+ {{ link.href }}
161
+ </div>
162
+ </div>
163
+ </div>
164
+ </div>
165
+ </div>
166
+ </div>
167
+ <p v-else class="text-xs text-[var(--color-text-muted)]">
168
+ No custom sections configured.
169
+ </p>
170
+ </DevtoolsSection>
171
+ </div>
172
+ </template>
@@ -0,0 +1,50 @@
1
+ <script lang="ts" setup>
2
+ import { isProductionMode } from 'nuxtseo-layer-devtools/composables/state'
3
+ import { computed, watch } from 'vue'
4
+ import { navigateTo, useRoute } from '#imports'
5
+ import { data, loading, refreshSources } from '../lib/ai-ready/state'
6
+ import '../lib/ai-ready/rpc'
7
+
8
+ const route = useRoute()
9
+ const currentTab = computed(() => {
10
+ const path = route.path
11
+ if (path === '/ai-ready/llms-txt')
12
+ return 'llms-txt'
13
+ if (path === '/ai-ready/debug')
14
+ return 'debug'
15
+ if (path === '/ai-ready/docs')
16
+ return 'docs'
17
+ return 'pages'
18
+ })
19
+
20
+ const navItems = [
21
+ { value: 'pages', to: '/ai-ready', icon: 'carbon:list', label: 'Pages', devOnly: false },
22
+ { value: 'llms-txt', to: '/ai-ready/llms-txt', icon: 'carbon:document', label: 'llms.txt', devOnly: false },
23
+ { value: 'debug', to: '/ai-ready/debug', icon: 'carbon:debug', label: 'Debug', devOnly: true },
24
+ { value: 'docs', to: '/ai-ready/docs', icon: 'carbon:book', label: 'Docs', devOnly: false },
25
+ ]
26
+
27
+ const runtimeVersion = computed(() => data.value?.version || 'unknown')
28
+
29
+ // Debug data is dev-only; leave the debug tab when the header switches to Production
30
+ watch(isProductionMode, (isProd) => {
31
+ if (isProd && currentTab.value === 'debug')
32
+ return navigateTo('/ai-ready')
33
+ })
34
+ </script>
35
+
36
+ <template>
37
+ <DevtoolsLayout
38
+ module-name="nuxt-ai-ready"
39
+ title="AI Ready"
40
+ icon="carbon:bot"
41
+ :version="runtimeVersion"
42
+ :nav-items="navItems"
43
+ github-url="https://github.com/harlan-zw/nuxt-ai-ready"
44
+ :loading="loading"
45
+ :active-tab="currentTab"
46
+ @refresh="refreshSources"
47
+ >
48
+ <NuxtPage />
49
+ </DevtoolsLayout>
50
+ </template>
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "nuxt": ">=4.0.0"
5
5
  },
6
6
  "configKey": "aiReady",
7
- "version": "1.3.9",
7
+ "version": "1.4.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -957,7 +957,7 @@ export async function lookupContentPage(event, path) {
957
957
  });
958
958
  addServerHandler({ route: "/llms.txt", handler: resolve("./runtime/server/routes/llms.txt.get") });
959
959
  addServerHandler({ route: "/llms-full.txt", handler: resolve("./runtime/server/routes/llms-full.txt.get") });
960
- addServerHandler({ route: "/__ai-ready/devtools", handler: resolve("./runtime/server/routes/__ai-ready/devtools.get") });
960
+ addServerHandler({ route: "/__ai-ready__/debug.json", handler: resolve("./runtime/server/routes/__ai-ready/devtools.get") });
961
961
  if (config.debug) {
962
962
  addServerHandler({ route: "/__ai-ready-debug", handler: resolve("./runtime/server/routes/__ai-ready-debug.get") });
963
963
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-ai-ready",
3
3
  "type": "module",
4
- "version": "1.3.9",
4
+ "version": "1.4.0",
5
5
  "description": "Best practice AI & LLM discoverability for Nuxt sites.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -57,15 +57,15 @@
57
57
  }
58
58
  },
59
59
  "dependencies": {
60
- "@mdream/js": "^1.2.2",
61
- "@nuxt/kit": "^4.4.7",
60
+ "@mdream/js": "^1.3.0",
61
+ "@nuxt/kit": "^4.4.8",
62
62
  "citty": "^0.2.2",
63
63
  "consola": "^3.4.2",
64
64
  "defu": "^6.1.7",
65
65
  "drizzle-orm": "^0.45.2",
66
- "mdream": "^1.2.2",
67
- "nuxt-site-config": "^4.0.8",
68
- "nuxtseo-shared": "^5.1.3",
66
+ "mdream": "^1.3.0",
67
+ "nuxt-site-config": "^4.1.0",
68
+ "nuxtseo-shared": "^5.2.6",
69
69
  "pathe": "^2.0.3",
70
70
  "pkg-types": "^2.3.1",
71
71
  "site-config-stack": "^4.0.8",
@@ -82,7 +82,7 @@
82
82
  "@nuxtjs/eslint-config-typescript": "^12.1.0",
83
83
  "@nuxtjs/mcp-toolkit": "^0.17.2",
84
84
  "@nuxtjs/robots": "^6.0.9",
85
- "@nuxtjs/sitemap": "^8.0.15",
85
+ "@nuxtjs/sitemap": "^8.2.0",
86
86
  "@types/better-sqlite3": "^7.6.13",
87
87
  "@vitest/coverage-v8": "^4.1.8",
88
88
  "@vue/test-utils": "^2.4.11",
@@ -94,8 +94,9 @@
94
94
  "execa": "^9.6.1",
95
95
  "happy-dom": "^20.10.2",
96
96
  "nitropack": "^2.13.4",
97
- "nuxt": "^4.4.7",
98
- "nuxt-site-config": "^4.0.8",
97
+ "nuxt": "^4.4.8",
98
+ "nuxt-site-config": "^4.1.0",
99
+ "nuxtseo-layer-devtools": "^5.2.6",
99
100
  "playwright": "^1.60.0",
100
101
  "playwright-core": "^1.60.0",
101
102
  "tinyglobby": "^0.2.17",
@@ -104,22 +105,21 @@
104
105
  "vitest": "^4.1.8",
105
106
  "vue": "^3.5.35",
106
107
  "vue-router": "^5.1.0",
107
- "vue-tsc": "^3.3.3",
108
- "wrangler": "^4.98.0",
108
+ "vue-tsc": "^3.3.4",
109
+ "wrangler": "^4.99.0",
109
110
  "zod": "^4.4.3"
110
111
  },
111
112
  "scripts": {
112
113
  "lint": "eslint .",
113
114
  "lint:fix": "eslint . --fix",
114
115
  "build": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build && pnpm run build:devtools",
115
- "build:devtools": "nuxt generate devtools",
116
+ "build:devtools": "node -e \"require('fs').cpSync('devtools','dist/devtools',{recursive:true})\"",
116
117
  "dev": "nuxt dev playground",
117
118
  "dev:minimal": "nuxt dev playground",
118
- "devtools": "nuxt dev devtools --port 3030",
119
119
  "prepare:fixtures": "nuxt prepare playground && nuxt prepare playground && nuxt prepare test/fixtures/basic",
120
120
  "dev:build": "nuxt build playground",
121
121
  "dev:build:minimal": "nuxt build playground",
122
- "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build && nuxt prepare playground",
122
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build && nuxt prepare playground && pnpm run build:devtools",
123
123
  "dev:prepare:minimal": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build && nuxt prepare playground",
124
124
  "release": "pnpm build && bumpp -x \"npx changelogen --output=CHANGELOG.md\"",
125
125
  "test": "pnpm run prepare:fixtures && vitest",
@@ -1 +0,0 @@
1
- <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt-ai-ready/_nuxt/entry.C01PFCnM.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-ai-ready/_nuxt/D9pLQdnz.js"><script type="module" src="/__nuxt-ai-ready/_nuxt/D9pLQdnz.js" crossorigin></script><script>"use strict";(()=>{const t=window,e=document.documentElement,c=["dark","light"],n=getStorageValue("localStorage","nuxt-color-mode")||"system";let i=n==="system"?u():n;const r=e.getAttribute("data-color-mode-forced");r&&(i=r),l(i),t["__NUXT_COLOR_MODE__"]={preference:n,value:i,getColorScheme:u,addColorScheme:l,removeColorScheme:d};function l(o){const s=""+o+"",a="";e.classList?e.classList.add(s):e.className+=" "+s,a&&e.setAttribute("data-"+a,o)}function d(o){const s=""+o+"",a="";e.classList?e.classList.remove(s):e.className=e.className.replace(new RegExp(s,"g"),""),a&&e.removeAttribute("data-"+a)}function f(o){return t.matchMedia("(prefers-color-scheme"+o+")")}function u(){if(t.matchMedia&&f("").media!=="not all"){for(const o of c)if(f(":"+o).matches)return o}return"light"}})();function getStorageValue(t,e){switch(t){case"localStorage":return window.localStorage.getItem(e);case"sessionStorage":return window.sessionStorage.getItem(e);case"cookie":return getCookie(e);default:return null}}function getCookie(t){const c=("; "+window.document.cookie).split("; "+t+"=");if(c.length===2)return c.pop()?.split(";").shift()}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-ai-ready",buildId:"f26345f8-0602-46ab-916a-0529f3a14be9",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1780973881640,false]</script></body></html>
@@ -1 +0,0 @@
1
- <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt-ai-ready/_nuxt/entry.C01PFCnM.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-ai-ready/_nuxt/D9pLQdnz.js"><script type="module" src="/__nuxt-ai-ready/_nuxt/D9pLQdnz.js" crossorigin></script><script>"use strict";(()=>{const t=window,e=document.documentElement,c=["dark","light"],n=getStorageValue("localStorage","nuxt-color-mode")||"system";let i=n==="system"?u():n;const r=e.getAttribute("data-color-mode-forced");r&&(i=r),l(i),t["__NUXT_COLOR_MODE__"]={preference:n,value:i,getColorScheme:u,addColorScheme:l,removeColorScheme:d};function l(o){const s=""+o+"",a="";e.classList?e.classList.add(s):e.className+=" "+s,a&&e.setAttribute("data-"+a,o)}function d(o){const s=""+o+"",a="";e.classList?e.classList.remove(s):e.className=e.className.replace(new RegExp(s,"g"),""),a&&e.removeAttribute("data-"+a)}function f(o){return t.matchMedia("(prefers-color-scheme"+o+")")}function u(){if(t.matchMedia&&f("").media!=="not all"){for(const o of c)if(f(":"+o).matches)return o}return"light"}})();function getStorageValue(t,e){switch(t){case"localStorage":return window.localStorage.getItem(e);case"sessionStorage":return window.sessionStorage.getItem(e);case"cookie":return getCookie(e);default:return null}}function getCookie(t){const c=("; "+window.document.cookie).split("; "+t+"=");if(c.length===2)return c.pop()?.split(";").shift()}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-ai-ready",buildId:"f26345f8-0602-46ab-916a-0529f3a14be9",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1780973881640,false]</script></body></html>
@@ -1 +0,0 @@
1
- import{d as m,o as s,c as a,b as n,a as f,s as u,n as v,t as d,C as l,z as $,e as o,g as p,h as r,D as h}from"./D9pLQdnz.js";const y={class:"devtools-empty"},b={class:"devtools-empty-title"},k={key:0,class:"devtools-empty-description"},g={key:1,class:"devtools-empty-actions"},B=m({__name:"DevtoolsEmptyState",props:{icon:{default:"carbon:search"},title:{},description:{},variant:{default:"default"}},setup(e){return(t,c)=>{const i=u;return s(),a("div",y,[n("div",{class:v(["devtools-empty-icon",`devtools-empty-icon-${e.variant}`])},[f(i,{name:e.icon,class:"w-8 h-8","aria-hidden":"true"},null,8,["name"])],2),n("h2",b,d(e.title),1),e.description||t.$slots.description?(s(),a("p",k,[l(t.$slots,"description",{},()=>[$(d(e.description),1)],!0)])):o("",!0),t.$slots.default?(s(),a("div",g,[l(t.$slots,"default",{},void 0,!0)])):o("",!0)])}}}),j=Object.assign(p(B,[["__scopeId","data-v-2cf7af5e"]]),{__name:"DevtoolsEmptyState"}),C={class:"devtools-panel"},D={key:0,class:"devtools-panel-header"},I={class:"flex items-center gap-2"},N={class:"devtools-panel-title"},S={key:0,class:"devtools-panel-actions"},V=m({__name:"DevtoolsPanel",props:{title:{},closable:{type:Boolean,default:!1},icon:{},padding:{type:Boolean,default:!0}},emits:["close"],setup(e){return(t,c)=>{const i=u,_=h;return s(),a("div",C,[e.title||t.$slots.header?(s(),a("div",D,[l(t.$slots,"header",{},()=>[n("div",I,[e.icon?(s(),r(i,{key:0,name:e.icon,class:"text-sm text-[var(--color-text-muted)]"},null,8,["name"])):o("",!0),n("span",N,d(e.title),1)])],!0),e.closable||t.$slots.actions?(s(),a("div",S,[l(t.$slots,"actions",{},void 0,!0),e.closable?(s(),r(_,{key:0,icon:"carbon:close","aria-label":"Close panel",onClick:c[0]||(c[0]=E=>t.$emit("close"))})):o("",!0)])):o("",!0)])):o("",!0),n("div",{class:v(["devtools-panel-content",e.padding?"p-3":""])},[l(t.$slots,"default",{},void 0,!0)],2)])}}}),z=Object.assign(p(V,[["__scopeId","data-v-99badccb"]]),{__name:"DevtoolsPanel"});export{j as _,z as a};
@@ -1,2 +0,0 @@
1
- import{d as E,i as G,G as L,u as C,j as u,r as T,o as t,c as e,b as n,F as _,k as h,n as q,t as i,l as S,m as I,h as A,w as y,p as K,e as g,a as m,q as M,s as R,_ as U,f as v,v as H}from"./D9pLQdnz.js";import{_ as J}from"./DiEjVMsr.js";import{_ as O,a as Q}from"./B75sBxVw.js";const W={class:"space-y-4"},X={class:"flex items-center gap-2"},Y=["onClick"],Z={key:0,class:"py-8 text-center"},tt={key:0,class:"relative"},et={class:"text-xs font-mono whitespace-pre-wrap p-4 rounded-lg bg-[var(--color-surface-sunken)] text-[var(--color-text)] overflow-auto max-h-[600px]"},ot={key:1,class:"relative"},st={class:"text-xs font-mono whitespace-pre-wrap p-4 rounded-lg bg-[var(--color-surface-sunken)] text-[var(--color-text-muted)] overflow-auto max-h-[600px]"},nt={key:0,class:"space-y-3"},lt={class:"text-sm font-semibold text-[var(--color-text)] mb-1"},at={key:0,class:"space-y-1 mt-2"},rt={class:"font-medium text-[var(--color-text)]"},ct={key:0,class:"text-[var(--color-text-muted)]"},it={class:"font-mono text-[var(--color-text-subtle)]"},ut={key:1,class:"text-xs text-[var(--color-text-muted)]"},vt=E({__name:"llms-txt",setup(dt){const k=G(L),b=v(()=>k?.value?.isDev??!0),x=v(()=>k?.value?.llmsTxt),r=H("llms-txt"),{data:$}=C("llms-txt-content",async()=>{if(!u.value)return null;try{return await u.value("/llms.txt",{responseType:"text"})}catch{return null}},{watch:[u,T]}),{data:N,status:B}=C("llms-full-content",async()=>{if(!u.value||r.value!=="llms-full")return null;try{return await u.value("/llms-full.txt",{responseType:"text"})}catch{return null}},{watch:[u,T,r]}),f=v(()=>r.value==="llms-full"?N.value:$.value),w=v(()=>{const c=x.value;if(!c)return"";const l=["# {Site Name}","","> {Site Description}",""];for(const o of c.sections||[]){if(l.push(`## ${o.title}`),o.description){const s=Array.isArray(o.description)?o.description:[o.description];for(const d of s)l.push("",d)}for(const s of o.links||[]){const d=s.description?`: ${s.description}`:"";l.push(`- [${s.title}](${s.href})${d}`)}l.push("")}if(c.notes){const o=Array.isArray(c.notes)?c.notes:[c.notes];for(const s of o)l.push(s)}return l.join(`
2
- `)});return(c,l)=>{const o=K,s=M,d=J,F=O,P=Q,j=R,V=U;return t(),e("div",W,[n("div",X,[(t(),e(_,null,h([{key:"llms-txt",label:"llms.txt"},{key:"llms-full",label:"llms-full.txt"}],a=>n("button",{key:a.key,type:"button",class:q(["px-3 py-1.5 text-xs font-medium rounded-md transition-all cursor-pointer",r.value===a.key?"bg-[var(--seo-green)] text-white":"bg-[var(--color-surface-elevated)] text-[var(--color-text-muted)] hover:text-[var(--color-text)]"]),onClick:D=>r.value=a.key},i(a.label),11,Y)),64))]),b.value&&!S(I)?(t(),A(o,{key:0,variant:"info"},{default:y(()=>[...l[0]||(l[0]=[n("p",{class:"font-medium mb-1"}," Template Preview ",-1),n("p",{class:"text-sm opacity-80"}," This shows the llms.txt structure from your config. Actual content with page data is generated during prerendering. Switch to production mode to see live content. ",-1)])]),_:1})):g("",!0),m(P,{title:r.value==="llms-txt"?"llms.txt":"llms-full.txt"},{default:y(()=>[r.value==="llms-full"&&S(B)==="pending"?(t(),e("div",Z,[m(s)])):(t(),e(_,{key:1},[f.value?(t(),e("div",tt,[m(d,{text:f.value,class:"absolute top-2 right-2 z-10"},null,8,["text"]),n("pre",et,i(f.value),1)])):b.value&&w.value?(t(),e("div",ot,[n("pre",st,i(w.value),1)])):(t(),A(F,{key:2,icon:"carbon:document",title:"No content available",description:"llms.txt content is generated during prerendering. Run `nuxi generate` or switch to production mode."}))],64))]),_:1},8,["title"]),m(V,{text:"Configured Sections",icon:"carbon:list-boxes"},{default:y(()=>[x.value?.sections?.length?(t(),e("div",nt,[(t(!0),e(_,null,h(x.value.sections,(a,D)=>(t(),e("div",{key:D,class:"p-3 rounded-lg bg-[var(--color-surface-elevated)] border border-[var(--color-border)]"},[n("h4",lt,i(a.title),1),a.links?.length?(t(),e("div",at,[(t(!0),e(_,null,h(a.links,(p,z)=>(t(),e("div",{key:z,class:"flex items-start gap-2 text-xs"},[m(j,{name:"carbon:link",class:"w-3 h-3 mt-0.5 text-[var(--color-text-muted)]"}),n("div",null,[n("span",rt,i(p.title),1),p.description?(t(),e("span",ct,", "+i(p.description),1)):g("",!0),n("div",it,i(p.href),1)])]))),128))])):g("",!0)]))),128))])):(t(),e("p",ut," No custom sections configured. "))]),_:1})])}}});export{vt as default};
@@ -1 +0,0 @@
1
- import{d as s,o as t,c as n,b as l,g as r,h as a}from"./D9pLQdnz.js";const _={class:"h-full max-h-full overflow-hidden"},u=["src","title"],i=s({__name:"DevtoolsDocs",props:{url:{}},setup(e){return(c,o)=>(t(),n("div",_,[l("iframe",{src:e.url,title:`Documentation - ${e.url}`,class:"w-full h-full border-none",style:{"min-height":"calc(100vh - 100px)"}},null,8,u)]))}}),m=Object.assign(i,{__name:"DevtoolsDocs"}),d={};function f(e,c){const o=m;return t(),a(o,{url:"https://nuxtseo.com/ai-ready"})}const p=r(d,[["render",f]]);export{p as default};