@farming-labs/theme 0.2.114 → 0.2.115

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.
@@ -82,6 +82,8 @@ interface DocsAPIOptions {
82
82
  agent?: DocsConfig["agent"];
83
83
  /** @internal Build-time Agent Skills snapshot supplied by framework adapters. */
84
84
  _preloadedAgentSkills?: readonly DocsPublishedAgentSkill[];
85
+ /** @internal Build-time root document snapshot (skill.md, AGENTS.md, AGENT.md) supplied by framework adapters. */
86
+ _preloadedRootDocuments?: Readonly<Record<string, string>>;
85
87
  }
86
88
  interface DocsMCPAPIOptions {
87
89
  rootDir?: string;
@@ -103,6 +105,8 @@ interface DocsMCPAPIOptions {
103
105
  feedback?: DocsConfig["feedback"];
104
106
  /** @internal Build-time Agent Skills snapshot supplied by framework adapters. */
105
107
  _preloadedAgentSkills?: readonly DocsPublishedAgentSkill[];
108
+ /** @internal Build-time root document snapshot (skill.md, AGENTS.md, AGENT.md) supplied by framework adapters. */
109
+ _preloadedRootDocuments?: Readonly<Record<string, string>>;
106
110
  }
107
111
  type LlmsTxtOptions = LlmsTxtConfig;
108
112
  /**
package/dist/docs-api.mjs CHANGED
@@ -1451,7 +1451,7 @@ function renderAgentsDocument({ origin, entry, apiRoute, apiCatalog, search, con
1451
1451
  lines.push("", "## Framework Maintenance", "- For @farming-labs/docs projects, keep the framework package current before debugging missing agent surfaces.", "", "```sh", "npx @farming-labs/docs@latest upgrade --latest", "```", "", "- For framework setup, configuration, CLI, Ask AI, page actions, or theme work, install the reusable Skills pack:", "", "```sh", "npx skills add farming-labs/docs", "```");
1452
1452
  return lines.join("\n");
1453
1453
  }
1454
- function createRootDocumentReader(rootDir, fileNames) {
1454
+ function createRootDocumentReader(rootDir, fileNames, preloadedDocuments) {
1455
1455
  let cached;
1456
1456
  return function readRootDocument() {
1457
1457
  for (const fileName of fileNames) {
@@ -1479,6 +1479,10 @@ function createRootDocumentReader(rootDir, fileNames) {
1479
1479
  }
1480
1480
  }
1481
1481
  cached = void 0;
1482
+ if (preloadedDocuments) for (const fileName of fileNames) {
1483
+ const content = preloadedDocuments[fileName];
1484
+ if (typeof content === "string") return content;
1485
+ }
1482
1486
  return null;
1483
1487
  };
1484
1488
  }
@@ -2555,8 +2559,8 @@ function generateLlmsTxt(indexes, options) {
2555
2559
  */
2556
2560
  function createDocsAPI(options) {
2557
2561
  const root = options?.rootDir ?? process.cwd();
2558
- const readRootSkillDocument = createRootDocumentReader(root, ["skill.md"]);
2559
- const readRootAgentsDocument = createRootDocumentReader(root, ["AGENTS.md", "AGENT.md"]);
2562
+ const readRootSkillDocument = createRootDocumentReader(root, ["skill.md"], options?._preloadedRootDocuments);
2563
+ const readRootAgentsDocument = createRootDocumentReader(root, ["AGENTS.md", "AGENT.md"], options?._preloadedRootDocuments);
2560
2564
  let publishedAgentSkills;
2561
2565
  function getPublishedAgentSkills() {
2562
2566
  if (!publishedAgentSkills) publishedAgentSkills = Array.isArray(options?._preloadedAgentSkills) ? Promise.resolve([...options._preloadedAgentSkills]) : resolveConfiguredAgentSkills(options?.agent?.skills, { rootDir: root });
@@ -3436,7 +3440,7 @@ function createDocsAPI(options) {
3436
3440
  */
3437
3441
  function createDocsMCPAPI(options = {}) {
3438
3442
  const rootDir = options.rootDir ?? process.cwd();
3439
- const readRootSkillDocument = createRootDocumentReader(rootDir, ["skill.md"]);
3443
+ const readRootSkillDocument = createRootDocumentReader(rootDir, ["skill.md"], options._preloadedRootDocuments);
3440
3444
  const entry = options.entry ?? readEntry(rootDir);
3441
3445
  const appDir = getNextAppDir(rootDir);
3442
3446
  const contentDir = options.contentDir ?? path.join(appDir, entry);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/theme",
3
- "version": "0.2.114",
3
+ "version": "0.2.115",
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.114"
164
+ "@farming-labs/docs": "0.2.115"
165
165
  },
166
166
  "peerDependencies": {
167
167
  "@farming-labs/docs": ">=0.0.1",