nuxt-ai-ready 2.3.0 → 2.3.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.
|
@@ -2,7 +2,7 @@ import { createHash } from 'node:crypto';
|
|
|
2
2
|
import { realpath, readFile, readdir } from 'node:fs/promises';
|
|
3
3
|
import { resolve, isAbsolute, join, 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.CWJ1a7_y.mjs';
|
|
6
6
|
import 'node:module';
|
|
7
7
|
import '@nuxt/kit';
|
|
8
8
|
import 'defu';
|
|
@@ -257,9 +257,9 @@ async function resolveAgentSkillsConfig(config, rootDir, options = {}) {
|
|
|
257
257
|
for (const route of result.routes)
|
|
258
258
|
localArtifacts[route] = result.content;
|
|
259
259
|
const [alias] = result.routes.slice(1).sort((a, b) => a.length - b.length);
|
|
260
|
-
links.push({ name: result.entry.name, description: result.entry.description, href: alias ?? result.routes[0] });
|
|
260
|
+
links.push({ source: "local", name: result.entry.name, description: result.entry.description, href: alias ?? result.routes[0] });
|
|
261
261
|
} else {
|
|
262
|
-
links.push({ name: result.entry.name, description: result.entry.description, href: result.entry.url });
|
|
262
|
+
links.push({ source: "external", name: result.entry.name, description: result.entry.description, href: result.entry.url });
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
return {
|
|
@@ -5,7 +5,7 @@ import { colorize } from 'consola/utils';
|
|
|
5
5
|
import { resolveLocaleFromRoute } from 'nuxtseo-shared/i18n-runtime';
|
|
6
6
|
import { collectSitemap } from 'sitemapd/parse';
|
|
7
7
|
import { withLeadingSlash, joinURL, withBase } from 'ufo';
|
|
8
|
-
import { l as logger, s as supportsNativeNodeSqlite, M as MARKDOWN_LINK_AVAILABILITY_FILE } from '../shared/nuxt-ai-ready.
|
|
8
|
+
import { l as logger, s as supportsNativeNodeSqlite, M as MARKDOWN_LINK_AVAILABILITY_FILE } from '../shared/nuxt-ai-ready.CWJ1a7_y.mjs';
|
|
9
9
|
import { normalizePagePath, toMarkdownPath } from '../../dist/runtime/markdown-path.js';
|
|
10
10
|
import { toDeployedRoute, toLogicalRoute } from '../../dist/runtime/route-path.js';
|
|
11
11
|
import { initSchema, computeContentHash, insertPage, queryAllPages, exportDbDump } from '../../dist/runtime/server/db/shared.js';
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import 'defu';
|
|
|
7
7
|
import 'nuxt-site-config/kit';
|
|
8
8
|
import 'nuxtseo-shared/kit';
|
|
9
9
|
import 'pkg-types';
|
|
10
|
-
export { m as default } from './shared/nuxt-ai-ready.
|
|
10
|
+
export { m as default } from './shared/nuxt-ai-ready.CWJ1a7_y.mjs';
|
|
11
11
|
import '../dist/runtime/markdown-path.js';
|
|
12
12
|
import '../dist/runtime/server/utils/sitemap-md.js';
|
|
13
13
|
import '../dist/runtime/server/utils/discovery-response.js';
|
|
@@ -278,6 +278,20 @@ declare module '#ai-ready-virtual/agent-skills.mjs' {
|
|
|
278
278
|
const AGENT_SKILLS_SCHEMA = "https://schemas.agentskills.io/discovery/0.2.0/schema.json";
|
|
279
279
|
const AGENT_SKILLS_INDEX_ROUTE = "/.well-known/agent-skills/index.json";
|
|
280
280
|
const AGENT_SKILLS_CACHE_CONTROL = "public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400";
|
|
281
|
+
function resolveExternalSkillUrl(href, indexUrl) {
|
|
282
|
+
const normalized = href.replaceAll(/[\t\n\r]/g, "");
|
|
283
|
+
if (URL.canParse(normalized))
|
|
284
|
+
return new URL(normalized).href;
|
|
285
|
+
if (normalized.startsWith("//")) {
|
|
286
|
+
const resolved2 = new URL(normalized, "https://nuxt-ai-ready.invalid");
|
|
287
|
+
const auth = resolved2.username || resolved2.password ? `${resolved2.username}${resolved2.password ? `:${resolved2.password}` : ""}@` : "";
|
|
288
|
+
return `//${auth}${resolved2.host}${resolved2.pathname}${resolved2.search}${resolved2.hash}`;
|
|
289
|
+
}
|
|
290
|
+
if (URL.canParse(indexUrl))
|
|
291
|
+
return new URL(normalized, indexUrl).href;
|
|
292
|
+
const resolved = new URL(normalized, new URL(indexUrl, "https://nuxt-ai-ready.invalid"));
|
|
293
|
+
return `${resolved.pathname}${resolved.search}${resolved.hash}`;
|
|
294
|
+
}
|
|
281
295
|
|
|
282
296
|
const AI_CATALOG_PATH = "/.well-known/ai-catalog.json";
|
|
283
297
|
function resolveAiCatalog(input) {
|
|
@@ -1354,7 +1368,7 @@ ${details}`);
|
|
|
1354
1368
|
description: `Skills an agent can install from this site. The index at ${indexUrl} carries a sha256 digest for each one.`,
|
|
1355
1369
|
links: agentSkillsResult.links.map((link) => ({
|
|
1356
1370
|
title: link.name,
|
|
1357
|
-
href: link.
|
|
1371
|
+
href: link.source === "local" ? withSiteUrl(link.href.slice(1), { withBase: true }) : resolveExternalSkillUrl(link.href, indexUrl),
|
|
1358
1372
|
description: link.description
|
|
1359
1373
|
}))
|
|
1360
1374
|
});
|