@farming-labs/theme 0.2.104 → 0.2.105
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/docs-api.mjs +38 -25
- package/package.json +2 -2
package/dist/docs-api.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { BoundedRouteCache } from "./bounded-route-cache.mjs";
|
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import matter from "gray-matter";
|
|
7
|
-
import { DEFAULT_A2A_AGENT_CARD_ROUTE, DEFAULT_AGENT_SKILLS_ARCHIVE_ROUTE_PATTERN, DEFAULT_AGENT_SKILLS_INDEX_ROUTE, DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, DEFAULT_API_CATALOG_ROUTE, DEFAULT_LEGACY_SKILLS_INDEX_ROUTE, DEFAULT_SITEMAP_MD_DOCS_ROUTE, DOCS_AGENT_MANIFEST_FORMAT, DOCS_AGENT_MANIFEST_SCHEMA_URI, DOCS_AGENT_MANIFEST_VERSION, DOCS_CONTENT_CHANGES_FORMAT, DOCS_CONTENT_CHANGES_RESPONSE_VALUE, DOCS_MARKDOWN_SECTION_INDEX_FORMAT, acceptsDocsMarkdown, buildDocsAskAIContext, buildDocsConfigMap, buildDocsDiagnostics, buildDocsSearchFacets, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsCacheableResponse, createDocsContentChangeFeed, createDocsContentChangesHttpResponse, createDocsMarkdownResponse, createDocsRobotsResponse, createDocsSitemapResponse, createDocsStandardsDiscoveryResponse, detectDocsMarkdownAgentRequest, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsTelemetryAgentSurfaceEvent, emitDocsTelemetryProjectEvent, formatDocsAskAIPackageHints, getDocsAgentManifestLinkHeader, getDocsDiscoveryLinkHeader, getDocsLlmsTxtMaxCharsIssue, getDocsMcpProtectedResourceMetadataRoutes, hasDocsMarkdownSignatureAgent, inferDocsTelemetryAgentSurface, isDocsConfigRequest, isDocsContentChangesRequest, isDocsDiagnosticsRequest, normalizeDocsOkfTrustMetadataInput, normalizeDocsRelated, normalizePageAgentFrontmatter, performDocsSearch, performDocsSearchWithMetadata, renderDocsLlmsTxt, renderDocsMarkdownDocument, resolveAskAISearchRequestConfig, resolveChangelogConfig, resolveDocsAgentContractMcpTools, resolveDocsAudienceMdxContent, resolveDocsContentChangesConfig, resolveDocsI18n, resolveDocsLlmsTxtRequest, resolveDocsLlmsTxtSections, resolveDocsLocale, resolveDocsMetadataBaseUrl, resolveDocsPublishedAgentSkill, resolveDocsRequestApiRoute, resolveDocsRetrievalLastModified, resolveDocsSearchAudience, resolveDocsSearchError, resolveDocsSearchRequest, resolveDocsSitemapConfig, resolveDocsStandardsDiscoveryRequest, resolvePageSidebarFolderIndexBehavior, resolveSearchRequestConfig, selectDocsLlmsTxtContent, stripGeneratedAgentProvenance } from "@farming-labs/docs";
|
|
7
|
+
import { DEFAULT_A2A_AGENT_CARD_ROUTE, DEFAULT_AGENT_SKILLS_ARCHIVE_ROUTE_PATTERN, DEFAULT_AGENT_SKILLS_INDEX_ROUTE, DEFAULT_AGENT_SKILLS_ROUTE_PREFIX, DEFAULT_API_CATALOG_ROUTE, DEFAULT_LEGACY_SKILLS_INDEX_ROUTE, DEFAULT_SITEMAP_MD_DOCS_ROUTE, DOCS_AGENT_MANIFEST_FORMAT, DOCS_AGENT_MANIFEST_SCHEMA_URI, DOCS_AGENT_MANIFEST_VERSION, DOCS_CONTENT_CHANGES_FORMAT, DOCS_CONTENT_CHANGES_RESPONSE_VALUE, DOCS_MARKDOWN_SECTION_INDEX_FORMAT, acceptsDocsMarkdown, buildDocsAskAIContext, buildDocsConfigMap, buildDocsDiagnostics, buildDocsSearchFacets, compactDocsAgentDiscoverySpec, createDocsAgentTraceContext, createDocsAgentTraceId, createDocsCacheableResponse, createDocsContentChangeFeed, createDocsContentChangesHttpResponse, createDocsMarkdownResponse, createDocsRobotsResponse, createDocsSitemapResponse, createDocsStandardsDiscoveryResponse, detectDocsMarkdownAgentRequest, emitDocsAgentTraceEvent, emitDocsAnalyticsEvent, emitDocsTelemetryAgentSurfaceEvent, emitDocsTelemetryProjectEvent, formatDocsAskAIPackageHints, getDocsAgentManifestLinkHeader, getDocsDiscoveryLinkHeader, getDocsLlmsTxtMaxCharsIssue, getDocsMcpProtectedResourceMetadataRoutes, hasDocsMarkdownSignatureAgent, inferDocsTelemetryAgentSurface, isDocsConfigRequest, isDocsContentChangesRequest, isDocsDiagnosticsRequest, normalizeDocsOkfTrustMetadataInput, normalizeDocsRelated, normalizePageAgentFrontmatter, performDocsSearch, performDocsSearchWithMetadata, renderDocsLlmsTxt, renderDocsMarkdownDocument, resolveAskAISearchRequestConfig, resolveChangelogConfig, resolveDocsAgentContractMcpTools, resolveDocsAudienceMdxContent, resolveDocsContentChangesConfig, resolveDocsI18n, resolveDocsLlmsTxtRequest, resolveDocsLlmsTxtSections, resolveDocsLocale, resolveDocsMetadataBaseUrl, resolveDocsPublishedAgentSkill, resolveDocsRequestApiRoute, resolveDocsRetrievalLastModified, resolveDocsSearchAudience, resolveDocsSearchError, resolveDocsSearchRequest, resolveDocsSitemapConfig, resolveDocsStandardsDiscoveryRequest, resolvePageSidebarFolderIndexBehavior, resolveSearchRequestConfig, selectDocsLlmsTxtContent, stripGeneratedAgentProvenance } from "@farming-labs/docs";
|
|
8
8
|
import { buildApiReferenceOpenApiDocumentAsync, createDocsMcpHttpHandler, createFilesystemDocsMcpSource, readDocsSitemapManifest, resolveApiReferenceConfig, resolveApiReferenceOpenApiDiscovery, resolveConfiguredAgentSkills, resolveDocsMcpConfig } from "@farming-labs/docs/server";
|
|
9
9
|
|
|
10
10
|
//#region src/docs-api.ts
|
|
@@ -214,6 +214,12 @@ function buildAgentSpec({ origin, entry, apiRoute, apiCatalog, i18n, search, con
|
|
|
214
214
|
format: DOCS_AGENT_MANIFEST_FORMAT,
|
|
215
215
|
version: DOCS_AGENT_MANIFEST_VERSION,
|
|
216
216
|
name: "@farming-labs/docs",
|
|
217
|
+
profile: "full",
|
|
218
|
+
profiles: {
|
|
219
|
+
default: "full",
|
|
220
|
+
full: DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
221
|
+
compact: `${DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE}?profile=compact`
|
|
222
|
+
},
|
|
217
223
|
baseUrl: origin,
|
|
218
224
|
site: {
|
|
219
225
|
title: llms.siteTitle ?? "Documentation",
|
|
@@ -2777,7 +2783,8 @@ function createDocsAPI(options) {
|
|
|
2777
2783
|
sitemap: sitemapConfig,
|
|
2778
2784
|
okf: options?.agent?.okf
|
|
2779
2785
|
}),
|
|
2780
|
-
lastModified: resolveDocsRetrievalLastModified(page, "agent")
|
|
2786
|
+
lastModified: resolveDocsRetrievalLastModified(page, "agent"),
|
|
2787
|
+
access: page.agent?.access
|
|
2781
2788
|
};
|
|
2782
2789
|
}
|
|
2783
2790
|
const fallbackPage = getIndexes(ctx).find((page) => {
|
|
@@ -2791,7 +2798,8 @@ function createDocsAPI(options) {
|
|
|
2791
2798
|
sitemap: sitemapConfig,
|
|
2792
2799
|
okf: options?.agent?.okf
|
|
2793
2800
|
}),
|
|
2794
|
-
lastModified: resolveDocsRetrievalLastModified(fallbackPage, "agent")
|
|
2801
|
+
lastModified: resolveDocsRetrievalLastModified(fallbackPage, "agent"),
|
|
2802
|
+
access: fallbackPage.agent?.access
|
|
2795
2803
|
};
|
|
2796
2804
|
const requestedSlug = normalizePublicDocsSlug(ctx, normalizedPublicRequest);
|
|
2797
2805
|
for (const page of getIndexes(ctx)) if (normalizePublicDocsSlug(ctx, page.url) === requestedSlug) return {
|
|
@@ -2801,7 +2809,8 @@ function createDocsAPI(options) {
|
|
|
2801
2809
|
sitemap: sitemapConfig,
|
|
2802
2810
|
okf: options?.agent?.okf
|
|
2803
2811
|
}),
|
|
2804
|
-
lastModified: resolveDocsRetrievalLastModified(page, "agent")
|
|
2812
|
+
lastModified: resolveDocsRetrievalLastModified(page, "agent"),
|
|
2813
|
+
access: page.agent?.access
|
|
2805
2814
|
};
|
|
2806
2815
|
return null;
|
|
2807
2816
|
}
|
|
@@ -2937,31 +2946,34 @@ function createDocsAPI(options) {
|
|
|
2937
2946
|
method: requestMethod
|
|
2938
2947
|
}
|
|
2939
2948
|
});
|
|
2949
|
+
const fullSpec = buildAgentSpec({
|
|
2950
|
+
origin: url.origin,
|
|
2951
|
+
entry,
|
|
2952
|
+
apiRoute: requestApiRoute,
|
|
2953
|
+
apiCatalog: apiCatalogEnabled,
|
|
2954
|
+
i18n,
|
|
2955
|
+
search: searchConfig,
|
|
2956
|
+
contentChanges: contentChangesConfig.enabled,
|
|
2957
|
+
mcp: mcpConfig,
|
|
2958
|
+
feedback: agentFeedbackConfig,
|
|
2959
|
+
llms: llmsConfig,
|
|
2960
|
+
sitemap: sitemapConfig,
|
|
2961
|
+
robots: robotsConfig,
|
|
2962
|
+
openapi: openapiDiscovery,
|
|
2963
|
+
publishedSkills: [await resolveDocsPublishedAgentSkill({
|
|
2964
|
+
preferredDocument: readRootSkillDocument(),
|
|
2965
|
+
fallbackDocument: getGeneratedSkillDocument(url.origin, requestApiRoute)
|
|
2966
|
+
}), ...await getPublishedAgentSkills()],
|
|
2967
|
+
agentCard: options?.agent?.a2a
|
|
2968
|
+
});
|
|
2969
|
+
const compact = url.searchParams.get("profile") === "compact";
|
|
2970
|
+
const spec = compact ? compactDocsAgentDiscoverySpec(fullSpec) : fullSpec;
|
|
2940
2971
|
return createDocsCacheableResponse({
|
|
2941
2972
|
request,
|
|
2942
|
-
content: `${JSON.stringify(
|
|
2943
|
-
origin: url.origin,
|
|
2944
|
-
entry,
|
|
2945
|
-
apiRoute: requestApiRoute,
|
|
2946
|
-
apiCatalog: apiCatalogEnabled,
|
|
2947
|
-
i18n,
|
|
2948
|
-
search: searchConfig,
|
|
2949
|
-
contentChanges: contentChangesConfig.enabled,
|
|
2950
|
-
mcp: mcpConfig,
|
|
2951
|
-
feedback: agentFeedbackConfig,
|
|
2952
|
-
llms: llmsConfig,
|
|
2953
|
-
sitemap: sitemapConfig,
|
|
2954
|
-
robots: robotsConfig,
|
|
2955
|
-
openapi: openapiDiscovery,
|
|
2956
|
-
publishedSkills: [await resolveDocsPublishedAgentSkill({
|
|
2957
|
-
preferredDocument: readRootSkillDocument(),
|
|
2958
|
-
fallbackDocument: getGeneratedSkillDocument(url.origin, requestApiRoute)
|
|
2959
|
-
}), ...await getPublishedAgentSkills()],
|
|
2960
|
-
agentCard: options?.agent?.a2a
|
|
2961
|
-
}), null, 2)}\n`,
|
|
2973
|
+
content: `${JSON.stringify(spec, null, compact ? void 0 : 2)}\n`,
|
|
2962
2974
|
headers: {
|
|
2963
2975
|
"Content-Type": "application/json; charset=utf-8",
|
|
2964
|
-
"Cache-Control": "public, max-age=0, s-maxage=3600",
|
|
2976
|
+
"Cache-Control": "public, max-age=0, s-maxage=3600, stale-while-revalidate=86400",
|
|
2965
2977
|
Link: agentManifestLinkHeader,
|
|
2966
2978
|
"X-Robots-Tag": "noindex"
|
|
2967
2979
|
}
|
|
@@ -3187,6 +3199,7 @@ function createDocsAPI(options) {
|
|
|
3187
3199
|
canonicalUrl,
|
|
3188
3200
|
locale: ctx.locale,
|
|
3189
3201
|
lastModified: representation?.lastModified,
|
|
3202
|
+
access: representation?.access,
|
|
3190
3203
|
sitemap: sitemapConfig
|
|
3191
3204
|
});
|
|
3192
3205
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/theme",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.105",
|
|
4
4
|
"description": "Theme package for @farming-labs/docs — layout, provider, MDX components, and styles",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
"tsdown": "^0.20.3",
|
|
162
162
|
"typescript": "^5.9.3",
|
|
163
163
|
"vitest": "^4.1.8",
|
|
164
|
-
"@farming-labs/docs": "0.2.
|
|
164
|
+
"@farming-labs/docs": "0.2.105"
|
|
165
165
|
},
|
|
166
166
|
"peerDependencies": {
|
|
167
167
|
"@farming-labs/docs": ">=0.0.1",
|