nuxt-ai-ready 3.5.1 → 3.6.1
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/chunks/agent-skills.mjs +5 -3
- package/dist/chunks/prerender.mjs +48 -24
- package/dist/cli.mjs +5 -5
- package/dist/module.d.mts +4 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +5 -3
- package/dist/runtime/ai-terms.d.ts +76 -0
- package/dist/runtime/ai-terms.js +1 -0
- package/dist/runtime/app/plugins/md-alternate.server.js +11 -3
- package/dist/runtime/llms-txt-utils.js +2 -1
- package/dist/runtime/server/db/schema/postgres.d.ts +8 -0
- package/dist/runtime/server/db/schema/sqlite.d.ts +8 -0
- package/dist/runtime/server/middleware/markdown.js +13 -175
- package/dist/runtime/server/middleware/render-markdown.d.ts +2 -0
- package/dist/runtime/server/middleware/render-markdown.js +163 -0
- package/dist/runtime/server/plugins/ai-terms.d.ts +2 -0
- package/dist/runtime/server/plugins/ai-terms.js +11 -0
- package/dist/runtime/server/plugins/markdown-negotiation.js +11 -1
- package/dist/runtime/server/routes/ai-terms.d.ts +2 -0
- package/dist/runtime/server/routes/ai-terms.js +22 -0
- package/dist/runtime/server/routes/api-catalog.js +6 -2
- package/dist/runtime/server/routes/llms.txt.get.js +3 -0
- package/dist/runtime/server/utils/auth.d.ts +1 -3
- package/dist/runtime/server/utils/auth.js +55 -25
- package/dist/runtime/server/utils/cloudflare-prerendered.d.ts +1 -1
- package/dist/runtime/server/utils/cloudflare-prerendered.js +17 -15
- package/dist/runtime/server/utils/link-header.d.ts +4 -0
- package/dist/runtime/server/utils/link-header.js +6 -2
- package/dist/runtime/server/utils/negotiation-decision.d.ts +4 -0
- package/dist/runtime/server/utils/negotiation-decision.js +8 -1
- package/dist/runtime/server/utils/negotiation-response.d.ts +3 -1
- package/dist/runtime/server/utils/negotiation-response.js +31 -9
- package/dist/runtime/sync-secret.d.ts +1 -0
- package/dist/runtime/sync-secret.js +2 -1
- package/dist/runtime/types.d.ts +12 -0
- package/dist/shared/{nuxt-ai-ready.BaNK8yfw.mjs → nuxt-ai-ready.Bzx0dNWj.mjs} +324 -36
- package/dist/shared/{nuxt-ai-ready.B3hAuOLQ.mjs → nuxt-ai-ready.DCd-1s1G.mjs} +1 -1
- package/dist/types.d.mts +2 -0
- package/package.json +31 -31
- package/skills/nuxt-ai-ready/SKILL.md +52 -96
- package/dist/cli.d.mts +0 -1
|
@@ -2,15 +2,18 @@ import { createHash } from 'node:crypto';
|
|
|
2
2
|
import { realpath, readFile, readdir } from 'node:fs/promises';
|
|
3
3
|
import { join, resolve, isAbsolute, relative, sep } from 'node:path';
|
|
4
4
|
import { parseDocument } from 'yaml';
|
|
5
|
-
import { A as AGENT_SKILLS_SCHEMA } from '../shared/nuxt-ai-ready.
|
|
5
|
+
import { A as AGENT_SKILLS_SCHEMA } from '../shared/nuxt-ai-ready.Bzx0dNWj.mjs';
|
|
6
6
|
import 'node:module';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import '@nuxt/kit';
|
|
9
9
|
import 'defu';
|
|
10
10
|
import 'nuxt-site-config/kit';
|
|
11
11
|
import 'nuxtseo-shared/kit';
|
|
12
|
-
import '
|
|
12
|
+
import 'nuxtseo-shared/server';
|
|
13
|
+
import 'ufo';
|
|
14
|
+
import '../shared/nuxt-ai-ready.DCd-1s1G.mjs';
|
|
13
15
|
import 'node:fs';
|
|
16
|
+
import '../../dist/runtime/ai-terms.js';
|
|
14
17
|
import '../../dist/runtime/llms-txt-files.js';
|
|
15
18
|
import '../../dist/runtime/route-path.js';
|
|
16
19
|
import '../../dist/runtime/server/utils/sitemap-md.js';
|
|
@@ -19,7 +22,6 @@ import '../../dist/runtime/cache-control.js';
|
|
|
19
22
|
import '../../dist/runtime/server/utils/discovery-response.js';
|
|
20
23
|
import 'confbox';
|
|
21
24
|
import '../../dist/runtime/markdown-path.js';
|
|
22
|
-
import 'nuxtseo-shared/server';
|
|
23
25
|
import '../../dist/runtime/server/utils/content-negotiation.js';
|
|
24
26
|
import 'pathe';
|
|
25
27
|
import 'nuxtseo-shared/i18n';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { mkdir, writeFile, appendFile, readFile,
|
|
1
|
+
import { mkdir, writeFile, appendFile, readFile, readdir, stat } from 'node:fs/promises';
|
|
2
2
|
import { resolve, relative, join, dirname } from 'node:path';
|
|
3
3
|
import { useNuxt, getNitroVersion, hasNuxtModule, resolveFiles } from '@nuxt/kit';
|
|
4
4
|
import { colorize } from 'consola/utils';
|
|
5
5
|
import { resolveLocaleFromRoute } from 'nuxtseo-shared/i18n-runtime';
|
|
6
6
|
import { createPrerenderFetch } from 'nuxtseo-shared/prerender';
|
|
7
7
|
import { collectSitemap } from 'sitemapd/parse';
|
|
8
|
-
import { parseURL, withLeadingSlash, joinURL, withBase } from 'ufo';
|
|
9
|
-
import { l as logger, m as matchingStaticContentSignals, M as MARKDOWN_LINK_AVAILABILITY_FILE } from '../shared/nuxt-ai-ready.
|
|
8
|
+
import { parseURL, withLeadingSlash, decodePath, joinURL, withBase } from 'ufo';
|
|
9
|
+
import { l as logger, m as matchingStaticContentSignals, M as MARKDOWN_LINK_AVAILABILITY_FILE } from '../shared/nuxt-ai-ready.Bzx0dNWj.mjs';
|
|
10
10
|
import { toLogicalRoute, toDeployedRoute } from '../../dist/runtime/route-path.js';
|
|
11
11
|
import { insertLlmsTxtDirective } from '../../dist/runtime/llms-txt-directive.js';
|
|
12
12
|
import { absoluteSiteUrl } from '../../dist/runtime/markdown-links.js';
|
|
13
|
-
import { normalizePagePath, hasMarkdownTwin, toMarkdownPath } from '../../dist/runtime/markdown-path.js';
|
|
13
|
+
import { normalizePagePath, markdownAlternatePath, hasMarkdownTwin, toMarkdownPath } from '../../dist/runtime/markdown-path.js';
|
|
14
14
|
import { initSchema, computeContentHash, insertPage, queryAllPages, exportDbDump } from '../../dist/runtime/server/db/shared.js';
|
|
15
15
|
import { buildLlmsFullTxtHeader, formatPageForLlmsFullTxt } from '../../dist/runtime/server/utils/llms-full.js';
|
|
16
16
|
import { resolvePageUpdatedAt } from '../../dist/runtime/server/utils/page-updated-at.js';
|
|
@@ -20,15 +20,16 @@ import 'node:url';
|
|
|
20
20
|
import 'defu';
|
|
21
21
|
import 'nuxt-site-config/kit';
|
|
22
22
|
import 'nuxtseo-shared/kit';
|
|
23
|
-
import '
|
|
23
|
+
import 'nuxtseo-shared/server';
|
|
24
|
+
import '../shared/nuxt-ai-ready.DCd-1s1G.mjs';
|
|
24
25
|
import 'node:fs';
|
|
26
|
+
import '../../dist/runtime/ai-terms.js';
|
|
25
27
|
import '../../dist/runtime/llms-txt-files.js';
|
|
26
28
|
import '../../dist/runtime/sync-secret.js';
|
|
27
29
|
import '../../dist/runtime/cache-control.js';
|
|
28
30
|
import 'node:crypto';
|
|
29
31
|
import '../../dist/runtime/server/utils/discovery-response.js';
|
|
30
32
|
import 'confbox';
|
|
31
|
-
import 'nuxtseo-shared/server';
|
|
32
33
|
import '../../dist/runtime/server/utils/content-negotiation.js';
|
|
33
34
|
import 'pathe';
|
|
34
35
|
import 'nuxtseo-shared/i18n';
|
|
@@ -66,6 +67,7 @@ const RE_INDEX_SUFFIX = /\/index$/;
|
|
|
66
67
|
const RE_MD_EXT = /\.md$/;
|
|
67
68
|
const RE_NEGATED_GLOB = /^(!?)(.*)$/;
|
|
68
69
|
const RE_PARENT_DIR_GLOB = /!?\.\.\//;
|
|
70
|
+
const RE_MARKDOWN_ALTERNATE_TAG = /<link\b[^>]*\sdata-ai-ready-markdown(?:="")?(?=[\s/>])[^>]*>/g;
|
|
69
71
|
async function findOutputMarkdownPaths(publicDir, baseURL, srcDir, ignoredPaths, publicAssets) {
|
|
70
72
|
const paths = /* @__PURE__ */ new Set();
|
|
71
73
|
async function visit(directory, urlBase, relativeDirectory = "") {
|
|
@@ -516,6 +518,28 @@ function setupPrerenderHandler(options, dbPath, siteInfo, llmsTxtConfig, extras)
|
|
|
516
518
|
route.contentType = "text/markdown; charset=utf-8";
|
|
517
519
|
state.totalProcessingTime += Date.now() - pageStartTime;
|
|
518
520
|
});
|
|
521
|
+
async function snapshotMarkdownPaths() {
|
|
522
|
+
const { baseURL, ignore, output, publicAssets, rootDir, srcDir, serverDir } = nitro.options;
|
|
523
|
+
const ignoreBaseDir = srcDir || serverDir || rootDir;
|
|
524
|
+
const paths = await findOutputMarkdownPaths(output.publicDir, baseURL, ignoreBaseDir, ignore, publicAssets);
|
|
525
|
+
if (!extras.onMarkdownPaths)
|
|
526
|
+
return paths;
|
|
527
|
+
extras.onMarkdownPaths(paths);
|
|
528
|
+
const available = new Set(paths.map(decodePath));
|
|
529
|
+
for (const { route, fileName } of nitro._prerenderedRoutes || []) {
|
|
530
|
+
if (!fileName?.endsWith(".html"))
|
|
531
|
+
continue;
|
|
532
|
+
const alternate = markdownAlternatePath(route);
|
|
533
|
+
if (!alternate || available.has(decodePath(toDeployedRoute(alternate, baseURL))))
|
|
534
|
+
continue;
|
|
535
|
+
const file = resolvePrerenderFile(output.publicDir, fileName);
|
|
536
|
+
const html = await readFile(file, "utf8");
|
|
537
|
+
const updated = html.replace(RE_MARKDOWN_ALTERNATE_TAG, "");
|
|
538
|
+
if (html !== updated)
|
|
539
|
+
await writeFile(file, updated, "utf8");
|
|
540
|
+
}
|
|
541
|
+
return paths;
|
|
542
|
+
}
|
|
519
543
|
async function writeLlmsFiles() {
|
|
520
544
|
if (state.db && state.errorRoutes.size > 0) {
|
|
521
545
|
for (const route of state.errorRoutes) {
|
|
@@ -572,21 +596,15 @@ function setupPrerenderHandler(options, dbPath, siteInfo, llmsTxtConfig, extras)
|
|
|
572
596
|
logger.debug(`Wrote build metadata: buildId=${buildId}`);
|
|
573
597
|
}
|
|
574
598
|
}
|
|
575
|
-
if (state.dbPath && state.llmsTxtConfig?.markdownLinks) {
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
nitro.options.publicAssets
|
|
585
|
-
);
|
|
586
|
-
await writeFile(availabilityFile, JSON.stringify({
|
|
587
|
-
runtimeMarkdownAvailable: !nitro.options.static,
|
|
588
|
-
paths
|
|
589
|
-
}), "utf-8");
|
|
599
|
+
if (extras.onMarkdownPaths || state.dbPath && state.llmsTxtConfig?.markdownLinks) {
|
|
600
|
+
const paths = await snapshotMarkdownPaths();
|
|
601
|
+
if (state.dbPath && state.llmsTxtConfig?.markdownLinks) {
|
|
602
|
+
const availabilityFile = join(dirname(state.dbPath), MARKDOWN_LINK_AVAILABILITY_FILE);
|
|
603
|
+
await writeFile(availabilityFile, JSON.stringify({
|
|
604
|
+
runtimeMarkdownAvailable: !nitro.options.static && !extras.onMarkdownPaths,
|
|
605
|
+
paths
|
|
606
|
+
}), "utf-8");
|
|
607
|
+
}
|
|
590
608
|
}
|
|
591
609
|
let llmsSize = 0;
|
|
592
610
|
if (options.llmsTxt !== false) {
|
|
@@ -633,8 +651,11 @@ function setupPrerenderHandler(options, dbPath, siteInfo, llmsTxtConfig, extras)
|
|
|
633
651
|
logger.debug(`Prerender hooks: sitemap=${useSitemapHook}, prerender=${usePrerenderHook}`);
|
|
634
652
|
if (useSitemapHook) {
|
|
635
653
|
nuxt.hooks.hook("sitemap:prerender:done", async (ctx) => (async () => {
|
|
636
|
-
if (!state.initialized)
|
|
654
|
+
if (!state.initialized) {
|
|
655
|
+
if (extras.onMarkdownPaths)
|
|
656
|
+
await snapshotMarkdownPaths();
|
|
637
657
|
return;
|
|
658
|
+
}
|
|
638
659
|
const documents = new Map(ctx.sitemaps.map((sitemap) => [toLogicalRoute(sitemap.name, nitro.options.baseURL), () => sitemap.content]));
|
|
639
660
|
await crawlConfiguredSitemaps(state, nuxt, nitro, ctx.options, documents);
|
|
640
661
|
await writeLlmsFiles();
|
|
@@ -642,10 +663,13 @@ function setupPrerenderHandler(options, dbPath, siteInfo, llmsTxtConfig, extras)
|
|
|
642
663
|
if (state.db)
|
|
643
664
|
await state.db.close?.();
|
|
644
665
|
})().finally(() => prerenderClient?.close()));
|
|
645
|
-
} else if (usePrerenderHook) {
|
|
666
|
+
} else if (usePrerenderHook || extras.onMarkdownPaths) {
|
|
646
667
|
nitro.hooks.hook("prerender:done", async () => (async () => {
|
|
647
|
-
if (!state.initialized)
|
|
668
|
+
if (!state.initialized) {
|
|
669
|
+
if (extras.onMarkdownPaths)
|
|
670
|
+
await snapshotMarkdownPaths();
|
|
648
671
|
return;
|
|
672
|
+
}
|
|
649
673
|
await crawlConfiguredSitemaps(state, nuxt, nitro, nuxt.options.sitemap || {});
|
|
650
674
|
await writeLlmsFiles();
|
|
651
675
|
state.prerenderedRoutes.clear();
|
package/dist/cli.mjs
CHANGED
|
@@ -6,11 +6,11 @@ import { consola } from 'consola';
|
|
|
6
6
|
import { colors } from 'consola/utils';
|
|
7
7
|
import { resolve, join } from 'pathe';
|
|
8
8
|
import { joinURL } from 'ufo';
|
|
9
|
-
import { r as readPackageMetadata } from './shared/nuxt-ai-ready.
|
|
10
|
-
import { deriveRuntimeSyncSecret, LEGACY_RUNTIME_SYNC_SECRET_WARNING } from '../dist/runtime/sync-secret.js';
|
|
11
|
-
import 'node:module';
|
|
9
|
+
import { r as readPackageMetadata } from './shared/nuxt-ai-ready.DCd-1s1G.mjs';
|
|
10
|
+
import { APPLICATION_SECRET_ERROR, deriveRuntimeSyncSecret, LEGACY_RUNTIME_SYNC_SECRET_WARNING } from '../dist/runtime/sync-secret.js';
|
|
12
11
|
import 'node:path';
|
|
13
12
|
import 'node:url';
|
|
13
|
+
import 'nuxtseo-shared/kit';
|
|
14
14
|
|
|
15
15
|
const capabilities = ["llms", "api-catalog", "ai-catalog", "mcp", "skills"];
|
|
16
16
|
function publicUrl(input, base) {
|
|
@@ -269,7 +269,7 @@ function authHeaders(secret) {
|
|
|
269
269
|
async function requireSecret(cwd) {
|
|
270
270
|
const secret = await getSecret(cwd);
|
|
271
271
|
if (!secret) {
|
|
272
|
-
throw new Error(
|
|
272
|
+
throw new Error(`${APPLICATION_SECRET_ERROR} For development, run nuxt dev to cache the runtime sync token.`);
|
|
273
273
|
}
|
|
274
274
|
return secret;
|
|
275
275
|
}
|
|
@@ -524,7 +524,7 @@ const main = defineCommand({
|
|
|
524
524
|
const cwd = resolve(args.cwd || ".");
|
|
525
525
|
const secret = await getSecret(cwd);
|
|
526
526
|
if (!secret && !args.dry) {
|
|
527
|
-
throw new Error(
|
|
527
|
+
throw new Error(`${APPLICATION_SECRET_ERROR} For development, run nuxt dev to cache the runtime sync token.`);
|
|
528
528
|
}
|
|
529
529
|
const params = new URLSearchParams();
|
|
530
530
|
if (args.dry)
|
package/dist/module.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
import { ResolvedAiTermsConfig } from '../dist/runtime/ai-terms.js';
|
|
3
|
+
export { AiTermsAccess, AiTermsConfig, AiTermsDocument, AiTermsFreeAllowance, AiTermsPath, AiTermsPayment, AiTermsPrice, AiTermsPurpose, AiTermsUse } from '../dist/runtime/ai-terms.js';
|
|
2
4
|
import { LlmsTxtConfig, AgentSkillConfig, ContentNegotiationPolicy, ModuleOptions } from '../dist/runtime/types.js';
|
|
3
5
|
export { AgentSkillConfig, AgentSkillsConfig, AgentSkillsIndex, AgentSkillsIndexEntry, ApiCatalogConfig, ApiCatalogEntry, ApiCatalogLinkTarget, ApiCatalogLinks, ExternalAgentSkillConfig, LocalAgentSkillConfig, McpServerCardConfig, ModuleOptions } from '../dist/runtime/types.js';
|
|
4
6
|
import { RuntimeI18nConfig } from 'nuxtseo-shared/i18n-runtime';
|
|
@@ -94,6 +96,7 @@ declare module '@nuxt/schema' {
|
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
98
|
interface ModulePublicRuntimeConfig {
|
|
99
|
+
/** @deprecated The generated fallback paths are bundled with the Worker. */
|
|
97
100
|
cloudflarePrerenderedPages?: string[];
|
|
98
101
|
debug: boolean;
|
|
99
102
|
debugCron: boolean;
|
|
@@ -122,6 +125,7 @@ interface ModulePublicRuntimeConfig {
|
|
|
122
125
|
etag: string;
|
|
123
126
|
};
|
|
124
127
|
apiCatalog?: ResolvedApiCatalogConfig;
|
|
128
|
+
aiTerms?: ResolvedAiTermsConfig;
|
|
125
129
|
}
|
|
126
130
|
/** Runtime config exposed to the browser, only set when WebMCP is enabled. */
|
|
127
131
|
interface ModuleAppRuntimeConfig {
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -6,8 +6,11 @@ import '@nuxt/kit';
|
|
|
6
6
|
import 'defu';
|
|
7
7
|
import 'nuxt-site-config/kit';
|
|
8
8
|
import 'nuxtseo-shared/kit';
|
|
9
|
-
|
|
10
|
-
import '
|
|
9
|
+
import 'nuxtseo-shared/server';
|
|
10
|
+
import 'ufo';
|
|
11
|
+
export { a as default } from './shared/nuxt-ai-ready.Bzx0dNWj.mjs';
|
|
12
|
+
import './shared/nuxt-ai-ready.DCd-1s1G.mjs';
|
|
13
|
+
import '../dist/runtime/ai-terms.js';
|
|
11
14
|
import '../dist/runtime/llms-txt-files.js';
|
|
12
15
|
import '../dist/runtime/route-path.js';
|
|
13
16
|
import '../dist/runtime/server/utils/sitemap-md.js';
|
|
@@ -17,7 +20,6 @@ import '../dist/runtime/cache-control.js';
|
|
|
17
20
|
import 'node:crypto';
|
|
18
21
|
import 'confbox';
|
|
19
22
|
import '../dist/runtime/markdown-path.js';
|
|
20
|
-
import 'nuxtseo-shared/server';
|
|
21
23
|
import '../dist/runtime/server/utils/content-negotiation.js';
|
|
22
24
|
import 'pathe';
|
|
23
25
|
import 'nuxtseo-shared/i18n';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export type AiTermsPurpose = 'search' | 'answer' | 'training' | 'agent';
|
|
2
|
+
export type AiTermsAccess = 'allow' | 'paid' | 'deny';
|
|
3
|
+
export interface AiTermsPrice {
|
|
4
|
+
amount: string;
|
|
5
|
+
currency: 'USD';
|
|
6
|
+
per: 'page' | 'request';
|
|
7
|
+
}
|
|
8
|
+
interface AiTermsUseBase {
|
|
9
|
+
attribution?: 'required' | 'requested' | 'none';
|
|
10
|
+
}
|
|
11
|
+
export type AiTermsUse = AiTermsUseBase & ({
|
|
12
|
+
access: 'allow';
|
|
13
|
+
price?: never;
|
|
14
|
+
free?: never;
|
|
15
|
+
} | {
|
|
16
|
+
access: 'deny';
|
|
17
|
+
price?: never;
|
|
18
|
+
free?: AiTermsFreeAllowance;
|
|
19
|
+
} | {
|
|
20
|
+
access: 'paid';
|
|
21
|
+
price: AiTermsPrice;
|
|
22
|
+
free?: AiTermsFreeAllowance;
|
|
23
|
+
});
|
|
24
|
+
export interface AiTermsFreeAllowance {
|
|
25
|
+
requests: number;
|
|
26
|
+
per: 'hour' | 'day';
|
|
27
|
+
}
|
|
28
|
+
export interface AiTermsPayment {
|
|
29
|
+
protocol: 'x402';
|
|
30
|
+
/** Absolute HTTPS URL without credentials, query parameters, or a fragment. */
|
|
31
|
+
endpoint: string;
|
|
32
|
+
version?: number;
|
|
33
|
+
network?: string;
|
|
34
|
+
asset?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface AiTermsPath {
|
|
37
|
+
match: string;
|
|
38
|
+
uses: Partial<Record<AiTermsPurpose, AiTermsUse>>;
|
|
39
|
+
payment?: AiTermsPayment;
|
|
40
|
+
}
|
|
41
|
+
/** Explicit AI Terms 0.1 policy. Publishing does not enforce the policy. */
|
|
42
|
+
export interface AiTermsConfig {
|
|
43
|
+
/** Date of the last policy change, in YYYY-MM-DD format. */
|
|
44
|
+
updated: string;
|
|
45
|
+
uses: Record<AiTermsPurpose, AiTermsUse>;
|
|
46
|
+
/** Access for a client that declares no purpose. */
|
|
47
|
+
default: AiTermsAccess;
|
|
48
|
+
paths?: AiTermsPath[];
|
|
49
|
+
payment?: AiTermsPayment;
|
|
50
|
+
identity?: {
|
|
51
|
+
verify?: string[];
|
|
52
|
+
unverified?: string;
|
|
53
|
+
};
|
|
54
|
+
receipts?: string;
|
|
55
|
+
report_only?: boolean;
|
|
56
|
+
contact?: {
|
|
57
|
+
licensing?: string;
|
|
58
|
+
};
|
|
59
|
+
preview?: {
|
|
60
|
+
shows?: Array<'title' | 'description' | 'excerpt' | 'words'>;
|
|
61
|
+
delivery: 'must-match' | 'per-quote' | 'not-checked';
|
|
62
|
+
described_quote?: string;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface AiTermsDocument extends AiTermsConfig {
|
|
66
|
+
ai_terms: '0.1';
|
|
67
|
+
site: string;
|
|
68
|
+
purpose_header: 'AI-Purpose';
|
|
69
|
+
spec: 'https://aipaygen.com/ai-terms';
|
|
70
|
+
}
|
|
71
|
+
export interface ResolvedAiTermsConfig {
|
|
72
|
+
href: string;
|
|
73
|
+
document: AiTermsDocument;
|
|
74
|
+
}
|
|
75
|
+
export declare const AI_TERMS_PATH = "/.well-known/ai-terms";
|
|
76
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const AI_TERMS_PATH = "/.well-known/ai-terms";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineNuxtPlugin, useHead, useRequestURL, useRuntimeConfig } from "nuxt/app";
|
|
1
|
+
import { defineNuxtPlugin, useHead, useRequestEvent, useRequestURL, useRuntimeConfig } from "nuxt/app";
|
|
2
2
|
import { joinURL } from "ufo";
|
|
3
3
|
import { markdownAlternatePath } from "../../markdown-path.js";
|
|
4
4
|
export default defineNuxtPlugin({
|
|
@@ -9,10 +9,18 @@ export default defineNuxtPlugin({
|
|
|
9
9
|
if (!markdownPath)
|
|
10
10
|
return;
|
|
11
11
|
const runtimeConfig = useRuntimeConfig();
|
|
12
|
-
const
|
|
12
|
+
const config = runtimeConfig["nuxt-ai-ready"];
|
|
13
|
+
const describedby = config?.describedby !== false;
|
|
14
|
+
const markdownAvailable = useRequestEvent()?.context.aiReadyMarkdownAvailable !== false;
|
|
15
|
+
const markdownLink = {
|
|
16
|
+
rel: "alternate",
|
|
17
|
+
type: "text/markdown",
|
|
18
|
+
href: markdownPath,
|
|
19
|
+
...import.meta.prerender && config?.zeroRuntimeMarkdown && { "data-ai-ready-markdown": "" }
|
|
20
|
+
};
|
|
13
21
|
useHead({
|
|
14
22
|
link: [
|
|
15
|
-
|
|
23
|
+
...markdownAvailable ? [markdownLink] : [],
|
|
16
24
|
...describedby ? [{ rel: "describedby", href: joinURL(runtimeConfig.app.baseURL, "llms.txt") }] : []
|
|
17
25
|
]
|
|
18
26
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { decodePath } from "ufo";
|
|
2
|
+
import prerenderedMarkdownPaths from "#ai-ready-virtual/prerendered-markdown-paths.mjs";
|
|
2
3
|
import { createError, getRequestHost, getRequestURL } from "#nuxtseo/h3";
|
|
3
4
|
import { useRuntimeConfig } from "#nuxtseo/nitro";
|
|
4
5
|
import { getSiteConfig } from "#site-config/server/composables/getSiteConfig";
|
|
@@ -12,7 +13,7 @@ import { fetchSitemapUrlGroups, getSitemapsFromConfig } from "./server/utils/sit
|
|
|
12
13
|
export { normalizeLlmsTxtConfig } from "./llms-txt-format.js";
|
|
13
14
|
async function findMarkdownLinkAvailability() {
|
|
14
15
|
if (!import.meta.prerender)
|
|
15
|
-
return { runtimeMarkdownAvailable:
|
|
16
|
+
return { runtimeMarkdownAvailable: prerenderedMarkdownPaths === null, paths: prerenderedMarkdownPaths ?? /* @__PURE__ */ new Set() };
|
|
16
17
|
const { readMarkdownLinkAvailabilityFromFilesystem } = await import("#ai-ready-virtual/read-page-data.mjs");
|
|
17
18
|
const availability = await readMarkdownLinkAvailabilityFromFilesystem();
|
|
18
19
|
return {
|
|
@@ -259,6 +259,7 @@ export declare const pages: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
259
259
|
}>;
|
|
260
260
|
};
|
|
261
261
|
dialect: "pg";
|
|
262
|
+
isAlias: false;
|
|
262
263
|
}>;
|
|
263
264
|
export declare const info: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
264
265
|
name: "_ai_ready_info";
|
|
@@ -341,6 +342,7 @@ export declare const info: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
341
342
|
}>;
|
|
342
343
|
};
|
|
343
344
|
dialect: "pg";
|
|
345
|
+
isAlias: false;
|
|
344
346
|
}>;
|
|
345
347
|
export declare const cronRuns: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
346
348
|
name: "ai_ready_cron_runs";
|
|
@@ -468,6 +470,7 @@ export declare const cronRuns: import("drizzle-orm/pg-core").PgTableWithColumns<
|
|
|
468
470
|
}>;
|
|
469
471
|
};
|
|
470
472
|
dialect: "pg";
|
|
473
|
+
isAlias: false;
|
|
471
474
|
}>;
|
|
472
475
|
export declare const sitemaps: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
473
476
|
name: "ai_ready_sitemaps";
|
|
@@ -580,6 +583,7 @@ export declare const sitemaps: import("drizzle-orm/pg-core").PgTableWithColumns<
|
|
|
580
583
|
}>;
|
|
581
584
|
};
|
|
582
585
|
dialect: "pg";
|
|
586
|
+
isAlias: false;
|
|
583
587
|
}>;
|
|
584
588
|
export declare const schema: {
|
|
585
589
|
pages: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
@@ -843,6 +847,7 @@ export declare const schema: {
|
|
|
843
847
|
}>;
|
|
844
848
|
};
|
|
845
849
|
dialect: "pg";
|
|
850
|
+
isAlias: false;
|
|
846
851
|
}>;
|
|
847
852
|
info: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
848
853
|
name: "_ai_ready_info";
|
|
@@ -925,6 +930,7 @@ export declare const schema: {
|
|
|
925
930
|
}>;
|
|
926
931
|
};
|
|
927
932
|
dialect: "pg";
|
|
933
|
+
isAlias: false;
|
|
928
934
|
}>;
|
|
929
935
|
cronRuns: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
930
936
|
name: "ai_ready_cron_runs";
|
|
@@ -1052,6 +1058,7 @@ export declare const schema: {
|
|
|
1052
1058
|
}>;
|
|
1053
1059
|
};
|
|
1054
1060
|
dialect: "pg";
|
|
1061
|
+
isAlias: false;
|
|
1055
1062
|
}>;
|
|
1056
1063
|
sitemaps: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
1057
1064
|
name: "ai_ready_sitemaps";
|
|
@@ -1164,5 +1171,6 @@ export declare const schema: {
|
|
|
1164
1171
|
}>;
|
|
1165
1172
|
};
|
|
1166
1173
|
dialect: "pg";
|
|
1174
|
+
isAlias: false;
|
|
1167
1175
|
}>;
|
|
1168
1176
|
};
|
|
@@ -276,6 +276,7 @@ export declare const pages: import("drizzle-orm/sqlite-core").SQLiteTableWithCol
|
|
|
276
276
|
}, {}>;
|
|
277
277
|
};
|
|
278
278
|
dialect: "sqlite";
|
|
279
|
+
isAlias: false;
|
|
279
280
|
}>;
|
|
280
281
|
export declare const info: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
281
282
|
name: "_ai_ready_info";
|
|
@@ -363,6 +364,7 @@ export declare const info: import("drizzle-orm/sqlite-core").SQLiteTableWithColu
|
|
|
363
364
|
}, {}>;
|
|
364
365
|
};
|
|
365
366
|
dialect: "sqlite";
|
|
367
|
+
isAlias: false;
|
|
366
368
|
}>;
|
|
367
369
|
export declare const cronRuns: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
368
370
|
name: "ai_ready_cron_runs";
|
|
@@ -498,6 +500,7 @@ export declare const cronRuns: import("drizzle-orm/sqlite-core").SQLiteTableWith
|
|
|
498
500
|
}, {}>;
|
|
499
501
|
};
|
|
500
502
|
dialect: "sqlite";
|
|
503
|
+
isAlias: false;
|
|
501
504
|
}>;
|
|
502
505
|
export declare const sitemaps: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
503
506
|
name: "ai_ready_sitemaps";
|
|
@@ -617,6 +620,7 @@ export declare const sitemaps: import("drizzle-orm/sqlite-core").SQLiteTableWith
|
|
|
617
620
|
}, {}>;
|
|
618
621
|
};
|
|
619
622
|
dialect: "sqlite";
|
|
623
|
+
isAlias: false;
|
|
620
624
|
}>;
|
|
621
625
|
export declare const schema: {
|
|
622
626
|
pages: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
@@ -897,6 +901,7 @@ export declare const schema: {
|
|
|
897
901
|
}, {}>;
|
|
898
902
|
};
|
|
899
903
|
dialect: "sqlite";
|
|
904
|
+
isAlias: false;
|
|
900
905
|
}>;
|
|
901
906
|
info: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
902
907
|
name: "_ai_ready_info";
|
|
@@ -984,6 +989,7 @@ export declare const schema: {
|
|
|
984
989
|
}, {}>;
|
|
985
990
|
};
|
|
986
991
|
dialect: "sqlite";
|
|
992
|
+
isAlias: false;
|
|
987
993
|
}>;
|
|
988
994
|
cronRuns: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
989
995
|
name: "ai_ready_cron_runs";
|
|
@@ -1119,6 +1125,7 @@ export declare const schema: {
|
|
|
1119
1125
|
}, {}>;
|
|
1120
1126
|
};
|
|
1121
1127
|
dialect: "sqlite";
|
|
1128
|
+
isAlias: false;
|
|
1122
1129
|
}>;
|
|
1123
1130
|
sitemaps: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
1124
1131
|
name: "ai_ready_sitemaps";
|
|
@@ -1238,5 +1245,6 @@ export declare const schema: {
|
|
|
1238
1245
|
}, {}>;
|
|
1239
1246
|
};
|
|
1240
1247
|
dialect: "sqlite";
|
|
1248
|
+
isAlias: false;
|
|
1241
1249
|
}>;
|
|
1242
1250
|
};
|