@farming-labs/next 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.
Files changed (2) hide show
  1. package/dist/config.mjs +41 -4
  2. package/package.json +3 -3
package/dist/config.mjs CHANGED
@@ -147,7 +147,13 @@ const FILE_EXTS = [
147
147
  const INTERNAL_DOCS_CONFIG_ALIAS = "@farming-labs/next-internal-docs-config";
148
148
  const NEXT_PACKAGE_ROOT = fileURLToPath(new URL("..", import.meta.url));
149
149
  const DEFAULT_AGENT_SPEC_ROUTE = "/api/docs/agent/spec";
150
+ const DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE = "/.well-known/agent";
151
+ const DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE = "/.well-known/agent.json";
150
152
  const DEFAULT_AGENT_FEEDBACK_ROUTE = "/api/docs/agent/feedback";
153
+ const DEFAULT_LLMS_TXT_ROUTE = "/llms.txt";
154
+ const DEFAULT_LLMS_FULL_TXT_ROUTE = "/llms-full.txt";
155
+ const DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE = "/.well-known/llms.txt";
156
+ const DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE = "/.well-known/llms-full.txt";
151
157
  const MARKDOWN_ACCEPT_HEADER_VALUE = [
152
158
  "(?:^|.*,\\s*)",
153
159
  "text/markdown",
@@ -730,10 +736,40 @@ function buildDocsMarkdownRewrites(entry) {
730
736
  ];
731
737
  }
732
738
  function buildAgentSpecRewrites() {
733
- return [{
734
- source: DEFAULT_AGENT_SPEC_ROUTE,
735
- destination: "/api/docs?agent=spec"
736
- }];
739
+ return [
740
+ {
741
+ source: DEFAULT_AGENT_SPEC_ROUTE,
742
+ destination: "/api/docs?agent=spec"
743
+ },
744
+ {
745
+ source: DEFAULT_AGENT_SPEC_WELL_KNOWN_ROUTE,
746
+ destination: "/api/docs?agent=spec"
747
+ },
748
+ {
749
+ source: DEFAULT_AGENT_SPEC_WELL_KNOWN_JSON_ROUTE,
750
+ destination: "/api/docs?agent=spec"
751
+ }
752
+ ];
753
+ }
754
+ function buildLlmsTxtRewrites() {
755
+ return [
756
+ {
757
+ source: DEFAULT_LLMS_TXT_ROUTE,
758
+ destination: "/api/docs?format=llms"
759
+ },
760
+ {
761
+ source: DEFAULT_LLMS_FULL_TXT_ROUTE,
762
+ destination: "/api/docs?format=llms-full"
763
+ },
764
+ {
765
+ source: DEFAULT_LLMS_TXT_WELL_KNOWN_ROUTE,
766
+ destination: "/api/docs?format=llms"
767
+ },
768
+ {
769
+ source: DEFAULT_LLMS_FULL_TXT_WELL_KNOWN_ROUTE,
770
+ destination: "/api/docs?format=llms-full"
771
+ }
772
+ ];
737
773
  }
738
774
  function buildAgentFeedbackRewrites(config) {
739
775
  if (!config.enabled) return [];
@@ -759,6 +795,7 @@ function dedupeRewrites(rewrites) {
759
795
  function mergeDocsMarkdownRewrites(entry, agentFeedback, result) {
760
796
  const autoRewrites = [
761
797
  ...buildAgentSpecRewrites(),
798
+ ...buildLlmsTxtRewrites(),
762
799
  ...buildDocsMarkdownRewrites(entry),
763
800
  ...buildAgentFeedbackRewrites(agentFeedback)
764
801
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/next",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "description": "Next.js adapter for @farming-labs/docs — MDX config wrapper",
5
5
  "keywords": [
6
6
  "docs",
@@ -95,8 +95,8 @@
95
95
  "tsdown": "^0.20.3",
96
96
  "typescript": "^5.9.3",
97
97
  "vitest": "^3.2.4",
98
- "@farming-labs/docs": "0.1.30",
99
- "@farming-labs/theme": "0.1.30"
98
+ "@farming-labs/theme": "0.1.32",
99
+ "@farming-labs/docs": "0.1.32"
100
100
  },
101
101
  "peerDependencies": {
102
102
  "@farming-labs/docs": ">=0.0.1",