@farming-labs/theme 0.1.30 → 0.1.32
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 +29 -5
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +2 -1
- package/dist/mdx.d.mts +1 -1
- package/dist/mdx.mjs +1 -1
- package/package.json +2 -2
package/dist/docs-api.mjs
CHANGED
|
@@ -34,6 +34,12 @@ const FILE_EXTS = [
|
|
|
34
34
|
];
|
|
35
35
|
const DEFAULT_DOCS_API_ROUTE = "/api/docs";
|
|
36
36
|
const DEFAULT_AGENT_SPEC_ROUTE = "/api/docs/agent/spec";
|
|
37
|
+
const DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE = "/.well-known/agent";
|
|
38
|
+
const DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE = "/.well-known/agent.json";
|
|
39
|
+
const DEFAULT_LLMS_TXT_ROUTE = "/llms.txt";
|
|
40
|
+
const DEFAULT_LLMS_FULL_TXT_ROUTE = "/llms-full.txt";
|
|
41
|
+
const DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE = "/.well-known/llms.txt";
|
|
42
|
+
const DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE = "/.well-known/llms-full.txt";
|
|
37
43
|
const DEFAULT_AGENT_FEEDBACK_ROUTE = "/api/docs/agent/feedback";
|
|
38
44
|
const DEFAULT_AGENT_FEEDBACK_PAYLOAD_SCHEMA = {
|
|
39
45
|
type: "object",
|
|
@@ -147,7 +153,8 @@ function resolveAgentFeedbackRequest(url, feedback) {
|
|
|
147
153
|
}
|
|
148
154
|
function resolveAgentSpecRequest(url) {
|
|
149
155
|
if (url.searchParams.get("agent")?.trim() === "spec") return true;
|
|
150
|
-
|
|
156
|
+
const pathname = normalizeUrlPath(url.pathname);
|
|
157
|
+
return pathname === DEFAULT_AGENT_SPEC_ROUTE || pathname === DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE || pathname === DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE;
|
|
151
158
|
}
|
|
152
159
|
function isSearchEnabled(search) {
|
|
153
160
|
if (search === false) return false;
|
|
@@ -189,6 +196,10 @@ function buildAgentSpec({ origin, entry, i18n, search, mcp, feedback, llms }) {
|
|
|
189
196
|
api: {
|
|
190
197
|
docs: DEFAULT_DOCS_API_ROUTE,
|
|
191
198
|
agentSpec: DEFAULT_AGENT_SPEC_ROUTE,
|
|
199
|
+
agentSpecDefault: DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
200
|
+
agentSpecFallback: DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE,
|
|
201
|
+
agentSpecWellKnown: DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE,
|
|
202
|
+
agentSpecWellKnownJson: DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
|
|
192
203
|
agentSpecQuery: `${DEFAULT_DOCS_API_ROUTE}?agent=spec`
|
|
193
204
|
},
|
|
194
205
|
markdown: {
|
|
@@ -205,8 +216,14 @@ function buildAgentSpec({ origin, entry, i18n, search, mcp, feedback, llms }) {
|
|
|
205
216
|
},
|
|
206
217
|
llms: {
|
|
207
218
|
enabled: llms.enabled,
|
|
219
|
+
defaultTxt: DEFAULT_LLMS_TXT_ROUTE,
|
|
220
|
+
defaultFull: DEFAULT_LLMS_FULL_TXT_ROUTE,
|
|
208
221
|
txt: `${DEFAULT_DOCS_API_ROUTE}?format=llms`,
|
|
209
|
-
full: `${DEFAULT_DOCS_API_ROUTE}?format=llms-full
|
|
222
|
+
full: `${DEFAULT_DOCS_API_ROUTE}?format=llms-full`,
|
|
223
|
+
publicTxt: DEFAULT_LLMS_TXT_ROUTE,
|
|
224
|
+
publicFull: DEFAULT_LLMS_FULL_TXT_ROUTE,
|
|
225
|
+
wellKnownTxt: DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE,
|
|
226
|
+
wellKnownFull: DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE
|
|
210
227
|
},
|
|
211
228
|
search: {
|
|
212
229
|
enabled: searchEnabled,
|
|
@@ -768,6 +785,13 @@ function resolveMarkdownRequest(entry, url, request) {
|
|
|
768
785
|
}
|
|
769
786
|
return null;
|
|
770
787
|
}
|
|
788
|
+
function resolveLlmsTxtFormat(url) {
|
|
789
|
+
const pathname = normalizeUrlPath(url.pathname);
|
|
790
|
+
if (pathname === DEFAULT_LLMS_TXT_ROUTE || pathname === DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE) return "llms";
|
|
791
|
+
if (pathname === DEFAULT_LLMS_FULL_TXT_ROUTE || pathname === DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE) return "llms-full";
|
|
792
|
+
const format = url.searchParams.get("format");
|
|
793
|
+
return format === "llms" || format === "llms-full" ? format : null;
|
|
794
|
+
}
|
|
771
795
|
function renderMarkdownDocument(page) {
|
|
772
796
|
if ("agentRawContent" in page && page.agentRawContent !== void 0) return page.agentRawContent;
|
|
773
797
|
const lines = [`# ${page.title}`, `URL: ${page.url}`];
|
|
@@ -1088,12 +1112,12 @@ function createDocsAPI(options) {
|
|
|
1088
1112
|
"X-Robots-Tag": "noindex"
|
|
1089
1113
|
} });
|
|
1090
1114
|
}
|
|
1091
|
-
const
|
|
1092
|
-
if (
|
|
1115
|
+
const llmsFormat = resolveLlmsTxtFormat(url);
|
|
1116
|
+
if (llmsFormat === "llms") return new Response(getLlmsContent(ctx).llmsTxt, { headers: {
|
|
1093
1117
|
"Content-Type": "text/plain; charset=utf-8",
|
|
1094
1118
|
"Cache-Control": "public, max-age=3600"
|
|
1095
1119
|
} });
|
|
1096
|
-
if (
|
|
1120
|
+
if (llmsFormat === "llms-full") return new Response(getLlmsContent(ctx).llmsFullTxt, { headers: {
|
|
1097
1121
|
"Content-Type": "text/plain; charset=utf-8",
|
|
1098
1122
|
"Cache-Control": "public, max-age=3600"
|
|
1099
1123
|
} });
|
package/dist/index.d.mts
CHANGED
|
@@ -11,9 +11,10 @@ import { DocsFeedback, DocsFeedbackProps } from "./docs-feedback.mjs";
|
|
|
11
11
|
import { PageActions } from "./page-actions.mjs";
|
|
12
12
|
import { withLangInUrl } from "./i18n.mjs";
|
|
13
13
|
import { HoverLink, HoverLinkProps } from "./hover-link.mjs";
|
|
14
|
+
import { Agent } from "./mdx.mjs";
|
|
14
15
|
import { DocsLayout } from "fumadocs-ui/layouts/docs";
|
|
15
16
|
import { AIConfig, BreadcrumbConfig, ChangelogConfig, ChangelogFrontmatter, CopyMarkdownConfig, DocsConfig, DocsFeedbackData, DocsFeedbackValue, DocsMetadata, DocsNav, DocsTheme, FeedbackConfig, FontStyle, OGConfig, OpenDocsConfig, OpenDocsProvider, PageActionsConfig, PageFrontmatter, SidebarConfig, ThemeToggleConfig, TypographyConfig, UIConfig, createTheme, deepMerge, defineDocs, extendTheme } from "@farming-labs/docs";
|
|
16
17
|
import { DocsBody, DocsPage } from "fumadocs-ui/layouts/docs/page";
|
|
17
18
|
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
|
|
18
19
|
import { CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, Pre } from "fumadocs-ui/components/codeblock";
|
|
19
|
-
export { type AIConfig, type BreadcrumbConfig, type ChangelogConfig, type ChangelogFrontmatter, CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, CommandGridUIDefaults, ConcreteUIDefaults, type CopyMarkdownConfig, DocsBody, DocsClientHooks, DocsCommandSearch, type DocsConfig, DocsFeedback, type DocsFeedbackData, type DocsFeedbackProps, type DocsFeedbackValue, DocsLayout, type DocsMetadata, type DocsNav, DocsPage, DocsPageClient, type DocsTheme, type FeedbackConfig, type FontStyle, DefaultUIDefaults as FumadocsUIDefaults, HardlineUIDefaults, HoverLink, type HoverLinkProps, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, PageActions, type PageActionsConfig, type PageFrontmatter, Pre, RootProvider, type SidebarConfig, Tab, Tabs, type ThemeToggleConfig, type TypographyConfig, type UIConfig, commandGrid, concrete, createDocsLayout, createDocsMetadata, createPageMetadata, createTheme, deepMerge, defineDocs, extendTheme, fumadocs, hardline, withLangInUrl };
|
|
20
|
+
export { type AIConfig, Agent, type BreadcrumbConfig, type ChangelogConfig, type ChangelogFrontmatter, CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, CommandGridUIDefaults, ConcreteUIDefaults, type CopyMarkdownConfig, DocsBody, DocsClientHooks, DocsCommandSearch, type DocsConfig, DocsFeedback, type DocsFeedbackData, type DocsFeedbackProps, type DocsFeedbackValue, DocsLayout, type DocsMetadata, type DocsNav, DocsPage, DocsPageClient, type DocsTheme, type FeedbackConfig, type FontStyle, DefaultUIDefaults as FumadocsUIDefaults, HardlineUIDefaults, HoverLink, type HoverLinkProps, type OGConfig, type OpenDocsConfig, type OpenDocsProvider, PageActions, type PageActionsConfig, type PageFrontmatter, Pre, RootProvider, type SidebarConfig, Tab, Tabs, type ThemeToggleConfig, type TypographyConfig, type UIConfig, commandGrid, concrete, createDocsLayout, createDocsMetadata, createPageMetadata, createTheme, deepMerge, defineDocs, extendTheme, fumadocs, hardline, withLangInUrl };
|
package/dist/index.mjs
CHANGED
|
@@ -11,10 +11,11 @@ import { ConcreteUIDefaults, concrete } from "./concrete/index.mjs";
|
|
|
11
11
|
import { HardlineUIDefaults, hardline } from "./hardline/index.mjs";
|
|
12
12
|
import { DocsClientHooks } from "./docs-client-hooks.mjs";
|
|
13
13
|
import { HoverLink } from "./hover-link.mjs";
|
|
14
|
+
import { Agent } from "./mdx.mjs";
|
|
14
15
|
import { DocsLayout } from "fumadocs-ui/layouts/docs";
|
|
15
16
|
import { createTheme, deepMerge, defineDocs, extendTheme } from "@farming-labs/docs";
|
|
16
17
|
import { DocsBody, DocsPage } from "fumadocs-ui/layouts/docs/page";
|
|
17
18
|
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
|
|
18
19
|
import { CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, Pre } from "fumadocs-ui/components/codeblock";
|
|
19
20
|
|
|
20
|
-
export { CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, CommandGridUIDefaults, ConcreteUIDefaults, DocsBody, DocsClientHooks, DocsCommandSearch, DocsFeedback, DocsLayout, DocsPage, DocsPageClient, DefaultUIDefaults as FumadocsUIDefaults, HardlineUIDefaults, HoverLink, PageActions, Pre, RootProvider, Tab, Tabs, commandGrid, concrete, createDocsLayout, createDocsMetadata, createPageMetadata, createTheme, deepMerge, defineDocs, extendTheme, fumadocs, hardline, withLangInUrl };
|
|
21
|
+
export { Agent, CodeBlock, CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger, CommandGridUIDefaults, ConcreteUIDefaults, DocsBody, DocsClientHooks, DocsCommandSearch, DocsFeedback, DocsLayout, DocsPage, DocsPageClient, DefaultUIDefaults as FumadocsUIDefaults, HardlineUIDefaults, HoverLink, PageActions, Pre, RootProvider, Tab, Tabs, commandGrid, concrete, createDocsLayout, createDocsMetadata, createPageMetadata, createTheme, deepMerge, defineDocs, extendTheme, fumadocs, hardline, withLangInUrl };
|
package/dist/mdx.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HoverLink } from "./hover-link.mjs";
|
|
2
1
|
import { MDXImg } from "./mdx-img.mjs";
|
|
2
|
+
import { HoverLink } from "./hover-link.mjs";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { CodeBlockCopyData, DocsTheme } from "@farming-labs/docs";
|
|
5
5
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
package/dist/mdx.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HoverLink } from "./hover-link.mjs";
|
|
2
1
|
import { MDXImg } from "./mdx-img.mjs";
|
|
3
2
|
import { createPreWithCopyCallback } from "./code-block-copy-wrapper.mjs";
|
|
3
|
+
import { HoverLink } from "./hover-link.mjs";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
|
|
6
6
|
import defaultMdxComponents from "fumadocs-ui/mdx";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farming-labs/theme",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.32",
|
|
4
4
|
"description": "Theme package for @farming-labs/docs — layout, provider, MDX components, and styles",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"tsdown": "^0.20.3",
|
|
134
134
|
"typescript": "^5.9.3",
|
|
135
135
|
"vitest": "^3.2.4",
|
|
136
|
-
"@farming-labs/docs": "0.1.
|
|
136
|
+
"@farming-labs/docs": "0.1.32"
|
|
137
137
|
},
|
|
138
138
|
"peerDependencies": {
|
|
139
139
|
"@farming-labs/docs": ">=0.0.1",
|