@farming-labs/svelte 0.2.83 → 0.2.85
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/server.js +28 -24
- package/package.json +2 -2
package/dist/server.js
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
import fs from "node:fs";
|
|
31
31
|
import path from "node:path";
|
|
32
32
|
import matter from "gray-matter";
|
|
33
|
-
import { applySidebarFolderIndexBehavior, buildDocsAskAIContext, buildDocsSearchFacets, buildDocsAgentDiscoverySpec, buildDocsConfigMap, buildDocsDiagnostics, createDocsContentChangeFeed, createDocsContentChangesHttpResponse, createDocsStandardsDiscoveryResponse, createDocsMarkdownResponse, createDocsRobotsResponse, createDocsSitemapResponse, createDocsAgentTraceContext, createDocsAgentTraceId, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsTelemetryAgentSurfaceEvent, emitDocsTelemetryProjectEvent, formatDocsAskAIPackageHints, findDocsMarkdownPage, getDocsLlmsTxtMaxCharsIssue, getDocsAgentManifestLinkHeader, getDocsDiscoveryLinkHeader, isDocsAgentDiscoveryRequest, isDocsContentChangesRequest, isDocsAgentsRequest, isDocsConfigRequest, isDocsDiagnosticsRequest, isDocsSkillRequest, normalizeDocsRelated, normalizePageAgentFrontmatter, parseDocsAgentFeedbackData, performDocsSearch, performDocsSearchWithMetadata, renderDocsMarkdownDocument, renderDocsLlmsTxt, renderDocsAgentsDocument, renderDocsSkillDocument, readDocsSitemapManifestFromContentMap, stripGeneratedAgentProvenance, resolveDocsAudienceMdxContent, resolveDocsAgentFeedbackConfig, resolveDocsAgentFeedbackRequest, resolvePageSidebarFolderIndexBehavior, resolveAskAISearchRequestConfig, resolveDocsSearchAudience, resolveDocsSearchError, resolveDocsSearchRequest, resolveSearchRequestConfig, resolveDocsI18n, resolveDocsLlmsTxtRequest, resolveDocsLocale, resolveDocsMarkdownRequest, resolveDocsMetadataBaseUrl, resolveDocsContentChangesConfig, resolveDocsRequestApiRoute, resolveDocsRetrievalLastModified, resolveDocsPublishedAgentSkill, resolveDocsStandardsDiscoveryRequest, resolveDocsPath, resolvePageReadingTime, resolveReadingTimeOptions, resolveDocsSitemapPageLastmod, resolveDocsAgentsFormat, resolveDocsSkillFormat, inferDocsTelemetryAgentSurface, renderDocsPageStructuredDataJson, selectDocsLlmsTxtContent, validateDocsAgentFeedbackPayload, } from "@farming-labs/docs";
|
|
33
|
+
import { applySidebarFolderIndexBehavior, buildDocsAskAIContext, buildDocsSearchFacets, buildDocsAgentDiscoverySpec, buildDocsConfigMap, buildDocsDiagnostics, createDocsContentChangeFeed, createDocsContentChangesHttpResponse, createDocsCacheableResponse, createDocsStandardsDiscoveryResponse, createDocsMarkdownResponse, createDocsRobotsResponse, createDocsSitemapResponse, createDocsAgentTraceContext, createDocsAgentTraceId, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsTelemetryAgentSurfaceEvent, emitDocsTelemetryProjectEvent, formatDocsAskAIPackageHints, findDocsMarkdownPage, getDocsLlmsTxtMaxCharsIssue, getDocsAgentManifestLinkHeader, getDocsDiscoveryLinkHeader, isDocsAgentDiscoveryRequest, isDocsContentChangesRequest, isDocsAgentsRequest, isDocsConfigRequest, isDocsDiagnosticsRequest, isDocsSkillRequest, normalizeDocsRelated, normalizePageAgentFrontmatter, parseDocsAgentFeedbackData, performDocsSearch, performDocsSearchWithMetadata, renderDocsMarkdownDocument, renderDocsLlmsTxt, renderDocsAgentsDocument, renderDocsSkillDocument, readDocsSitemapManifestFromContentMap, stripGeneratedAgentProvenance, resolveDocsAudienceMdxContent, resolveDocsAgentFeedbackConfig, resolveDocsAgentFeedbackRequest, resolvePageSidebarFolderIndexBehavior, resolveAskAISearchRequestConfig, resolveDocsSearchAudience, resolveDocsSearchError, resolveDocsSearchRequest, resolveSearchRequestConfig, resolveDocsI18n, resolveDocsLlmsTxtRequest, resolveDocsLocale, resolveDocsMarkdownRequest, resolveDocsMetadataBaseUrl, resolveDocsContentChangesConfig, resolveDocsRequestApiRoute, resolveDocsRetrievalLastModified, resolveDocsPublishedAgentSkill, resolveDocsStandardsDiscoveryRequest, resolveDocsPath, resolvePageReadingTime, resolveReadingTimeOptions, resolveDocsSitemapPageLastmod, resolveDocsAgentsFormat, resolveDocsSkillFormat, inferDocsTelemetryAgentSurface, renderDocsPageStructuredDataJson, selectDocsLlmsTxtContent, validateDocsAgentFeedbackPayload, } from "@farming-labs/docs";
|
|
34
34
|
import { buildApiReferenceOpenApiDocumentAsync, createDocsCloudAskAIResponse, createDocsMcpHttpHandler, isDocsCloudAskAIProvider, readDocsSitemapManifest, resolveApiReferenceOpenApiDiscovery, resolveDocsMcpConfig, resolveConfiguredAgentSkills, serializeDocsIconRegistry, serializeOpenDocsProviders, } from "@farming-labs/docs/server";
|
|
35
35
|
import { loadDocsNavTree, loadDocsContent, flattenNavTree, normalizeDocsFrontmatterLastmod, } from "./content.js";
|
|
36
36
|
import { renderMarkdown } from "./markdown.js";
|
|
@@ -798,19 +798,20 @@ export function createDocsServer(config = {}) {
|
|
|
798
798
|
if (standardsDiscoveryResponse)
|
|
799
799
|
return standardsDiscoveryResponse;
|
|
800
800
|
if (isDocsAgentDiscoveryRequest(event.url, { apiRoute: discoveryApiRoute })) {
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
:
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
801
|
+
const content = `${JSON.stringify(buildDocsAgentDiscoverySpec({
|
|
802
|
+
...discoveryOptions,
|
|
803
|
+
publishedSkills: [
|
|
804
|
+
await resolveDocsPublishedAgentSkill({
|
|
805
|
+
preferredDocument: readRootSkillDocument(preloaded, rootDir),
|
|
806
|
+
fallbackDocument: renderDocsSkillDocument(discoveryOptions),
|
|
807
|
+
}),
|
|
808
|
+
...(await getPublishedAgentSkills()),
|
|
809
|
+
],
|
|
810
|
+
agentCard: config.agent?.a2a,
|
|
811
|
+
}), null, 2)}\n`;
|
|
812
|
+
return createDocsCacheableResponse({
|
|
813
|
+
request: event.request,
|
|
814
|
+
content,
|
|
814
815
|
headers: {
|
|
815
816
|
"Content-Type": "application/json; charset=utf-8",
|
|
816
817
|
"Cache-Control": "public, max-age=0, s-maxage=3600",
|
|
@@ -888,10 +889,10 @@ export function createDocsServer(config = {}) {
|
|
|
888
889
|
}
|
|
889
890
|
if (isDocsAgentsRequest(event.url, { apiRoute: discoveryApiRoute }) ||
|
|
890
891
|
resolveDocsAgentsFormat(event.url) === "agents") {
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
:
|
|
894
|
-
|
|
892
|
+
const content = readRootAgentsDocument(preloaded, rootDir) ?? renderDocsAgentsDocument(discoveryOptions);
|
|
893
|
+
return createDocsCacheableResponse({
|
|
894
|
+
request: event.request,
|
|
895
|
+
content,
|
|
895
896
|
headers: {
|
|
896
897
|
"Content-Type": "text/markdown; charset=utf-8",
|
|
897
898
|
"Cache-Control": "public, max-age=0, s-maxage=3600",
|
|
@@ -902,10 +903,10 @@ export function createDocsServer(config = {}) {
|
|
|
902
903
|
}
|
|
903
904
|
if (isDocsSkillRequest(event.url, { apiRoute: discoveryApiRoute }) ||
|
|
904
905
|
resolveDocsSkillFormat(event.url) === "skill") {
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
:
|
|
908
|
-
|
|
906
|
+
const content = readRootSkillDocument(preloaded, rootDir) ?? renderDocsSkillDocument(discoveryOptions);
|
|
907
|
+
return createDocsCacheableResponse({
|
|
908
|
+
request: event.request,
|
|
909
|
+
content,
|
|
909
910
|
headers: {
|
|
910
911
|
"Content-Type": "text/markdown; charset=utf-8",
|
|
911
912
|
"Cache-Control": "public, max-age=0, s-maxage=3600",
|
|
@@ -992,7 +993,9 @@ export function createDocsServer(config = {}) {
|
|
|
992
993
|
if (budgetIssue?.mode === "warn") {
|
|
993
994
|
console.warn(`[docs] ${budgetIssue.message}`);
|
|
994
995
|
}
|
|
995
|
-
return
|
|
996
|
+
return createDocsCacheableResponse({
|
|
997
|
+
request: event.request,
|
|
998
|
+
content: selected.content,
|
|
996
999
|
headers: {
|
|
997
1000
|
"Content-Type": "text/plain; charset=utf-8",
|
|
998
1001
|
"Cache-Control": "public, max-age=3600",
|
|
@@ -1011,7 +1014,7 @@ export function createDocsServer(config = {}) {
|
|
|
1011
1014
|
throw error;
|
|
1012
1015
|
return Response.json({ error: searchError }, { status: 400 });
|
|
1013
1016
|
}
|
|
1014
|
-
const { filters, structured, facets, facet, cursor, limit } = searchRequest;
|
|
1017
|
+
const { filters, structured, explain, facets, facet, cursor, limit } = searchRequest;
|
|
1015
1018
|
if (!query && !structured && !facets) {
|
|
1016
1019
|
return new Response("[]", {
|
|
1017
1020
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1025,6 +1028,7 @@ export function createDocsServer(config = {}) {
|
|
|
1025
1028
|
}),
|
|
1026
1029
|
audience,
|
|
1027
1030
|
filters,
|
|
1031
|
+
explain,
|
|
1028
1032
|
locale: ctx.locale,
|
|
1029
1033
|
pathname: event.url.searchParams.get("pathname") ?? undefined,
|
|
1030
1034
|
siteTitle: llmsTitle,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/svelte",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.85",
|
|
4
4
|
"description": "SvelteKit adapter for @farming-labs/docs — content loading and navigation utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@types/node": "^22.10.0",
|
|
58
58
|
"typescript": "^5.9.3",
|
|
59
59
|
"vitest": "^4.1.8",
|
|
60
|
-
"@farming-labs/docs": "0.2.
|
|
60
|
+
"@farming-labs/docs": "0.2.85"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@farming-labs/docs": ">=0.2.73"
|