blume 2.2.0 → 2.2.2

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 (125) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cli/{chunk-xgq4eytj.js → chunk-080mfch6.js} +15 -15
  3. package/dist/cli/{chunk-br0n8n3e.js → chunk-1ch3ct3r.js} +14 -14
  4. package/dist/cli/{chunk-49r370mb.js → chunk-2ssh60qh.js} +6 -6
  5. package/dist/cli/{chunk-1cm0h819.js → chunk-34wap3ed.js} +3 -3
  6. package/dist/cli/{chunk-fqy4n3q2.js → chunk-40vk8kgf.js} +7 -7
  7. package/dist/cli/{chunk-96snx8yy.js → chunk-487b95qy.js} +3 -3
  8. package/dist/cli/{chunk-kkrteb15.js → chunk-4zxh25hc.js} +2 -2
  9. package/dist/cli/{chunk-cn3dy3hz.js → chunk-69rjf786.js} +5 -5
  10. package/dist/cli/{chunk-dmx6cezx.js → chunk-9h8mh2tk.js} +3 -3
  11. package/dist/cli/{chunk-dmx6cezx.js.map → chunk-9h8mh2tk.js.map} +2 -2
  12. package/dist/cli/{chunk-t5xx74rd.js → chunk-9jqmq5hv.js} +6 -6
  13. package/dist/cli/{chunk-8b489v1b.js → chunk-aafhwx74.js} +1 -1
  14. package/dist/cli/{chunk-2nr29y95.js → chunk-b680sv30.js} +3 -3
  15. package/dist/cli/{chunk-rkqae7kh.js → chunk-beb0z983.js} +16 -16
  16. package/dist/cli/{chunk-th0pgaj5.js → chunk-c5bjxq8v.js} +2 -2
  17. package/dist/cli/{chunk-wehv26ry.js → chunk-e1n41w9m.js} +3 -3
  18. package/dist/cli/{chunk-frk2wdq1.js → chunk-etckvbrh.js} +14 -14
  19. package/dist/cli/{chunk-ahc5gc9h.js → chunk-f260jdrn.js} +5 -5
  20. package/dist/cli/{chunk-05f21r8h.js → chunk-fnxgtjeq.js} +1 -1
  21. package/dist/cli/{chunk-4rftmttv.js → chunk-gwy55cx3.js} +2 -2
  22. package/dist/cli/{chunk-4rftmttv.js.map → chunk-gwy55cx3.js.map} +2 -2
  23. package/dist/cli/{chunk-vnbvhgmd.js → chunk-gxhcf2hs.js} +2 -2
  24. package/dist/cli/{chunk-bjk964fp.js → chunk-h0qwdbem.js} +2 -2
  25. package/dist/cli/{chunk-1rkxzg3n.js → chunk-hktq4j5r.js} +15 -12
  26. package/dist/cli/{chunk-1rkxzg3n.js.map → chunk-hktq4j5r.js.map} +3 -3
  27. package/dist/cli/{chunk-enk76qd5.js → chunk-hn3g2b89.js} +9 -9
  28. package/dist/cli/{chunk-w6e455pz.js → chunk-j4nfgn2j.js} +1 -1
  29. package/dist/cli/{chunk-as09pafp.js → chunk-k45sq16q.js} +4 -4
  30. package/dist/cli/{chunk-as09pafp.js.map → chunk-k45sq16q.js.map} +3 -3
  31. package/dist/cli/{chunk-p8zg3a2h.js → chunk-kmswjxj9.js} +3 -3
  32. package/dist/cli/{chunk-xt0qvz1t.js → chunk-nqna8dzp.js} +17 -17
  33. package/dist/cli/{chunk-dyk3r7jw.js → chunk-p834rkcn.js} +5 -5
  34. package/dist/cli/{chunk-dpcahcrb.js → chunk-ppa6mg4d.js} +6 -6
  35. package/dist/cli/{chunk-79bzzkx4.js → chunk-q1wwrxzw.js} +2 -2
  36. package/dist/cli/{chunk-m9bp2hc1.js → chunk-qcyxkj44.js} +1 -1
  37. package/dist/cli/{chunk-dm4mg9bj.js → chunk-r5nm9w0c.js} +740 -685
  38. package/dist/cli/{chunk-dm4mg9bj.js.map → chunk-r5nm9w0c.js.map} +8 -6
  39. package/dist/cli/{chunk-a3ydrqny.js → chunk-rtvgmg2j.js} +2 -2
  40. package/dist/cli/{chunk-c69tw29j.js → chunk-t2h8pwy1.js} +4 -4
  41. package/dist/cli/{chunk-vzy9rh6y.js → chunk-x60e15st.js} +17 -17
  42. package/dist/cli/{chunk-mrvh4c88.js → chunk-x7bh6d9j.js} +4 -4
  43. package/dist/cli/{chunk-7tekknev.js → chunk-ydqzkhjn.js} +6 -6
  44. package/dist/cli/{chunk-gprwej7h.js → chunk-yg8ckc3g.js} +2 -2
  45. package/dist/cli/{chunk-8f8xw4x2.js → chunk-zxd5jrgx.js} +14 -4
  46. package/dist/cli/{chunk-8f8xw4x2.js.map → chunk-zxd5jrgx.js.map} +3 -3
  47. package/dist/cli/index.js +18 -18
  48. package/dist/types/core/config-input.d.ts +37 -5
  49. package/dist/types/core/data.d.ts +6 -2
  50. package/dist/types/core/mcp-clients.d.ts +47 -0
  51. package/dist/types/core/nav-diagnostics.d.ts +7 -0
  52. package/dist/types/core/schema.d.ts +55 -4
  53. package/dist/types/ratelimit/index.d.ts +2 -0
  54. package/dist/types/ratelimit/memory.d.ts +1 -1
  55. package/dist/types/ratelimit/schema.d.ts +40 -0
  56. package/dist/types/ratelimit/unkey.d.ts +48 -0
  57. package/docs/02-deployment.mdx +1 -0
  58. package/docs/configuration/index.mdx +5 -4
  59. package/docs/configuration/rate-limiting.mdx +20 -1
  60. package/docs/content/i18n.mdx +1 -1
  61. package/docs/discoverability/mcp.mdx +40 -8
  62. package/package.json +1 -1
  63. package/skills/blume-migrate/SKILL.md +2 -2
  64. package/skills/blume-migrate/references/docusaurus.md +2 -2
  65. package/skills/blume-migrate/references/gitbook.md +2 -2
  66. package/skills/blume-migrate/references/github-wiki.md +2 -2
  67. package/skills/blume-migrate/references/jekyll.md +2 -2
  68. package/skills/blume-migrate/references/mkdocs.md +2 -2
  69. package/skills/blume-migrate/references/nextra.md +3 -3
  70. package/skills/blume-migrate/references/readme.md +1 -1
  71. package/skills/blume-migrate/references/redocly.md +2 -2
  72. package/skills/blume-migrate/references/vitepress.md +2 -2
  73. package/skills/blume-migrate/references/vuepress.md +1 -1
  74. package/skills/blume-migrate/scripts/github-wiki-codemod.mjs +1 -1
  75. package/src/astro/generate.ts +15 -5
  76. package/src/astro/templates.ts +4 -4
  77. package/src/cli/required-secrets.ts +0 -1
  78. package/src/components/layout/PageActions.astro +119 -34
  79. package/src/components/layout/RootLayout.astro +18 -2
  80. package/src/components/layout/SiteFooter.astro +31 -8
  81. package/src/core/config-input.ts +38 -4
  82. package/src/core/data.ts +10 -3
  83. package/src/core/mcp-clients.ts +87 -0
  84. package/src/core/nav-diagnostics.ts +25 -0
  85. package/src/core/schema.ts +93 -3
  86. package/src/openapi/proxy.ts +5 -1
  87. package/src/ratelimit/index.ts +2 -0
  88. package/src/ratelimit/memory.ts +1 -1
  89. package/src/ratelimit/runtime.ts +81 -0
  90. package/src/ratelimit/schema.ts +2 -0
  91. package/src/ratelimit/unkey.ts +61 -0
  92. package/src/registry/registry.ts +1 -1
  93. /package/dist/cli/{chunk-xgq4eytj.js.map → chunk-080mfch6.js.map} +0 -0
  94. /package/dist/cli/{chunk-br0n8n3e.js.map → chunk-1ch3ct3r.js.map} +0 -0
  95. /package/dist/cli/{chunk-49r370mb.js.map → chunk-2ssh60qh.js.map} +0 -0
  96. /package/dist/cli/{chunk-1cm0h819.js.map → chunk-34wap3ed.js.map} +0 -0
  97. /package/dist/cli/{chunk-fqy4n3q2.js.map → chunk-40vk8kgf.js.map} +0 -0
  98. /package/dist/cli/{chunk-96snx8yy.js.map → chunk-487b95qy.js.map} +0 -0
  99. /package/dist/cli/{chunk-kkrteb15.js.map → chunk-4zxh25hc.js.map} +0 -0
  100. /package/dist/cli/{chunk-cn3dy3hz.js.map → chunk-69rjf786.js.map} +0 -0
  101. /package/dist/cli/{chunk-t5xx74rd.js.map → chunk-9jqmq5hv.js.map} +0 -0
  102. /package/dist/cli/{chunk-8b489v1b.js.map → chunk-aafhwx74.js.map} +0 -0
  103. /package/dist/cli/{chunk-2nr29y95.js.map → chunk-b680sv30.js.map} +0 -0
  104. /package/dist/cli/{chunk-rkqae7kh.js.map → chunk-beb0z983.js.map} +0 -0
  105. /package/dist/cli/{chunk-th0pgaj5.js.map → chunk-c5bjxq8v.js.map} +0 -0
  106. /package/dist/cli/{chunk-wehv26ry.js.map → chunk-e1n41w9m.js.map} +0 -0
  107. /package/dist/cli/{chunk-frk2wdq1.js.map → chunk-etckvbrh.js.map} +0 -0
  108. /package/dist/cli/{chunk-ahc5gc9h.js.map → chunk-f260jdrn.js.map} +0 -0
  109. /package/dist/cli/{chunk-05f21r8h.js.map → chunk-fnxgtjeq.js.map} +0 -0
  110. /package/dist/cli/{chunk-vnbvhgmd.js.map → chunk-gxhcf2hs.js.map} +0 -0
  111. /package/dist/cli/{chunk-bjk964fp.js.map → chunk-h0qwdbem.js.map} +0 -0
  112. /package/dist/cli/{chunk-enk76qd5.js.map → chunk-hn3g2b89.js.map} +0 -0
  113. /package/dist/cli/{chunk-w6e455pz.js.map → chunk-j4nfgn2j.js.map} +0 -0
  114. /package/dist/cli/{chunk-p8zg3a2h.js.map → chunk-kmswjxj9.js.map} +0 -0
  115. /package/dist/cli/{chunk-xt0qvz1t.js.map → chunk-nqna8dzp.js.map} +0 -0
  116. /package/dist/cli/{chunk-dyk3r7jw.js.map → chunk-p834rkcn.js.map} +0 -0
  117. /package/dist/cli/{chunk-dpcahcrb.js.map → chunk-ppa6mg4d.js.map} +0 -0
  118. /package/dist/cli/{chunk-79bzzkx4.js.map → chunk-q1wwrxzw.js.map} +0 -0
  119. /package/dist/cli/{chunk-m9bp2hc1.js.map → chunk-qcyxkj44.js.map} +0 -0
  120. /package/dist/cli/{chunk-a3ydrqny.js.map → chunk-rtvgmg2j.js.map} +0 -0
  121. /package/dist/cli/{chunk-c69tw29j.js.map → chunk-t2h8pwy1.js.map} +0 -0
  122. /package/dist/cli/{chunk-vzy9rh6y.js.map → chunk-x60e15st.js.map} +0 -0
  123. /package/dist/cli/{chunk-mrvh4c88.js.map → chunk-x7bh6d9j.js.map} +0 -0
  124. /package/dist/cli/{chunk-7tekknev.js.map → chunk-ydqzkhjn.js.map} +0 -0
  125. /package/dist/cli/{chunk-gprwej7h.js.map → chunk-yg8ckc3g.js.map} +0 -0
@@ -9,7 +9,7 @@
9
9
  "import { mkdir, writeFile } from \"node:fs/promises\";\n\nimport { close, createIndex } from \"pagefind\";\nimport { dirname, join } from \"pathe\";\n\n/** The part of `pagefind-entry.json` that counts the index's pages. */\ninterface PagefindEntry {\n languages: Record<string, { page_count: number }>;\n}\n\n/**\n * Build a local Pagefind search index over the built site. Pagefind indexes\n * every rendered page except those whose `<html>` carries\n * `data-pagefind-ignore`, which Blume stamps on non-indexable pages\n * (search-excluded, or hidden without the opt-in), so those stay out.\n *\n * Pagefind is imported statically, not with `import()`: this runs in the\n * `astro:build:done` hook, after Astro has closed the module runner an\n * installed Blume's config was evaluated in (see `core/node-require.ts`), and\n * Pagefind ships only an `import` export, so `require` can't load it either.\n *\n * The index files are fetched with `getFiles()` and written here rather than\n * with Pagefind's `writeFiles()`: in service mode Pagefind acknowledges\n * `writeFiles()` once tokio has buffered the writes, not once they are on\n * disk, and `close()` kills the backend, so a loaded CI host can ship a\n * truncated `pagefind-entry.json` (Pagefind/pagefind#1271). Writing the bytes\n * ourselves puts them on disk before the backend goes away. Fixed upstream in\n * Pagefind/pagefind#1272; switch back to `writeFiles()` once a release ships\n * that fix.\n *\n * Returns the number of pages indexed: the index's own count, summed over its\n * languages from `pagefind-entry.json`. `addDirectory`'s `page_count` counts\n * every HTML file it read, including the ones kept out of the index.\n */\nexport const buildSearchIndex = async (outDir: string): Promise<number> => {\n const { index } = await createIndex({});\n if (!index) {\n throw new Error(\"Failed to create Pagefind index.\");\n }\n\n // These awaits are strictly ordered, not independent: the directory must be\n // indexed before its files are read, and the index closed only after.\n // oxlint-disable-next-line react-doctor/async-parallel\n await index.addDirectory({ path: outDir });\n const { files } = await index.getFiles();\n await close();\n\n const searchDir = join(outDir, \"pagefind\");\n const directories = new Set(\n files.map((file) => dirname(join(searchDir, file.path)))\n );\n await Promise.all(\n [...directories].map((directory) => mkdir(directory, { recursive: true }))\n );\n await Promise.all(\n files.map((file) => writeFile(join(searchDir, file.path), file.content))\n );\n\n // Pagefind always writes the entry file, listing no languages when nothing\n // was indexed.\n const entry = files.find((file) => file.path === \"pagefind-entry.json\");\n // SAFETY: the entry file is Pagefind's JSON, which counts each language's\n // pages in `page_count`.\n const { languages } = JSON.parse(\n new TextDecoder().decode(entry?.content)\n ) as PagefindEntry;\n return Object.values(languages).reduce(\n (sum, language) => sum + language.page_count,\n 0\n );\n};\n",
10
10
  "import type * as AlgoliaSdk from \"algoliasearch\";\n\nimport { nodeRequire } from \"../../core/node-require.ts\";\nimport type { AlgoliaOptions } from \"../adapters/algolia.ts\";\nimport type { SearchRecord } from \"../documents.ts\";\n\n/** The adapter options the sync reads (the public `apiKey` is never used). */\nexport type AlgoliaSyncConfig = Pick<AlgoliaOptions, \"appId\" | \"indexName\">;\n\n/**\n * The record attributes the search dialog filters on (`facetFilters` on\n * `locale:<code>` and `version:<id>`). In Algolia a facet filter on an\n * attribute the index doesn't declare for faceting matches nothing — an i18n\n * or versioned site would get no hits — so the sync declares them,\n * filter-only.\n */\nconst FILTER_ATTRIBUTES = [\"locale\", \"version\"] as const;\n\n/** The custom ranking rule that orders close matches by `search.boost`. */\nconst BOOST_RANKING = \"desc(boost)\";\n\n/** A faceting declaration's attribute: `filterOnly(locale)` → `locale`. */\nconst facetAttribute = (declaration: string): string =>\n declaration.replace(/^\\w+\\((?<name>.*)\\)$/u, \"$<name>\");\n\n/**\n * The largest record Algolia accepts on its Build and Grow plans, in bytes of\n * the record's JSON. One larger record fails the whole upload.\n */\nconst MAX_RECORD_BYTES = 10_000;\n\n/**\n * A record as uploaded: the search record's fields plus Algolia's `objectID`.\n * (Mapped rather than the interface itself, which the SDK's\n * `Record<string, unknown>` objects don't accept.)\n */\ntype AlgoliaObject = Pick<SearchRecord, keyof SearchRecord> & {\n objectID: string;\n};\n\n/** A string's or record's size as Algolia measures it: UTF-8 bytes of its JSON. */\nconst jsonBytes = (value: string | AlgoliaObject): number =>\n Buffer.byteLength(JSON.stringify(value), \"utf-8\");\n\n/** The JSON of the widest single character: a control character's `\\u` escape. */\nconst WIDEST_CHARACTER = jsonBytes(\"\\u0000\");\n\n/** The length of `text`'s longest prefix whose JSON string fits `budget`. */\nconst fittingLength = (text: string, budget: number): number => {\n let size = jsonBytes(\"\");\n let end = 0;\n [...text].some((character) => {\n size += jsonBytes(character) - jsonBytes(\"\");\n if (size > budget) {\n return true;\n }\n end += character.length;\n return false;\n });\n return end;\n};\n\n/**\n * Cut `text` into pieces whose JSON strings fit `budget` bytes each, at the\n * last space that fits so no word is split; a run with no space in reach (an\n * unspaced script, a long URL) is cut between characters.\n */\nconst splitText = (text: string, budget: number): string[] => {\n const pieces: string[] = [];\n let rest = text;\n while (jsonBytes(rest) > budget) {\n const end = fittingLength(rest, budget);\n const space = rest.lastIndexOf(\" \", end);\n const cut = space > 0 ? space : end;\n pieces.push(rest.slice(0, cut));\n rest = rest.slice(cut).trimStart();\n }\n pieces.push(rest);\n return pieces;\n};\n\n/**\n * A page's record, split to fit Algolia's cap the way Algolia recommends for\n * long documents: every piece carries the page's title, description, URL and\n * facets with a stretch of its body, and the index's `distinct` on `url`\n * shows the page once, at its best-matching piece. The first piece keeps the\n * page's own `objectID`; the rest add `#1`, `#2`… A record whose other fields\n * leave no room for a single character of body can't be split to fit, and\n * uploads whole for Algolia to reject by name.\n */\nconst toObjects = (record: SearchRecord): AlgoliaObject[] => {\n const whole = { ...record, objectID: record._id };\n const budget =\n MAX_RECORD_BYTES -\n jsonBytes({ ...whole, content: \"\", objectID: `${record._id}#000` }) +\n jsonBytes(\"\");\n if (jsonBytes(whole) <= MAX_RECORD_BYTES || budget < WIDEST_CHARACTER) {\n return [whole];\n }\n return splitText(record.content, budget).map((content, index) => ({\n ...record,\n content,\n objectID: index === 0 ? record._id : `${record._id}#${index}`,\n }));\n};\n\n/**\n * Upload the search records to Algolia. Uses the admin key from\n * `ALGOLIA_ADMIN_API_KEY` (never the adapter options, which hold only the\n * public, search-only key). Throws on a missing key so the caller can warn.\n *\n * Uses `replaceAllObjects`, which atomically replaces the index contents, so\n * pages deleted or renamed since the last sync don't linger as stale search\n * hits that 404 when clicked. A page too long for one record is split across\n * several (see {@link toObjects}). Then adds `filterOnly(locale)` and\n * `filterOnly(version)` to the index's `attributesForFaceting`, keeping any\n * the site declared itself, so the dialog's locale and version filters match,\n * and, once a page is split, `url` as the index's `attributeForDistinct`\n * unless the site set its own.\n */\nexport const syncAlgolia = async (\n records: SearchRecord[],\n config: AlgoliaSyncConfig\n): Promise<void> => {\n const adminKey = process.env.ALGOLIA_ADMIN_API_KEY;\n if (!adminKey) {\n throw new Error(\"ALGOLIA_ADMIN_API_KEY is not set.\");\n }\n // `require`, not `import()`: this runs in `astro:build:done` (see\n // `core/node-require.ts`).\n const { algoliasearch }: typeof AlgoliaSdk = nodeRequire(\"algoliasearch\");\n const client = algoliasearch(config.appId, adminKey);\n const { indexName } = config;\n const objects = records.flatMap(toObjects);\n await client.replaceAllObjects({ indexName, objects });\n const {\n attributeForDistinct,\n attributesForFaceting = [],\n customRanking = [],\n } = await client.getSettings({ indexName });\n const declared = new Set(attributesForFaceting.map(facetAttribute));\n const missing = FILTER_ATTRIBUTES.filter((name) => !declared.has(name));\n // Every record carries `boost` (search.boost, 1 by default): ranking by it\n // after textual relevance puts boosted pages first among close matches.\n // A ranking the site set in the dashboard keeps its place ahead of it.\n const ranksByBoost = customRanking.some((rule) =>\n /^(?:asc|desc)\\(boost\\)$/u.test(rule)\n );\n // A split page's records share its `url`: distinct on it lists the page\n // once, at its best-matching record.\n const setsDistinct =\n objects.length > records.length && attributeForDistinct === undefined;\n if (missing.length === 0 && ranksByBoost && !setsDistinct) {\n return;\n }\n const { taskID } = await client.setSettings({\n indexName,\n indexSettings: {\n attributesForFaceting: [\n ...attributesForFaceting,\n ...missing.map((name) => `filterOnly(${name})`),\n ],\n customRanking: ranksByBoost\n ? customRanking\n : [...customRanking, BOOST_RANKING],\n ...(setsDistinct && { attributeForDistinct: \"url\", distinct: true }),\n },\n });\n await client.waitForTask({ indexName, taskID });\n};\n",
11
11
  "import { createHash } from \"node:crypto\";\nimport { existsSync } from \"node:fs\";\nimport {\n mkdir,\n readdir,\n readFile,\n rename,\n rm,\n writeFile,\n} from \"node:fs/promises\";\n\nimport { dirname, join } from \"pathe\";\n\nimport type { ProjectContext } from \"../core/types.ts\";\nimport type { OgCardOptions, OgFont } from \"./card.ts\";\n\n/**\n * Where a build keeps rendered OG cards between runs (see {@link cardCacheKey}\n * for what invalidates one). Baked into the generated OG endpoint alongside\n * the Blume version that renders the cards.\n */\nexport interface OgCache {\n /** Absolute directory holding `<key>.png` files. */\n dir: string;\n /** The Blume version rendering the cards; part of every key. */\n version: string;\n}\n\n/**\n * The card cache directory for a project: `node_modules/.cache/blume/og`,\n * the conventional build-cache location. Vercel and Netlify restore\n * `node_modules` from their build caches, so a deploy there re-renders only\n * the cards whose inputs changed; Cloudflare Workers Builds keeps only\n * package-manager caches (and `node_modules/.astro` for a detected Astro\n * project), and a self-managed runner needs a cache step for the directory.\n * A project with no `node_modules` of its own falls back to the runtime's\n * cache dir next to Astro's and Vite's.\n */\nexport const ogCacheDir = (\n context: Pick<ProjectContext, \"outDir\" | \"root\">\n): string =>\n existsSync(join(context.root, \"node_modules\"))\n ? join(context.root, \"node_modules\", \".cache\", \"blume\", \"og\")\n : join(context.outDir, \".cache\", \"og\");\n\n/**\n * Per-process tally of cache hits and misses plus the keys this build asked\n * for, read back by the CLI after `build()` for the summary line and the\n * prune. On `globalThis` for the same reason as the integration registry: the\n * endpoint renders in the copy of this module Vite bundled for the prerender,\n * while the CLI reads from its own bundled copy.\n */\ninterface OgCacheRegistry {\n hits: number;\n misses: number;\n used: Set<string>;\n}\n\nconst REGISTRY_KEY = Symbol.for(\"blume.og-cache\");\n\ntype RegistryHost = typeof globalThis & { [REGISTRY_KEY]?: OgCacheRegistry };\n\nconst registry = (): OgCacheRegistry => {\n // SAFETY: the registry is stashed on globalThis under a well-known symbol so\n // every copy of this module in the process shares it; the intersection only\n // names that slot.\n const host = globalThis as RegistryHost;\n host[REGISTRY_KEY] ??= { hits: 0, misses: 0, used: new Set() };\n return host[REGISTRY_KEY];\n};\n\n/** Type guard: is this OG font a local file entry? */\nexport const isLocalOgFont = (\n font: OgFont\n): font is Extract<OgFont, { src: string }> =>\n typeof font !== \"string\" && \"src\" in font;\n\n// A local font file's contents digest, computed once per path per process: the\n// key must follow the file's bytes, not its mtime (a fresh CI checkout resets\n// every mtime, which would miss the whole cache on each build).\nconst localFontDigests = new Map<string, Promise<string>>();\n\nconst digestFile = async (path: string): Promise<string> =>\n createHash(\"sha256\")\n .update(await readFile(path))\n .digest(\"hex\");\n\nconst localFontDigest = (path: string): Promise<string> => {\n let digest = localFontDigests.get(path);\n if (!digest) {\n digest = digestFile(path);\n localFontDigests.set(path, digest);\n }\n return digest;\n};\n\n/**\n * The cache key of a card: a digest of everything that decides its pixels —\n * the card options (title, description, brand, logo markup, palette, footer\n * text, font families), the fonts (a local file by its contents, a Google\n * family by its request), and the Blume version, since the layout and the\n * renderer it pins ship with the package. Pre-fetched `images` are left out:\n * the endpoint never passes them.\n */\nexport const cardCacheKey = async (\n version: string,\n options: OgCardOptions\n): Promise<string> => {\n const fonts = await Promise.all(\n (options.fonts ?? []).map(async (font) =>\n isLocalOgFont(font)\n ? { ...font, digest: await localFontDigest(font.src) }\n : font\n )\n );\n const card = { ...options, fonts: undefined, images: undefined };\n return createHash(\"sha256\")\n .update(JSON.stringify({ card, fonts, version }))\n .digest(\"hex\");\n};\n\nconst cardPath = (cache: OgCache, key: string): string =>\n join(cache.dir, `${key}.png`);\n\n/** A cached card's bytes, or `null` when there is none. */\nconst readCard = async (file: string): Promise<Uint8Array | null> => {\n try {\n return await readFile(file);\n } catch {\n return null;\n }\n};\n\n// Written to a sibling temp file and renamed into place: concurrent page\n// renders may store the same key, and a reader must never see a half-written\n// card.\nconst storeCard = async (file: string, png: Uint8Array): Promise<void> => {\n await mkdir(dirname(file), { recursive: true });\n const tmp = `${file}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;\n await writeFile(tmp, png);\n await rename(tmp, file);\n};\n\n/** The in-flight renders of this process, so duplicate titles render once. */\nconst inflight = new Map<string, Promise<Uint8Array>>();\n\nconst renderAndStore = async (\n key: string,\n file: string,\n options: OgCardOptions,\n render: (options: OgCardOptions) => Promise<Uint8Array>\n): Promise<Uint8Array> => {\n try {\n const png = await render(options);\n try {\n await storeCard(file, png);\n } catch {\n // An unwritable cache (a read-only workspace) never fails the build.\n }\n return png;\n } finally {\n inflight.delete(key);\n }\n};\n\n/**\n * Serve a card from `cache`, rendering it with `render` on a miss and storing\n * the result for the next build. Without a cache every card renders; the\n * cache is only ever a shortcut.\n */\nexport const throughCardCache = async (\n cache: OgCache | undefined,\n options: OgCardOptions,\n render: (options: OgCardOptions) => Promise<Uint8Array>\n): Promise<Uint8Array> => {\n if (!cache) {\n return render(options);\n }\n const key = await cardCacheKey(cache.version, options);\n const state = registry();\n state.used.add(key);\n const file = cardPath(cache, key);\n const hit = await readCard(file);\n if (hit) {\n state.hits += 1;\n return hit;\n }\n let pending = inflight.get(key);\n if (!pending) {\n state.misses += 1;\n pending = renderAndStore(key, file, options, render);\n inflight.set(key, pending);\n }\n return pending;\n};\n\n/**\n * Remove the cards this build never asked for — a renamed page, a changed\n * description, a previous Blume version — plus any temp file a crashed build\n * left behind, so a persisted cache holds exactly the current site's cards.\n * Returns how many files were removed; a missing directory removes nothing.\n */\nexport const pruneCardCache = async (dir: string): Promise<number> => {\n const { used } = registry();\n let entries: string[];\n try {\n entries = await readdir(dir);\n } catch {\n return 0;\n }\n const stale = entries.filter(\n (name) =>\n name.endsWith(\".tmp\") ||\n (name.endsWith(\".png\") && !used.has(name.slice(0, -\".png\".length)))\n );\n await Promise.all(stale.map((name) => rm(join(dir, name), { force: true })));\n return stale.length;\n};\n\n/**\n * This process's card cache tally — how many cards a build reused and how many\n * it rendered — or `null` when no card was requested (OG cards off, or an\n * endpoint-free build).\n */\nexport const cardCacheTally = (): { hits: number; misses: number } | null => {\n const { hits, misses } = registry();\n return hits + misses === 0 ? null : { hits, misses };\n};\n\n/** Reset the tally and the used-key set (tests). */\nexport const resetCardCacheTally = (): void => {\n const state = registry();\n state.hits = 0;\n state.misses = 0;\n state.used.clear();\n};\n",
12
- "import { createHash } from \"node:crypto\";\nimport { existsSync, readFileSync, realpathSync } from \"node:fs\";\nimport {\n lstat,\n mkdir,\n readFile,\n readlink,\n realpath,\n rm,\n symlink,\n} from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\n\nimport pMap from \"p-map\";\nimport { dirname, isAbsolute, join, normalize, relative, resolve } from \"pathe\";\nimport { glob } from \"tinyglobby\";\n\nimport { hasAiCatalog } from \"../ai/ai-catalog.ts\";\nimport { OPENAPI_PATH } from \"../ai/api/paths.ts\";\nimport { buildApiSpec } from \"../ai/api/spec.ts\";\nimport { buildAskData } from \"../ai/ask-data.ts\";\nimport { resolveAskBackend } from \"../ai/ask.ts\";\nimport { buildHomeLinkHeader } from \"../ai/link-headers.ts\";\nimport { buildRawMarkdown, markdownRoutePaths } from \"../ai/markdown.ts\";\nimport type { RawMarkdownEntry } from \"../ai/markdown.ts\";\nimport { buildMcpData } from \"../ai/mcp/data.ts\";\nimport type { McpData } from \"../ai/mcp/data.ts\";\nimport { buildMcpDiscovery, buildMcpServerCard } from \"../ai/mcp/discovery.ts\";\nimport { captchaSettings } from \"../captcha/schema.ts\";\nimport { parseApiEndpoint } from \"../components/content/api-page.ts\";\nimport {\n hasDeferrableGroups,\n navVariants,\n} from \"../components/layout/nav-utils.ts\";\nimport { normalizeBasePath, withBasePath } from \"../core/base-path.ts\";\nimport { withChangelogIndexText } from \"../core/changelog-index.ts\";\nimport {\n missingExampleDiagnostics,\n unknownPropDiagnostics,\n validateUsedComponents,\n} from \"../core/component-diagnostics.ts\";\nimport {\n analyzeComponentOverrides,\n emptyComponentOverrides,\n} from \"../core/component-overrides.ts\";\nimport type { ComponentOverrideAnalysis } from \"../core/component-overrides.ts\";\nimport {\n collectContentAssets,\n rewriteRelativeAssets,\n} from \"../core/content-assets.ts\";\nimport type {\n BlumeBanner,\n BlumeDataConfig,\n BlumeData,\n BlumeFavicon,\n BlumeLogo,\n} from \"../core/data.ts\";\nimport {\n BlumeError,\n enrichDiagnostic,\n formatDiagnostic,\n} from \"../core/diagnostics.ts\";\nimport { writeTextAtomic } from \"../core/fs-atomic.ts\";\nimport { gitIgnoredPaths } from \"../core/git-ignored.ts\";\nimport {\n apiUrl as githubApiUrl,\n editBaseUrl as githubEditBaseUrl,\n repoUrl as githubRepoUrl,\n} from \"../core/github.ts\";\nimport { EN_UI, resolveUIStrings } from \"../core/i18n-ui.ts\";\nimport { resolveFallbackLocale } from \"../core/i18n.ts\";\nimport { buildIncludeGraph } from \"../core/includes.ts\";\nimport { resolveLocalizable } from \"../core/localizable.ts\";\nimport {\n validateNavTargets,\n validateSearchPopularIcons,\n} from \"../core/nav-diagnostics.ts\";\nimport { packageRoot } from \"../core/package-root.ts\";\nimport type { BlumeProject } from \"../core/project-graph.ts\";\nimport type { ResolvedConfig } from \"../core/schema.ts\";\nimport { resolveDocsCollection } from \"../core/sources/resolve.ts\";\nimport { svgDimensions } from \"../core/svg-dimensions.ts\";\nimport { trimChar } from \"../core/trim.ts\";\nimport { resolveTsconfigAliases } from \"../core/tsconfig-aliases.ts\";\nimport type { Diagnostic, Navigation } from \"../core/types.ts\";\nimport { getBlumeVersion } from \"../core/version.ts\";\nimport { servedFiles } from \"../deploy/generated-files.ts\";\nimport { buildRssFeeds, renderRssFeed } from \"../deploy/rss.ts\";\nimport {\n languageIconCss,\n languageIconSlugsIn,\n} from \"../markdown/language-icon.ts\";\nimport { hasMermaidFence } from \"../markdown/mermaid.ts\";\nimport { ogCacheDir } from \"../og/cache.ts\";\nimport { missingFontFiles, resolveOgFonts } from \"../og/derive.ts\";\nimport type { DerivedOgFonts } from \"../og/derive.ts\";\nimport { resolveOgLogo } from \"../og/logo.ts\";\nimport type { AsyncApiSpecValue } from \"../openapi/asyncapi.ts\";\nimport type { ApiSpecData, HttpMethod, OpenApiData } from \"../openapi/model.ts\";\nimport { HTTP_METHODS, withServerDefaults } from \"../openapi/model.ts\";\nimport {\n apiPagesUseBuiltinProxy,\n builtinProxyReferences,\n hasScalarReferences,\n needsPlaygroundProxy,\n} from \"../openapi/references.ts\";\nimport { buildReferenceFiles } from \"../openapi/scalar.ts\";\nimport { isOpenApiSource } from \"../openapi/source.ts\";\nimport { registry } from \"../registry/registry.ts\";\nimport { buildSearchDocuments } from \"../search/documents.ts\";\nimport { resolveSearchPopular } from \"../search/popular.ts\";\nimport { sourcePages } from \"../search/source-pages.ts\";\nimport {\n examplesEntryTemplate,\n tailwindEntryTemplate,\n} from \"../theme/entry.ts\";\nimport {\n buildFontsCss,\n configuredFonts,\n fontLocaleCodes,\n} from \"../theme/fonts.ts\";\nimport { buildThemeCss } from \"../theme/palette.ts\";\nimport { rebaseSourceDirectives } from \"../theme/sources.ts\";\nimport { twoslashCss } from \"../theme/twoslash.ts\";\nimport { planComponentSlots } from \"./component-slots.ts\";\nimport {\n EXAMPLE_SCAN_GLOB,\n discoverExamples,\n exampleMarkdownLookup,\n exampleScanRoots,\n} from \"./examples.ts\";\nimport { publishDevNegotiation } from \"./integration.ts\";\nimport { discoverIslands } from \"./islands.ts\";\nimport {\n customOgRoutes,\n discoverPages,\n hasGeneratedChangelog,\n navTargetRoutes,\n routeIsTaken,\n} from \"./pages.ts\";\nimport { candidateHolding } from \"./render-deps.ts\";\nimport { missingDependencyDiagnostic } from \"./runtime-deps.ts\";\nimport { publishRuntimeModules } from \"./runtime-modules.ts\";\nimport type { RuntimeModuleId } from \"./runtime-modules.ts\";\nimport {\n askComponentTemplate,\n askEndpointTemplate,\n astroConfigTemplate,\n catchAllPageTemplate,\n changelogIndexTemplate,\n contentAssetsEndpointTemplate,\n contentConfigTemplate,\n exampleMapTemplate,\n exampleWrapperTemplate,\n examplesPageTemplate,\n exampleSlug,\n apiNavigationTemplate,\n apiNotFoundTemplate,\n apiPageTemplate,\n apiPagesIndexTemplate,\n apiSearchTemplate,\n mcpEndpointTemplate,\n mcpPageFile,\n mixedbreadSearchEndpointTemplate,\n notFoundJsonTemplate,\n notFoundMarkdownTemplate,\n notFoundPageTemplate,\n ogEndpointTemplate,\n playgroundProxyTemplate,\n rawMarkdownEndpointTemplate,\n rssEndpointTemplate,\n staticJsonEndpointTemplate,\n runtimeDependencies,\n runtimePackageTemplate,\n runtimeTsconfigTemplate,\n featuresTemplate,\n navFragmentTemplate,\n consentClientTemplate,\n searchClientTemplate,\n searchEndpointTemplate,\n stagedContentDir,\n} from \"./templates.ts\";\nimport type { ClientFeatures } from \"./templates.ts\";\n\n// The render-deps plugin and the dependency-directory probe live in\n// `render-deps.ts`; `blume/astro` and existing callers import them from here.\nexport { blumeDepsDir, prerenderDepsPlugin } from \"./render-deps.ts\";\nexport type { PrerenderDepsPlugin } from \"./render-deps.ts\";\n\n/** Absolute path to the Blume package `src` directory. */\nconst BLUME_SRC = join(packageRoot(), \"src\");\n\n/**\n * Whether the generated `react()` call turns the React Compiler on: React and\n * `react.compiler` are both on, and `oxc-transform-react` (Blume ships it)\n * resolves. False when React or the compiler is off.\n *\n * The compiler is loaded by `@vitejs/plugin-react` with a bare\n * `import(\"oxc-transform-react\")` from its own directory, which fails the\n * build when it throws, so the check walks the same chain — Blume →\n * `@astrojs/react` → `@vitejs/plugin-react` — rather than resolving from\n * Blume's root, which a strict package manager may not link the plugin to.\n */\nexport const resolveReactCompiler = (\n config: ResolvedConfig,\n needsReact: boolean,\n pkgDir: string = packageRoot()\n): boolean => {\n if (!(needsReact && config.react.compiler)) {\n return false;\n }\n try {\n const astroReact = createRequire(\n pathToFileURL(join(pkgDir, \"_.js\")).href\n ).resolve(\"@astrojs/react\");\n const pluginReact = createRequire(astroReact).resolve(\n \"@vitejs/plugin-react\"\n );\n createRequire(pluginReact).resolve(\"oxc-transform-react\");\n return true;\n } catch {\n return false;\n }\n};\n\n/**\n * Warning (as a spreadable list) for the case where the React Compiler was\n * requested but its plugin couldn't be resolved — so the build silently drops\n * to uncompiled output rather than failing. Exported for testing.\n */\nexport const reactCompilerWarnings = (\n config: ResolvedConfig,\n needsReact: boolean,\n compiler: boolean\n): string[] =>\n needsReact && config.react.compiler && !compiler\n ? [\n \"React Compiler is enabled but `oxc-transform-react` could not be resolved; falling back to an uncompiled build. Reinstall Blume, or set `react: { compiler: false }` to silence this.\",\n ]\n : [];\n\n/** Resolve Astro's package.json directly inside a node_modules directory. */\nconst resolveAstroPackageJson = (modulesDir: string): string | null => {\n try {\n return realpathSync(join(modulesDir, \"astro\", \"package.json\"));\n } catch {\n return null;\n }\n};\n\n/**\n * The `astro` package reachable through the normal node_modules ancestor walk\n * from a generated runtime — its realpath'd `package.json` plus the\n * `node_modules` directory the walk found it in — or null when none resolves.\n *\n * This deliberately does not use `createRequire().resolve()`. pnpm's generated\n * bin shim adds Blume's virtual-store dependencies to `NODE_PATH`, which\n * CommonJS resolution honors but ESM package resolution ignores. The generated\n * Astro config uses ESM imports, so treating a NODE_PATH-only result as\n * reachable skips the dependency link and makes `import \"astro/config\"` fail.\n * Walking the physical node_modules ancestors mirrors the lookup that config\n * actually gets.\n *\n * The containing directory matters as much as the package: under an isolated\n * linker the walk can find a store-deduped astro in a directory that holds\n * nothing else of Blume's, so \"the right astro resolves\" does not imply \"the\n * integrations resolve\" — callers must check where the hit came from.\n */\nconst resolvedAstroHit = (\n fromDir: string\n): { modulesDir: string; pkg: string } | null => {\n let dir = normalize(fromDir);\n while (true) {\n const modulesDir = join(dir, \"node_modules\");\n const pkg = resolveAstroPackageJson(modulesDir);\n if (pkg) {\n return { modulesDir, pkg };\n }\n const parent = dirname(dir);\n if (parent === dir) {\n return null;\n }\n dir = parent;\n }\n};\n\n/**\n * Whether two paths name the same physical directory (realpath equality).\n * Exported for testing.\n */\nexport const sameRealDir = (a: string, b: string): boolean => {\n try {\n return realpathSync(a) === realpathSync(b);\n } catch {\n return false;\n }\n};\n\n/**\n * Create `link` as a directory symlink to `target`, falling back to a junction.\n *\n * The type only matters on Windows, and there a junction is the wrong first\n * choice: Windows can't follow a *relative* symlink reached through a\n * junction (it resolves the relative target against the junction-side path,\n * so it lands outside the store and every lookup is ENOENT), and Bun's\n * isolated linker writes exactly those into Blume's dependency directory\n * whenever it holds symlink privilege. A directory symlink traverses them\n * fine. Without that privilege (no Developer Mode, non-admin shell) creating\n * one fails, so fall back to a junction — and in that session the installer\n * had no privilege either, so the deps are absolute junctions a junction can\n * follow. Exported for testing.\n */\nexport const symlinkDir = async (\n target: string,\n link: string\n): Promise<void> => {\n try {\n await symlink(target, link, \"dir\");\n } catch {\n await symlink(target, link, \"junction\");\n }\n};\n\n/**\n * Point `link` at Blume's dependency directory via a `node_modules` link,\n * replacing a stale link we own and leaving a real directory untouched.\n *\n * `lstat`, not `existsSync`, so a broken link (target since moved) is still\n * detected — `existsSync` follows the link and reports a dangling one as absent.\n */\nconst linkDepsJunction = async (\n link: string,\n depsDir: string\n): Promise<void> => {\n let existing: Awaited<ReturnType<typeof lstat>> | null;\n try {\n existing = await lstat(link);\n } catch {\n existing = null;\n }\n if (existing) {\n if (!existing.isSymbolicLink()) {\n return;\n }\n // Already pointing at the right target — leave it alone. This runs on\n // every dev regeneration, and an unconditional rm+recreate opens a window\n // in which the Vite server's module resolution races a missing\n // `node_modules` and 500s intermittently.\n try {\n if (resolve(dirname(link), await readlink(link)) === resolve(depsDir)) {\n return;\n }\n } catch {\n // Unreadable link — replace it below.\n }\n await rm(link, { force: true });\n }\n await mkdir(dirname(link), { recursive: true });\n await symlinkDir(depsDir, link);\n};\n\n/** Read the `version` field of a `package.json`, or null when unreadable. */\nconst readPkgVersion = (pkgJsonPath: string | null): string | null => {\n if (!pkgJsonPath) {\n return null;\n }\n try {\n return JSON.parse(readFileSync(pkgJsonPath, \"utf-8\")).version ?? null;\n } catch {\n return null;\n }\n};\n\n/**\n * Build the diagnostic for a split-layout Astro conflict that a symlink can't\n * repair: a different Astro is hoisted to the project root, shadowing Blume's,\n * and `@astrojs/mdx` binds to the wrong copy. `blumeAstroPkg`/`shadowAstroPkg`\n * are the resolved `astro/package.json` paths for Blume's set and the one the\n * runtime actually resolves.\n */\nconst astroConflictWarning = (\n blumeAstroPkg: string | null,\n shadowAstroPkg: string | null\n): string => {\n const blume = readPkgVersion(blumeAstroPkg);\n const shadow = readPkgVersion(shadowAstroPkg);\n const versions =\n blume && shadow\n ? `astro@${shadow} shadowing Blume's astro@${blume}`\n : \"a second copy of Astro shadowing Blume's\";\n const pin = blume ?? \"<Blume's astro version>\";\n return `Astro version conflict: another dependency hoisted ${versions} to the project root, so @astrojs/mdx binds to the wrong copy and the build fails on a missing export (e.g. \"chunkToString\"). A single symlink can't reconcile a split install — pin Blume's Astro by adding a package.json \"overrides\" (npm/bun/pnpm) or \"resolutions\" (yarn) entry { \"astro\": \"${pin}\" }, then reinstall. Run \\`npm ls astro\\` to find the dependency pulling the older copy.`;\n};\n\n/**\n * Drop a `.blume/node_modules` junction that resolves a *different* Blume than\n * the one running. A restored build cache (e.g. Vercel's) can resurrect the\n * junction pointing into a superseded store directory — blume@1.1.0's isolated\n * deps dir after 1.1.1 was installed. Releases rarely bump Astro, so the stale\n * target still resolves the very same astro and every astro-based probe in\n * {@link ensureDepsLink} passes through the link — while the `blume/*` imports\n * in the freshly generated config load the previous release, crashing on any\n * export added since. Staleness is judged by realpath: the link is stale\n * exactly when the directory behind it holds a `blume` that isn't `pkgDir`.\n * A target with no `blume` entry (the workspace layout links\n * `packages/blume/node_modules`, which holds only the deps) resolves Blume\n * through the normal ancestor walk and stays. Real directories stay too,\n * mirroring {@link linkDepsJunction} — we only ever remove a link we own.\n */\nconst dropStaleDepsLink = async (\n link: string,\n pkgDir: string\n): Promise<void> => {\n let existing: Awaited<ReturnType<typeof lstat>>;\n try {\n existing = await lstat(link);\n } catch {\n return;\n }\n if (!existing.isSymbolicLink()) {\n return;\n }\n let linkedBlume: string;\n let runningBlume: string;\n try {\n linkedBlume = await realpath(join(link, \"blume\"));\n runningBlume = await realpath(pkgDir);\n } catch {\n return;\n }\n if (linkedBlume !== runningBlume) {\n await rm(link, { force: true });\n }\n};\n\n/**\n * Make the generated runtime resolve Astro and its integrations against Blume's\n * own dependency set. Three failure modes this repairs:\n *\n * - Astro is *unreachable* from `.blume/` (workspaces under isolated linkers,\n * pnpm) — the deps live in a store the upward walk can't see.\n * - Astro *resolves to the wrong copy* — a hoisted sibling pinned an older\n * major (e.g. `astro@6` for a type-only import) that shadows Blume's\n * `astro@7`, so `@astrojs/mdx@7` binds to it and crashes the build on a\n * missing export. Resolving merely *an* astro isn't enough; it must be the\n * same one Blume uses.\n * - The *integrations* are unreachable while astro is fine — npm's split\n * install. An `overrides` pin plus an incremental `npm install` hoists\n * astro to the project root (deleting Blume's nested copy) but leaves\n * `@astrojs/mdx` and friends nested under `blume/node_modules`, where the\n * upward walk from `.blume/` can't see them. The same shape arises under\n * an isolated linker when the workspace itself declares astro at a version\n * matching Blume's: the store dedupes both to one copy, so the walk finds\n * the \"correct\" astro through the workspace's own direct-dep symlink — in\n * a node_modules holding none of Blume's other deps.\n *\n * The repair is the same symlink: Blume's dependency directory linked in as\n * `.blume/node_modules` so the generated config's bare specifiers (`astro`,\n * `@astrojs/mdx`, …) bind to a consistent set. That's safe when the linked\n * directory holds the full set, or when it holds only the integrations but the\n * runtime already resolves Blume's astro — the junction has no `astro` entry,\n * so astro lookups fall through to the hoisted copy the integrations bind to\n * anyway. What it can't fix is the inverse split: Blume's astro nested under a\n * *conflicting* hoisted astro with the integrations hoisted away from it. No\n * single directory yields a consistent set there; only a root `overrides`/\n * `resolutions` pin does, so we return a diagnostic naming the conflict rather\n * than silently shipping a runtime that crashes downstream. Returns the\n * warning, or null when nothing needs saying.\n */\nexport const ensureDepsLink = async (\n outDir: string,\n pkgDir: string = packageRoot()\n): Promise<string | null> => {\n const astroDir = candidateHolding(pkgDir, \"astro\");\n if (!astroDir) {\n return null;\n }\n const mdxDir = candidateHolding(pkgDir, \"@astrojs\", \"mdx\");\n const blumeAstro = resolveAstroPackageJson(astroDir);\n // Before probing what `.blume/` resolves, drop a cache-restored junction\n // that binds it to a superseded Blume — the probes below would otherwise\n // pass right through it (same astro, older blume) and leave it in place.\n await dropStaleDepsLink(join(outDir, \"node_modules\"), pkgDir);\n const outDirHit = resolvedAstroHit(outDir);\n // `.blume/` resolves the very same astro Blume's deps provide.\n const astroCorrect = blumeAstro !== null && outDirHit?.pkg === blumeAstro;\n // Clean hoisted install: astro is correct, found in Blume's own dependency\n // directory, and the integrations sit beside it — the same walk resolves\n // them too, so there is nothing to do. Requiring the walk to land in\n // `astroDir` itself (not merely resolve an identical astro) matters under\n // isolated linkers: a workspace that declares astro at a version matching\n // Blume's gets a store-deduped symlink in its own node_modules, so the walk\n // finds the \"correct\" astro in a directory holding only the workspace's\n // direct deps — none of Blume's integrations (issue #103).\n const walkLandsInDeps =\n astroCorrect &&\n outDirHit !== null &&\n sameRealDir(outDirHit.modulesDir, astroDir);\n if (walkLandsInDeps && mdxDir === astroDir) {\n return null;\n }\n // Linking the integrations' directory yields a consistent set when it also\n // holds Blume's astro (the unreachable and repairable-conflict cases) or\n // when the correct astro is reachable without it (the npm split install).\n // Any existing link here is stale and gets replaced.\n if (mdxDir && (mdxDir === astroDir || astroCorrect)) {\n await linkDepsJunction(join(outDir, \"node_modules\"), mdxDir);\n return null;\n }\n // Split layout: Blume's astro is nested (a conflicting astro took the root\n // spot) but @astrojs/mdx hoisted away from it, binding to the shadow. Only a\n // root pin fixes this — surface it.\n return astroConflictWarning(blumeAstro, outDirHit?.pkg ?? null);\n};\n\n/** Absolute path to the configured `examples.css`, or null when unset. */\nconst examplesCssFile = (\n root: string,\n config: ResolvedConfig\n): string | null =>\n config.examples.css ? join(root, config.examples.css) : null;\n\n/**\n * Write the per-example preview route (`{basePath}/blume-examples/<path>`)\n * that `<Component />` iframes embed — the iframe boundary is what isolates\n * previews from the docs CSS. Nested under `basePath` in the filesystem so\n * the routes stay reachable behind a proxy that only forwards the base;\n * pruneOrphans clears a stale copy when `basePath` changes or the last\n * example is removed. Returns (as a spreadable list) a warning when the\n * configured `examples.css` doesn't exist.\n */\nconst writeExamplesPreview = async (options: {\n config: ResolvedConfig;\n hasExamples: boolean;\n root: string;\n srcDir: string;\n write: (path: string, content: string) => Promise<boolean>;\n}): Promise<string[]> => {\n const { config, hasExamples, root, srcDir, write } = options;\n if (hasExamples) {\n await write(\n join(\n srcDir,\n \"pages\",\n ...config.basePath.split(\"/\").filter(Boolean),\n \"blume-examples\",\n \"[...path].astro\"\n ),\n examplesPageTemplate()\n );\n }\n const cssFile = examplesCssFile(root, config);\n return cssFile && !existsSync(cssFile)\n ? [\n `examples.css points at \"${config.examples.css}\", which doesn't exist; previews render without it.`,\n ]\n : [];\n};\n\n/** Read a file's contents, or return an empty string if it is absent. */\nconst readOptional = async (path: string | null): Promise<string> => {\n if (!path) {\n return \"\";\n }\n try {\n return await readFile(path, \"utf-8\");\n } catch {\n return \"\";\n }\n};\n\n/**\n * Read a user stylesheet (`theme.css`, `examples.css`) that gets inlined into\n * a generated Tailwind entry under `outputDir`, re-rooting its relative\n * `@source` paths so they still resolve from where the author wrote them.\n */\nconst readUserCss = async (\n file: string | null,\n outputDir: string\n): Promise<string> => {\n const css = await readOptional(file);\n return file\n ? rebaseSourceDirectives(css, { from: file, to: outputDir })\n : css;\n};\n\n/** Heuristically detect whether the project uses React islands. */\nexport const detectNeedsReact = async (root: string): Promise<boolean> => {\n const matches = await glob([\"**/*.{tsx,jsx}\"], {\n cwd: root,\n ignore: [\"**/node_modules/**\", \"**/.blume/**\", \"**/dist/**\"],\n onlyFiles: true,\n });\n return matches.length > 0;\n};\n\n/** Block math (`$$…$$`) or an explicitly authored `<Math …>` component. */\nconst containsMath = (content: string): boolean =>\n content.includes(\"$$\") || content.includes(\"<Math\");\n\n/** Ceiling on concurrent content-file reads; unbounded fan-out risks EMFILE. */\nconst READ_CONCURRENCY = 16;\n\n/**\n * Detect whether the project can render math: block math (`$$…$$`) or an\n * explicit `<Math>` tag in any local `.md`/`.mdx`, or in staged (non-filesystem)\n * source bodies. Drives whether the generated runtime imports the `<Math>`\n * component and KaTeX's stylesheet, so a math-free site ships no KaTeX CSS.\n * Math parsing itself is always on but block-only, so one of those literals is\n * a necessary condition — no false negatives. A stray `$$` (e.g. inside a code\n * fence) merely over-includes the idempotent import, which is harmless.\n */\nexport const detectUsesMath = async (\n root: string,\n staged: Iterable<string> = []\n): Promise<boolean> => {\n const files = await glob([\"**/*.{md,mdx}\"], {\n cwd: root,\n ignore: [\"**/node_modules/**\", \"**/.blume/**\", \"**/dist/**\"],\n onlyFiles: true,\n });\n const contents = await pMap(files, (file) => readOptional(join(root, file)), {\n concurrency: READ_CONCURRENCY,\n });\n return [...contents, ...staged].some(containsMath);\n};\n\nconst hashConfigSource = (source: string): string =>\n createHash(\"sha256\").update(source).digest(\"hex\");\n\nconst loadIntegrationBridge = async (\n config: ResolvedConfig,\n context: BlumeProject[\"context\"]\n): Promise<Parameters<typeof astroConfigTemplate>[0][\"integrationBridge\"]> => {\n if (config.integrations.length === 0 || !context.configFile) {\n return;\n }\n return {\n configFile: relative(context.outDir, context.configFile),\n sourceHash: hashConfigSource(await readOptional(context.configFile)),\n };\n};\n\nconst writeIfChanged = async (\n path: string,\n content: string\n): Promise<boolean> => {\n let existing: string | null = null;\n try {\n existing = await readFile(path, \"utf-8\");\n } catch {\n existing = null;\n }\n if (existing === content) {\n return false;\n }\n // Atomic temp-write + rename, so a watching dev server never observes a\n // missing or half-written file mid-regeneration.\n await writeTextAtomic(path, content);\n return true;\n};\n\n/**\n * Delete generated files under `srcDir` that this pass didn't (re)write. The\n * generator emits many files conditionally — an assistant endpoint, OG images, a\n * search index, RSS feeds, reference pages, the MCP server — so toggling a\n * feature off would otherwise leave a stale file behind, and a leftover\n * server-rendered endpoint breaks the static build. `writeIfChanged` only ever\n * adds or updates, so this closes the loop. Scoped to `.blume/src`, so it never\n * touches Astro's `dist/`, `.astro/` cache, or the symlinked `node_modules`\n * (all of which live outside `src`). `written` holds normalized absolute paths.\n */\nexport const pruneOrphans = async (\n srcDir: string,\n written: Set<string>\n): Promise<void> => {\n const existing = await glob(\"**/*\", {\n absolute: true,\n cwd: srcDir,\n onlyFiles: true,\n });\n const removals: Promise<void>[] = [];\n for (const path of existing) {\n const normalized = normalize(path);\n if (!written.has(normalized)) {\n removals.push(rm(normalized, { force: true }));\n }\n }\n await Promise.all(removals);\n};\n\n/**\n * Collect staged (non-filesystem) page bodies keyed by their Astro entry id, so\n * i18n duplicates of one entry collapse to a single materialized file. Shared\n * with `eject`, which materializes the same bodies into the owned project.\n */\nexport const collectStaged = (project: BlumeProject): Map<string, string> => {\n const staged = new Map<string, string>();\n for (const page of project.graph.pages) {\n if (page.collection === \"staged\" && page.entryId && page.body) {\n // A colocated `./image.png` reference resolves against `.blume/content`\n // once the body is materialized there, where the file does not exist.\n // Point it at the served original instead — the same rewrite the\n // agent-facing Markdown gets.\n const text = page.sourcePath\n ? rewriteRelativeAssets({\n deployBase: project.config.deployment.options.base,\n projectRoot: project.context.root,\n source: page.body.text,\n sourcePath: page.sourcePath,\n })\n : page.body.text;\n staged.set(page.entryId, text);\n }\n }\n return staged;\n};\n\n/**\n * Materialize staged source bodies under `.blume/content` and prune orphans in\n * that tree (separate from `.blume/src`), so a removed remote entry is cleaned up.\n */\nconst writeStagedContent = async (\n out: string,\n staged: Map<string, string>\n): Promise<void> => {\n const contentDir = stagedContentDir(out);\n const written = new Set<string>();\n await Promise.all(\n [...staged].map(async ([entryId, text]) => {\n const path = join(contentDir, entryId);\n written.add(normalize(path));\n await writeIfChanged(path, text);\n })\n );\n if (existsSync(contentDir)) {\n await pruneOrphans(contentDir, written);\n }\n};\n\ninterface LogoDimensions {\n height: number;\n width: number;\n}\n\n/**\n * Read dimensions from an SVG's explicit size or its view box, with the same\n * root-tag parser og/card.ts uses for the OG brand mark so the header and the\n * card can't disagree about one logo. An SVG with no usable size collapses to\n * undefined.\n */\nconst logoDimensions = (svg: string | undefined): LogoDimensions | undefined =>\n svg ? (svgDimensions(svg) ?? undefined) : undefined;\n\n/** Read a local SVG logo from the project root or public directory. */\nconst readLogoSvg = (\n project: BlumeProject,\n source: string | undefined\n): string | undefined => {\n if (!source?.toLowerCase().endsWith(\".svg\")) {\n return;\n }\n const rel = source.replace(/^\\//u, \"\");\n const file = [\n join(project.context.root, \"public\", rel),\n join(project.context.root, rel),\n ].find((path) => existsSync(path));\n return file ? readFileSync(file, \"utf-8\") : undefined;\n};\n\n/** Narrows a config union's string shorthand from its object form. */\nconst isStringShorthand = <T>(value: T | string): value is string =>\n typeof value === \"string\";\n\n/**\n * The URL behind the footer's repo mark. A string is used as-is: `github`\n * drives the per-page edit link, the footer mark and the manifest's\n * `repository` together, so a project whose docs repo is private has to unset\n * all three, and would otherwise have no way to point the mark at anything.\n */\nconst footerRepoUrl = (\n repo: boolean | string,\n derived: string | null\n): string | null => {\n if (isStringShorthand(repo)) {\n return repo;\n }\n return repo ? derived : null;\n};\n\n/**\n * Resolve the configured logo. A single SVG is read and inlined so a\n * `currentColor` logo follows the theme; other images keep their URL for an\n * `<img>`. The file is looked up under `public/` and the project root.\n */\nconst resolveLogo = (project: BlumeProject): BlumeLogo | null => {\n const { logo } = project.config;\n if (!logo) {\n return null;\n }\n const config = isStringShorthand(logo) ? { image: logo } : logo;\n // `text` is passed through verbatim: `undefined` lets the brand fall back to\n // the site title, `\"\"` renders the mark alone (a logo with the wordmark baked\n // in).\n const { href, image: source, text } = config;\n const image = isStringShorthand(source) ? { light: source } : source;\n const light = image?.light ?? image?.dark;\n const dark = image?.dark ?? image?.light;\n const alt = image?.alt ?? \"\";\n const brandHref = href ?? \"/\";\n const lightSvg = readLogoSvg(project, light);\n const darkSvg = dark === light ? lightSvg : readLogoSvg(project, dark);\n\n if (light && light === dark && lightSvg) {\n return { alt, href: brandHref, svg: lightSvg, text };\n }\n\n const lightDimensions = logoDimensions(lightSvg);\n const darkDimensions = logoDimensions(darkSvg);\n const dimensions =\n lightDimensions || darkDimensions\n ? { dark: darkDimensions, light: lightDimensions }\n : undefined;\n return { alt, dark, dimensions, href: brandHref, light, text };\n};\n\n/**\n * Favicon filenames Blume auto-detects, in priority order. Mirrors the Next.js\n * convention: an `icon.*` or `favicon.*` file in `public/` or the project root\n * becomes the site favicon, no config required.\n */\nconst FAVICON_CANDIDATES = [\n \"icon.svg\",\n \"favicon.svg\",\n \"icon.png\",\n \"favicon.png\",\n \"favicon.ico\",\n \"icon.ico\",\n];\n\n/**\n * Derive the `-dark` sibling of an icon filename (`icon.svg` → `icon-dark.svg`),\n * inserting the suffix before the extension.\n */\nconst darkSibling = (name: string): string =>\n name.replace(/\\.(?=[^.]+$)/u, \"-dark.\");\n\n/** `<link type>` MIME for the favicon extensions we recognize. */\nconst FAVICON_TYPES = new Map([\n [\"ico\", \"image/x-icon\"],\n [\"jpeg\", \"image/jpeg\"],\n [\"jpg\", \"image/jpeg\"],\n [\"png\", \"image/png\"],\n [\"svg\", \"image/svg+xml\"],\n]);\n\n/** Infer the `<link type>` MIME from a filename, when we recognize the extension. */\nconst faviconType = (name: string): string | undefined => {\n const ext = name.split(\".\").pop()?.toLowerCase();\n return ext ? FAVICON_TYPES.get(ext) : undefined;\n};\n\n/** Read a file and encode it as a `data:` URI of the given MIME type. */\nconst inlineDataUri = (file: string, type: string): string =>\n `data:${type};base64,${readFileSync(file).toString(\"base64\")}`;\n\n/**\n * The bundled Blume favicon, inlined as a data URI so it needs no public file.\n * The mark is dark, so it ships with a light-on-transparent dark-scheme variant —\n * otherwise it disappears against dark browser chrome.\n */\nconst defaultFavicon = (): BlumeFavicon => ({\n dark: {\n href: inlineDataUri(\n join(BLUME_SRC, \"assets\", \"icon-dark.png\"),\n \"image/png\"\n ),\n type: \"image/png\",\n },\n href: inlineDataUri(join(BLUME_SRC, \"assets\", \"icon.png\"), \"image/png\"),\n type: \"image/png\",\n});\n\n/**\n * Apple touch icon filenames Blume auto-detects, in priority order. Mirrors the\n * Next.js `apple-icon.*` convention (plus the `apple-touch-icon.png` most favicon\n * generators emit): a match in `public/` or the project root becomes the iOS\n * home-screen icon, no config required.\n */\nconst APPLE_ICON_CANDIDATES = [\n \"apple-icon.png\",\n \"apple-icon.jpg\",\n \"apple-icon.jpeg\",\n \"apple-touch-icon.png\",\n];\n\n/**\n * Resolve an icon file by convention. A candidate in `public/` is served as-is\n * and referenced by URL; one at the project root is inlined as a data URI (the\n * root isn't a served directory). Returns null when the project ships none.\n */\nconst resolveIconFile = (\n project: BlumeProject,\n candidates: string[]\n): BlumeFavicon | null => {\n const { root } = project.context;\n for (const name of candidates) {\n if (existsSync(join(root, \"public\", name))) {\n return { href: `/${name}`, type: faviconType(name) };\n }\n }\n for (const name of candidates) {\n const file = join(root, name);\n if (existsSync(file)) {\n const type = faviconType(name);\n return { href: inlineDataUri(file, type ?? \"image/x-icon\"), type };\n }\n }\n return null;\n};\n\n/**\n * Resolve the site favicon by convention, falling back to the bundled Blume mark\n * when the project ships no `icon.*`/`favicon.*` file. The dark-scheme variant\n * is anchored to the resolved icon: its `-dark` sibling (e.g. `icon.svg` →\n * `icon-dark.svg`) in the same directory — never an unrelated `-dark` file, so a\n * stale or foreign `favicon-dark.*` can't silently pair with a different mark.\n * A `-dark` file with no light sibling is the site's only mark and is used for\n * both schemes, mirroring how `resolveLogo` treats a single-variant image.\n */\nconst resolveFavicon = (project: BlumeProject): BlumeFavicon => {\n const { root } = project.context;\n for (const name of FAVICON_CANDIDATES) {\n if (existsSync(join(root, \"public\", name))) {\n const type = faviconType(name);\n const sibling = darkSibling(name);\n return existsSync(join(root, \"public\", sibling))\n ? { dark: { href: `/${sibling}`, type }, href: `/${name}`, type }\n : { href: `/${name}`, type };\n }\n }\n for (const name of FAVICON_CANDIDATES) {\n const file = join(root, name);\n if (existsSync(file)) {\n const type = faviconType(name);\n const mime = type ?? \"image/x-icon\";\n const siblingFile = join(root, darkSibling(name));\n return existsSync(siblingFile)\n ? {\n dark: { href: inlineDataUri(siblingFile, mime), type },\n href: inlineDataUri(file, mime),\n type,\n }\n : { href: inlineDataUri(file, mime), type };\n }\n }\n return (\n resolveIconFile(project, FAVICON_CANDIDATES.map(darkSibling)) ??\n defaultFavicon()\n );\n};\n\n/**\n * Resolve the Apple touch icon by convention, or null when the project ships\n * none (unlike the favicon, there's no bundled default). Note: iOS ignores\n * `data:`-URI apple-touch-icons, so a `public/` file (served by URL) is the\n * reliable path; a root-level file is still inlined for symmetry with favicons.\n * Deliberately no `-dark` sibling detection here: iOS ignores `media` on\n * `apple-touch-icon` links, so a dark variant could never be served.\n */\nconst resolveAppleIcon = (project: BlumeProject): BlumeFavicon | null =>\n resolveIconFile(project, APPLE_ICON_CANDIDATES);\n\n/** Normalize the banner config (string shorthand or object) for the runtime. */\nconst resolveBanner = (config: ResolvedConfig): BlumeBanner | null => {\n const { banner } = config;\n if (!banner) {\n return null;\n }\n if (isStringShorthand(banner)) {\n return { content: banner, dismissible: false, key: banner };\n }\n // `link.href` stays as authored; the link the banner renders is the\n // navigation's `bannerHref`, localized and mounted under `basePath`.\n return {\n content: banner.content,\n dismissible: banner.dismissible,\n key:\n banner.id ??\n resolveLocalizable(banner.content, undefined, config.i18n?.defaultLocale),\n link: banner.link,\n };\n};\n\n/** The URL the built-in proxy is injected at (see {@link planPlaygroundProxy}). */\nexport const playgroundProxyPattern = (config: ResolvedConfig): string =>\n withBasePath(config.basePath, \"/_api-proxy\");\n\n/**\n * The hand-written endpoint defaults for the runtime, the playground's\n * `proxy: true` resolved to the built-in route's URL, as an OpenAPI\n * reference's is.\n */\nconst resolveApiPages = (config: ResolvedConfig): BlumeDataConfig[\"api\"] => {\n const { auth, playground, server } = config.api;\n const resolved: BlumeDataConfig[\"api\"] = {\n playground: {\n enabled: playground.enabled,\n proxy:\n playground.proxy === true\n ? playgroundProxyPattern(config)\n : playground.proxy,\n },\n };\n if (auth) {\n resolved.auth = auth;\n }\n if (server) {\n resolved.server = server;\n }\n return resolved;\n};\n\n/** The footer config for the runtime: `null` when unset or empty, so no bare border renders. */\nconst resolveFooter = (\n config: ResolvedConfig\n): ResolvedConfig[\"footer\"] | null => {\n const { footer } = config;\n return footer &&\n (footer.links.length > 0 || Object.keys(footer.socials).length > 0)\n ? footer\n : null;\n};\n\n/**\n * The OG card's brand mark: a `seo.og.logo` of `false` opts out of any mark,\n * a configured SVG wins over the site logo, and a non-SVG value resolves to\n * `undefined` (the card falls back to the accent-initial tile).\n */\nconst resolveOgMark = (\n project: BlumeProject,\n siteLogo: string | undefined\n): string | false | undefined => {\n const configured = project.config.seo.og.logo;\n if (configured === false) {\n return false;\n }\n if (configured) {\n return resolveOgLogo(project, configured);\n }\n return siteLogo;\n};\n\n/**\n * The OG card's footer site text. A `seo.og.site` override wins (`false`\n * hides it); the default is the deployment site's host plus the normalized\n * deployment base — on a subpath deploy (a GitHub Pages project site) the\n * bare host is the platform's shared apex, not this site (#139).\n */\nconst resolveOgSite = (config: ResolvedConfig): string | undefined => {\n const configured = config.seo.og.site;\n if (configured === false) {\n return;\n }\n if (configured !== undefined) {\n return configured;\n }\n return config.deployment.options.site\n ? `${new URL(config.deployment.options.site).host}${normalizeBasePath(\n config.deployment.options.base\n )}`\n : undefined;\n};\n\n/**\n * The OG card's site-wide subtitle: `seo.og.description` (`false` omits it)\n * over the site description. The generated endpoint prefers a page's own\n * description and falls back to this.\n */\nconst resolveOgDescription = (config: ResolvedConfig): string | undefined => {\n const configured = config.seo.og.description;\n if (configured === false) {\n return;\n }\n return configured ?? config.description;\n};\n\n/**\n * Repo coordinates for content components. `host` and the derived `api` ride\n * along so a card on an Enterprise site links and queries that instance rather\n * than the public one.\n */\nconst resolveGithubData = (\n github: ResolvedConfig[\"github\"]\n): BlumeData[\"config\"][\"github\"] =>\n github\n ? {\n api: githubApiUrl(github),\n host: github.host,\n owner: github.owner,\n repo: github.repo,\n }\n : null;\n\n/** The assistant's snapshot: what the panel needs, never a secret. */\nconst resolveAssistant = (\n config: ResolvedConfig\n): BlumeDataConfig[\"assistant\"] => {\n const { assistant } = config.ai;\n if (!assistant?.enabled) {\n return null;\n }\n return {\n captcha: assistant.captcha ? captchaSettings(assistant.captcha) : null,\n endpoint: assistant.endpoint ?? null,\n suggestions: assistant.suggestions,\n support: assistant.support ?? null,\n };\n};\n\n/** Serialize the content graph into the data module the runtime consumes. */\nexport const buildRuntimeData = (project: BlumeProject): string => {\n const { config, context, graph, manifest } = project;\n const { github } = config;\n const repoUrl = github ? githubRepoUrl(github) : null;\n const editBase = github ? githubEditBaseUrl(github) : null;\n const logo = resolveLogo(project);\n const ogLogo = resolveOgMark(project, logo?.svg);\n // Files git ignores (a generated reference in a gitignored folder) are\n // never in the repository, so an edit link would 404. One git call covers\n // every page an edit link is built for.\n const ignored = editBase\n ? gitIgnoredPaths(\n context.root,\n manifest.routes.flatMap((route) =>\n route.editUrl === undefined && route.sourcePath\n ? [route.sourcePath]\n : []\n )\n )\n : new Set<string>();\n\n const editUrlFor = (sourcePath?: string): string | null => {\n if (!(editBase && sourcePath) || ignored.has(sourcePath)) {\n return null;\n }\n const rel = relative(context.root, sourcePath).split(\"\\\\\").join(\"/\");\n // The edit path is repo-relative: `github.dir` places the project inside\n // the repo, so a source above the project dir (a monorepo vault beside the\n // docs app) still resolves to an in-repo file. A path that escapes the\n // repo itself has nothing to edit — fabricating one yields a 404 link.\n // `dir` is a bare string in the schema, so a leading slash (`/apps/docs`)\n // is trimmed rather than read as an absolute path — which would drop the\n // link from every page of a site that has always written it that way.\n const editDir = trimChar(github?.dir ?? \"\", \"/\");\n const editPath = normalize(editDir ? join(editDir, rel) : rel);\n if (editPath.startsWith(\"..\") || isAbsolute(editPath)) {\n return null;\n }\n return `${editBase}/${editPath}`;\n };\n\n const { i18n } = config;\n\n // Resolve the footer's repo link per locale. API references no longer add a tab\n // automatically — authors point a `navigation.tabs` entry at the reference\n // route to surface it (see `referenceRoutes`).\n const markUrl = footerRepoUrl(config.navigation.repo, repoUrl);\n const withRepoUrl = (nav: Navigation): Navigation => ({\n ...nav,\n repoUrl: markUrl,\n });\n\n // Resolved UI dictionaries: one per locale under i18n, English baseline\n // otherwise. Threaded into chrome so the catch-all can pick the active locale.\n // The `changelog` config's title and description replace the dictionaries'.\n const uiByLocale = i18n\n ? Object.fromEntries(\n i18n.locales.map(({ code }) => [\n code,\n withChangelogIndexText(\n config,\n resolveUIStrings(code, {\n defaultLocale: i18n.defaultLocale,\n overrides: i18n.ui,\n }),\n code\n ),\n ])\n )\n : {};\n const defaultUi = withChangelogIndexText(\n config,\n i18n\n ? resolveUIStrings(i18n.defaultLocale, {\n defaultLocale: i18n.defaultLocale,\n overrides: i18n.ui,\n })\n : EN_UI,\n i18n?.defaultLocale\n );\n\n const navigationByLocale = i18n\n ? Object.fromEntries(\n i18n.locales.map(({ code }) => [\n code,\n withRepoUrl(\n graph.navigationByLocale[code] ?? {\n actions: [],\n cta: null,\n featured: [],\n selectors: [],\n sidebar: [],\n tabs: [],\n }\n ),\n ])\n )\n : {};\n\n const data: BlumeData = {\n config: {\n analytics: config.analytics,\n api: resolveApiPages(config),\n appleIcon: resolveAppleIcon(project),\n assistant: resolveAssistant(config),\n banner: resolveBanner(config),\n basePath: config.basePath,\n codeThemes: config.markdown.code.theme,\n codeWrap: config.markdown.code.wrap,\n consent: config.consent,\n dateFormat: config.dateFormat,\n description: config.description,\n discovery: {\n agentReadability: config.agents.agentReadability,\n aiCatalog: hasAiCatalog(config),\n api: config.agents.api,\n llmsTxt: config.agents.llmsTxt.enabled,\n // Mirrors `buildSitemapFiles`: no site, no sitemap.\n sitemap: config.seo.sitemap && Boolean(config.deployment.options.site),\n },\n favicon: resolveFavicon(project),\n feedback: config.feedback.enabled,\n feedbackComments: config.feedback.comments,\n footer: resolveFooter(config),\n github: resolveGithubData(github),\n i18n: i18n\n ? {\n defaultLocale: i18n.defaultLocale,\n // The locale fallback content is rendered from, so the catch-all can\n // set the content direction to the language it's actually written in.\n fallbackLocale: resolveFallbackLocale(i18n),\n hideDefaultLocalePrefix: i18n.hideDefaultLocalePrefix,\n locales: i18n.locales.map(({ code, dir, label }) => ({\n code,\n dir,\n label,\n })),\n routeByBrowserLanguage: i18n.routeByBrowserLanguage,\n }\n : null,\n // `undefined` members drop out of the JSON snapshot; the null keeps the\n // \"nothing configured\" case explicit for the layouts.\n identity:\n config.seo.organization || config.seo.software\n ? {\n organization: config.seo.organization,\n software: config.seo.software,\n }\n : null,\n imageZoom: config.markdown.imageZoom,\n logo,\n mcp: config.agents.mcp.enabled\n ? {\n name: config.agents.mcp.name ?? config.title,\n route: config.agents.mcp.route,\n }\n : null,\n metatags: config.seo.metatags ?? null,\n narration: config.narration.enabled\n ? { generated: config.narration.provider !== null }\n : null,\n // `og.enabled` is resolved to a definite boolean in `loadConfig`; coerce\n // the optional schema type so the serialized shape stays `boolean`.\n // Card fonts are baked into the generated OG endpoint (they can carry\n // absolute build-machine paths), not serialized here — this snapshot\n // ends up in every page's client data.\n og: {\n description: resolveOgDescription(config),\n enabled: config.seo.og.enabled ?? false,\n logo: ogLogo,\n palette: config.seo.og.palette,\n site: resolveOgSite(config),\n },\n openInChat: config.ai.openInChat,\n repoUrl,\n search: {\n analytics: config.search.analytics,\n enabled: config.search.provider.mode !== \"none\",\n popular: resolveSearchPopular(config.search.popular, config.basePath),\n provider: config.search.provider.kind,\n },\n site: config.deployment.options.site ?? null,\n structuredData: config.seo.structuredData,\n theme: config.theme,\n title: config.title,\n toc: config.toc,\n versions: config.versions ?? null,\n webmcp: {\n enabled: config.agents.webmcp,\n llms: config.agents.llmsTxt.enabled,\n },\n x: config.seo.x,\n },\n feeds: buildRssFeeds(project).map((feed) => ({\n href: feed.path,\n title: feed.title,\n })),\n // CSS variables for Astro's <Font> component; matches the astro.config\n // `fonts:` entries derived from the same theme.fonts config (and the\n // same locale-derived subsets, so preloads cover the scripts pages use).\n fontCssVars: configuredFonts(\n config.theme.fonts,\n fontLocaleCodes(config.i18n)\n ),\n navigation: withRepoUrl(graph.navigation),\n // Per-locale navigation; the catch-all selects the active locale's tree.\n navigationByLocale,\n // Per-archived-version navigation; the catch-all selects by the route's\n // version, then locale.\n navigationByVersion: Object.fromEntries(\n Object.entries(graph.navigationByVersion).map(([id, byLocale]) => [\n id,\n Object.fromEntries(\n Object.entries(byLocale).map(([code, nav]) => [\n code,\n withRepoUrl(nav),\n ])\n ),\n ])\n ),\n routes: manifest.routes.map((route) => ({\n alternates: route.alternates,\n collection: route.collection,\n description: route.description ?? null,\n draft: route.draft,\n editUrl: route.editUrl ?? editUrlFor(route.sourcePath),\n entryId: route.entryId,\n fallback: route.fallback ?? false,\n hidden: route.hidden,\n id: route.id,\n indexable: route.indexable,\n lastModified: route.lastModified ?? null,\n locale: route.locale,\n monolingual: route.monolingual ?? false,\n path: route.path,\n title: route.title,\n version: route.version,\n versionAlternates: route.versionAlternates,\n })),\n // Default-locale chrome strings (English baseline when not under i18n).\n ui: defaultUi,\n // Per-locale chrome strings, selected by the catch-all under i18n.\n uiByLocale,\n };\n return `${JSON.stringify(data, null, 2)}\\n`;\n};\n\n/** The resolved plan for the hosted MCP server within a single generate pass. */\ninterface McpPlan {\n /** Directory holding the injected discovery endpoints (`.blume/src/blume-mcp`). */\n dir: string;\n /** `.well-known` discovery routes to inject as prerendered pages. */\n discoveryPages: { entrypoint: string; pattern: string }[];\n enabled: boolean;\n route: string;\n srcDir: string;\n warnings: string[];\n}\n\n/**\n * Decide whether (and how) to generate the MCP server. Skipped — with a\n * warning — when a content page or a custom `.astro` page already occupies its\n * route, so the user's page keeps working instead of colliding.\n */\nconst planMcp = (\n project: BlumeProject,\n srcDir: string,\n userPages: { pattern: string }[]\n): McpPlan => {\n const { config } = project;\n const { route } = config.agents.mcp;\n const dir = join(srcDir, \"blume-mcp\");\n const base: McpPlan = {\n dir,\n discoveryPages: [],\n enabled: false,\n route,\n srcDir,\n warnings: [],\n };\n if (!config.agents.mcp.enabled) {\n return base;\n }\n if (routeIsTaken(userPages, project.graph.pages, route)) {\n return {\n ...base,\n warnings: [\n `MCP server route \"${route}\" is already used by a content or custom page; the MCP server was not generated. Set a different \"agents.mcp.route\" in blume.config.ts.`,\n ],\n };\n }\n return {\n ...base,\n discoveryPages: [\n {\n entrypoint: join(dir, \"discovery.ts\"),\n pattern: \"/.well-known/mcp.json\",\n },\n {\n entrypoint: join(dir, \"server-card.ts\"),\n pattern: \"/.well-known/mcp/server-card.json\",\n },\n ],\n enabled: true,\n };\n};\n\n/** A pass's runtime data modules, published together once every writer ran. */\ntype RuntimeModules = Map<RuntimeModuleId, string>;\n\n/**\n * The agent data snapshot (`blume:mcp-data`) behind the MCP server and the\n * JSON docs API: built once per pass when either is on, published to the\n * runtime modules, and handed to both writers. Null when neither needs it.\n */\nconst publishAgentData = async (\n project: BlumeProject,\n plans: { api: ApiPlan; mcp: McpPlan },\n modules: RuntimeModules\n): Promise<McpData | null> => {\n if (!(plans.mcp.enabled || plans.api.enabled)) {\n return null;\n }\n const data = await buildMcpData(project);\n modules.set(\"blume:mcp-data\", JSON.stringify(data));\n return data;\n};\n\n/** Write the MCP server endpoint and discovery documents. */\nconst writeMcpFiles = async (\n plan: McpPlan,\n write: (path: string, content: string) => Promise<boolean>,\n data: McpData | null\n): Promise<void> => {\n if (!(plan.enabled && data)) {\n return;\n }\n const discoveryInput = {\n base: data.base,\n name: data.name,\n route: plan.route,\n site: data.site,\n version: data.version,\n };\n await Promise.all([\n write(\n join(plan.srcDir, \"pages\", mcpPageFile(plan.route)),\n mcpEndpointTemplate()\n ),\n write(\n join(plan.dir, \"discovery.ts\"),\n staticJsonEndpointTemplate(buildMcpDiscovery(discoveryInput))\n ),\n write(\n join(plan.dir, \"server-card.ts\"),\n staticJsonEndpointTemplate(buildMcpServerCard(discoveryInput))\n ),\n ]);\n};\n\n/** The resolved plan for the JSON docs API within a single generate pass. */\ninterface ApiPlan {\n /**\n * Whether the `/api/` catch-all (JSON 404s) is written: server output, no\n * user page owning a rest route under `/api/`, and no content page served\n * from the `/api` namespace (the catch-all would outrank those pages).\n */\n catchAll: boolean;\n enabled: boolean;\n /** Whether the live endpoints (search) are written — server output only. */\n server: boolean;\n /**\n * Whether `/openapi.json` is generated: skipped when a `public/openapi.json`\n * or a user page owns the route, so a site can publish its own description.\n */\n spec: boolean;\n srcDir: string;\n}\n\n/** Whether a user page pattern is a rest route under `/api/` (`/api/[...x]`). */\nconst ownsApiRest = (page: { pattern: string }): boolean =>\n page.pattern.startsWith(\"/api/[\");\n\n/**\n * Whether a content route lives in the `/api` namespace — a docs section\n * about an API commonly does (`content/api/overview.md` → `/api/overview`).\n * Astro ranks `/api/[...path]` above the content catch-all (`/[...slug]`),\n * so the JSON 404 route would shadow those pages wherever routing decides\n * (the dev server, adapters that don't serve prerendered files first).\n */\nconst contentUnderApi = (page: { route: string }): boolean =>\n page.route === \"/api\" || page.route.startsWith(\"/api/\");\n\n/**\n * Decide what the JSON docs API generates. The prerendered endpoints always\n * ride along when the feature is on (they live under Blume's own `/api/docs/`\n * namespace); the live ones need server output; the OpenAPI description yields\n * to one the project ships itself.\n */\nconst planApi = (\n project: BlumeProject,\n srcDir: string,\n userPages: { pattern: string }[]\n): ApiPlan => {\n const { config, context } = project;\n const server = config.deployment.options.output === \"server\";\n return {\n catchAll:\n server &&\n !userPages.some(ownsApiRest) &&\n !project.graph.pages.some(contentUnderApi),\n enabled: config.agents.api,\n server,\n spec:\n !routeIsTaken(userPages, project.graph.pages, OPENAPI_PATH) &&\n !existsSync(join(context.root, \"public\", \"openapi.json\")),\n srcDir,\n };\n};\n\n/**\n * Write the JSON docs API: the prerendered page index, per-page documents, and\n * navigation; on server output the search endpoint and the `/api/` catch-all;\n * and the OpenAPI description of the whole agent-facing surface. The MCP\n * route reaches the description only when the server was actually planned (a\n * collision can disable it), so it never advertises an endpoint that isn't\n * there.\n */\nconst writeApiFiles = async (\n project: BlumeProject,\n plan: ApiPlan,\n write: (path: string, content: string) => Promise<boolean>,\n data: McpData | null,\n mcp: McpPlan\n): Promise<void> => {\n if (!(plan.enabled && data)) {\n return;\n }\n const { config } = project;\n const mcpRoute = mcp.enabled ? mcp.route : null;\n const apiDir = join(plan.srcDir, \"pages\", \"api\");\n const writes = [\n write(join(apiDir, \"docs\", \"pages.json.ts\"), apiPagesIndexTemplate()),\n write(\n join(apiDir, \"docs\", \"pages\", \"[...route].json.ts\"),\n apiPageTemplate()\n ),\n write(join(apiDir, \"docs\", \"navigation.json.ts\"), apiNavigationTemplate()),\n ];\n if (plan.server) {\n writes.push(write(join(apiDir, \"docs\", \"search.ts\"), apiSearchTemplate()));\n }\n if (plan.catchAll) {\n writes.push(\n write(\n join(apiDir, \"[...path].ts\"),\n apiNotFoundTemplate({ base: data.base, site: data.site })\n )\n );\n }\n if (plan.spec) {\n writes.push(\n write(\n join(plan.srcDir, \"pages\", \"openapi.json.ts\"),\n staticJsonEndpointTemplate(\n buildApiSpec({\n agentReadability: config.agents.agentReadability,\n base: data.base,\n description: config.description,\n llmsTxt: config.agents.llmsTxt.enabled,\n mcpRoute,\n name: config.title,\n search: plan.server,\n site: data.site,\n version: data.version,\n })\n )\n )\n );\n }\n await Promise.all(writes);\n};\n\n/** The proxy endpoint's file under the Astro `src/` dir (eject writes it too). */\nexport const PLAYGROUND_PROXY_ENTRY = join(\"blume-openapi\", \"api-proxy.ts\");\n\n/**\n * Decide whether to generate the playground's built-in CORS proxy endpoint.\n * Only the Blume renderer's playground with `proxy: true` needs it — a proxy\n * URL string points at an external service, and `false` sends requests\n * directly. Injected at `/_api-proxy` (rather than written under `pages/`)\n * because Astro treats `_`-prefixed page files as private; the endpoint's own\n * `prerender = false` export wins over the injection default. Mounted under\n * the site `basePath`, at the URL the playground sends to (see\n * openapi/source.ts); Astro layers `deployment.base` onto both.\n */\nconst planPlaygroundProxy = (config: ResolvedConfig, srcDir: string) => ({\n enabled: needsPlaygroundProxy(config),\n entrypoint: join(srcDir, PLAYGROUND_PROXY_ENTRY),\n pattern: playgroundProxyPattern(config),\n});\n\n/**\n * The origins the built-in proxy is allowed to reach: one per absolute\n * `servers[].url` across the parsed specs — the document's, each path item's,\n * and each operation's, since an operation's playground sends to the most\n * specific of those. This is the endpoint's whole trust boundary — the client\n * sends the target as a query parameter, and a reader's custom base URL is not\n * a documented server — so it is derived here, at build time, from the same\n * documents the operation pages render.\n *\n * A templated URL (`https://{env}.api.example.com`) is allowed as the\n * playground sends it, with each variable at its declared default. Relative\n * (`/v1`) URLs, and templates with a variable left undefaulted, carry no\n * origin to allow and are skipped; AsyncAPI documents declare `servers` as a\n * map and contribute nothing (the proxy is OpenAPI-only).\n */\nconst specOriginsOf = (spec: ApiSpecData): string[] => {\n const origins = new Set<string>();\n // A GraphQL schema names no servers; its configured live endpoint is the\n // one origin the playground targets.\n if (spec.endpoint !== undefined) {\n try {\n origins.add(new URL(spec.endpoint).origin);\n } catch {\n // Not an absolute URL: nothing to allow.\n }\n }\n // SAFETY: `document` is arbitrary parsed JSON; the assertion only names\n // the optional `servers` and `paths` shapes, and every access below\n // re-checks them — `Array.isArray` guards each list, optional chaining each\n // path item and operation, and `server.url ?? \"\"` the url.\n const document = spec.document as {\n paths?: Record<string, DocumentPathItem | null | undefined>;\n servers?: DocumentServer[];\n };\n const lists = [document.servers];\n for (const item of Object.values(document.paths ?? {})) {\n lists.push(item?.servers);\n for (const method of HTTP_METHODS) {\n lists.push(item?.[method]?.servers);\n }\n }\n for (const servers of lists) {\n for (const server of Array.isArray(servers) ? servers : []) {\n const url = withServerDefaults(server.url ?? \"\", server.variables);\n // `new URL(\"https://{region}.api.example.com\")` parses — the braces land\n // in the hostname — so a variable with no default needs an explicit\n // check or its junk literal becomes an allowlist entry no real request\n // can match.\n if (url.includes(\"{\")) {\n continue;\n }\n try {\n origins.add(new URL(url).origin);\n } catch {\n // Not an absolute URL: nothing to allow.\n }\n }\n }\n return [...origins];\n};\n\n/** A `servers[]` entry as a parsed spec document declares it. */\ninterface DocumentServer {\n url?: string;\n variables?: AsyncApiSpecValue;\n}\n\n/** An OpenAPI path item: its own `servers` plus one per operation. */\ntype DocumentPathItem = { servers?: DocumentServer[] } & Partial<\n Record<HttpMethod, { servers?: DocumentServer[] } | null>\n>;\n\n/** The built-in proxy's allowlist: every spec's origins, deduped and sorted. */\nexport const specOrigins = (data: OpenApiData): string[] =>\n [...new Set(Object.values(data).flatMap(specOriginsOf))].toSorted();\n\n/** The origin of an absolute URL, or `null` for a path or anything unparsable. */\nconst originOf = (url: string): string | null => {\n try {\n return new URL(url).origin;\n } catch {\n return null;\n }\n};\n\n/**\n * The origins hand-written endpoint pages send to through the built-in\n * proxy: the site's `api.server`, and every page whose `api` names a full\n * URL. Empty unless those pages use the built-in proxy.\n */\nexport const apiPageOrigins = (project: BlumeProject): string[] => {\n const { config } = project;\n if (!apiPagesUseBuiltinProxy(config)) {\n return [];\n }\n const targets = project.graph.pages.map(\n (page) => parseApiEndpoint(page.meta.api ?? \"\")?.target ?? \"\"\n );\n return [config.api.server ?? \"\", ...targets].flatMap((target) => {\n const origin = originOf(target);\n return origin ? [origin] : [];\n });\n};\n\n/**\n * A warning when the hand-written endpoint pages send through the built-in\n * proxy but name no absolute origin for it to allow, so it would refuse every\n * request they send.\n */\nexport const apiPageProxyWarnings = (project: BlumeProject): string[] =>\n apiPagesUseBuiltinProxy(project.config) &&\n apiPageOrigins(project).length === 0\n ? [\n \"api.playground.proxy is true, but api.server isn't an absolute URL and no page's api frontmatter names one, so the built-in proxy has no origin to allow and will refuse every request the endpoint pages send. Set api.server to the API's URL, like https://api.acme.com/v1.\",\n ]\n : [];\n\n/**\n * Build-time diagnostics for playground sends the built-in proxy would refuse.\n * The baked-in allowlist pools every documented origin, but each spec's\n * playground only ever targets that spec's own servers/endpoint — so a\n * non-empty pool can still leave one spec's Send 403ing on every request.\n * Hence the check is per spec: any spec routed through the built-in proxy\n * whose own origins came out empty (no absolute `servers[].url`, no absolute\n * GraphQL `endpoint`) gets a warning naming it.\n */\nexport const proxyAllowlistWarnings = (\n config: ResolvedConfig,\n data: OpenApiData\n): string[] => {\n const proxied = new Set(\n builtinProxyReferences(config).map((reference) => reference.slug)\n );\n const warnings: string[] = [];\n for (const spec of Object.values(data)) {\n if (!proxied.has(spec.slug) || specOriginsOf(spec).length > 0) {\n continue;\n }\n warnings.push(\n spec.kind === \"graphql\"\n ? `The \"${spec.label}\" GraphQL reference (${spec.route}) has playground.proxy: true, but no absolute endpoint is configured for it, so the built-in proxy has no origin to allow and will refuse every request its playground sends. Set \\`endpoint\\` on the graphql() adapter (or the source) to the live GraphQL URL, or point playground.proxy at an external proxy URL.`\n : `The \"${spec.label}\" reference (${spec.route}) has playground.proxy: true, but its spec declares no absolute servers[].url (relative URLs, and templated ones with a variable missing its default, carry no origin), so the built-in proxy has no origin to allow and will refuse every request its playground sends. Add an absolute server URL to the spec, or point playground.proxy at an external proxy URL.`\n );\n }\n return warnings;\n};\n\n/**\n * Write the assistant endpoint and, unless the backend runs its own retrieval\n * (Inkeep), the grounding snapshot the endpoint queries at request time. A no-op\n * when the assistant is disabled.\n */\nconst writeAskFiles = async (\n project: BlumeProject,\n srcDir: string,\n write: (path: string, content: string) => Promise<boolean>,\n modules: RuntimeModules\n): Promise<void> => {\n const { assistant } = project.config.ai;\n if (!(assistant?.enabled && !assistant.endpoint)) {\n return;\n }\n const backend = resolveAskBackend(assistant.provider);\n if (backend.grounded) {\n modules.set(\"blume:ask-data\", JSON.stringify(await buildAskData(project)));\n }\n await write(\n join(srcDir, \"pages\", \"api\", \"ask.ts\"),\n askEndpointTemplate(backend, {\n captcha: assistant.captcha,\n cors: assistant.cors,\n instructions: assistant.instructions,\n rateLimit: project.config.rateLimit,\n retrieval: assistant.retrieval,\n tools: assistant.tools ?? backend.toolsByDefault,\n })\n );\n};\n\n/**\n * Write the default 404 page at Astro's reserved `src/pages/404.astro` path so\n * static builds emit `dist/404.html`, plus its Markdown twin at `404.md.ts`\n * (`dist/404.md`) for agents that ask a missing URL for Markdown and its JSON\n * twin at `404.json.ts` (`dist/404.json`, RFC 9457 problem details) for those\n * that ask for JSON. All three are skipped when the project already owns\n * `/404` (a custom `pages/404.astro` or a `404.md` content page), letting it\n * be fully overridden without a route collision; `pruneOrphans` then removes\n * any previously-generated copies.\n */\nconst writeNotFoundPage = async (\n write: (path: string, content: string) => Promise<boolean>,\n srcDir: string,\n pages: { pattern: string }[],\n contentPages: { route: string }[]\n): Promise<void> => {\n if (routeIsTaken(pages, contentPages, \"/404\")) {\n return;\n }\n await Promise.all([\n write(join(srcDir, \"pages\", \"404.astro\"), notFoundPageTemplate()),\n write(join(srcDir, \"pages\", \"404.md.ts\"), notFoundMarkdownTemplate()),\n write(join(srcDir, \"pages\", \"404.json.ts\"), notFoundJsonTemplate()),\n ]);\n};\n\n/**\n * Flatten a diagnostic to a single warning line, appending the suggestion when\n * one exists. Exported for testing.\n */\nexport const diagnosticWarning = (diagnostic: Diagnostic): string =>\n diagnostic.suggestion\n ? `${diagnostic.message} ${diagnostic.suggestion}`\n : diagnostic.message;\n\n/**\n * Missing-dependency preflight: the search provider's SDK, content source\n * SDKs, the assistant backend's and narration provider's SDKs, the deployment\n * adapter's package, and — since React ships with Blume while Vue/Svelte\n * don't — any island framework's Astro integration. A build fails here,\n * before anything is written, with the install command for the project's\n * package manager — otherwise Vite dies later on an opaque unresolved import\n * from the hidden runtime. Dev warns and keeps serving: only the pages and\n * routes that import the package break, and installing it is picked up on\n * the next restart. Dev leaves narration's SDK out, since only a build\n * generates the clips.\n */\nconst dependencyPreflight = async (\n project: BlumeProject,\n frameworks: Set<string>\n): Promise<string[]> => {\n const build = project.mode === \"build\";\n const { config } = project;\n const diagnostic = await missingDependencyDiagnostic(\n build\n ? config\n : { ...config, narration: { ...config.narration, provider: null } },\n project.context.root,\n build ? \"error\" : \"warning\",\n frameworks\n );\n if (!diagnostic) {\n return [];\n }\n if (build) {\n throw new BlumeError(diagnostic);\n }\n return [diagnosticWarning(diagnostic)];\n};\n\nexport interface GenerateResult {\n /** Whether any structural file changed (config/page/content config). */\n structuralChange: boolean;\n /** Non-fatal warnings raised while generating (e.g. a missing API spec). */\n warnings: string[];\n}\n\n/**\n * Statically analyze the user's `components.ts` (never executing it). Empty for\n * a project with no components file; throws `BLUME_COMPONENTS_INVALID` for an\n * override that isn't one of the accepted static forms.\n */\nexport const analyzeComponentsFile = async (\n componentsFile: string | null\n): Promise<ComponentOverrideAnalysis> =>\n componentsFile\n ? analyzeComponentOverrides(\n await readFile(componentsFile, \"utf-8\"),\n componentsFile\n )\n : emptyComponentOverrides();\n\n/** The OG endpoint fonts for a scanned project (see {@link resolveOgFonts}). */\nconst projectOgFonts = (project: BlumeProject): DerivedOgFonts =>\n resolveOgFonts(\n {\n locales: fontLocaleCodes(project.config.i18n),\n ogFonts: project.config.seo.og.fonts,\n themeFonts: project.config.theme.fonts,\n themeFontsConfigured: project.themeFontsConfigured,\n },\n project.context.root\n );\n\n/**\n * Fail generation when a configured local font file is missing. Warning and\n * continuing is not an option here — the path is emitted into the Astro\n * config and the OG endpoint, which would crash later with a bare ENOENT.\n */\nconst assertFontFilesExist = (project: BlumeProject): void => {\n const { config, context } = project;\n const missing = missingFontFiles(\n { ogFonts: config.seo.og.fonts ?? [], themeFonts: config.theme.fonts },\n context.root\n );\n if (missing.length > 0) {\n throw new BlumeError({\n code: \"BLUME_FONT_FILE_MISSING\",\n message: `Configured font file(s) not found: ${missing.join(\", \")}. Font paths resolve relative to the project root.`,\n severity: \"error\",\n });\n }\n};\n\n/**\n * The client libraries a site needs (see `featuresTemplate`): the EPUB\n * generator when `export.epub` is on, and the Mermaid element when any page's\n * source has a mermaid fence — read from the raw-Markdown mirrors (every\n * route's verbatim source) and, for sources that carry their text on the\n * page record, the record itself.\n */\nexport const clientFeaturesFrom = (\n project: BlumeProject,\n rawMarkdown: Record<string, RawMarkdownEntry>\n): ClientFeatures => ({\n epub: project.config.export.epub,\n mermaid:\n Object.values(rawMarkdown).some((entry) =>\n hasMermaidFence(entry.mdx ?? entry.md ?? \"\")\n ) ||\n project.graph.pages.some(\n (page) => page.body !== undefined && hasMermaidFence(page.body.text)\n ),\n});\n\n/**\n * The theme's code-block icon rules for the languages the site's Markdown\n * uses (see `languageIconCss`), read from the raw-Markdown mirrors and the\n * page records that carry their text.\n */\nexport const languageIconCssFrom = (\n project: BlumeProject,\n rawMarkdown: Record<string, RawMarkdownEntry>\n): string =>\n languageIconCss(\n languageIconSlugsIn(\n [\n ...Object.values(rawMarkdown).map(\n (entry) => entry.mdx ?? entry.md ?? \"\"\n ),\n ...project.graph.pages.map((page) => page.body?.text ?? \"\"),\n ].join(\"\\n\")\n )\n );\n\n/** {@link languageIconCssFrom} over a fresh read of the raw Markdown (eject). */\nexport const languageIconCssFor = async (\n project: BlumeProject\n): Promise<string> =>\n languageIconCssFrom(project, await buildRawMarkdown(project));\n\n/**\n * The deferred sidebar fragments page, only when some group is a disclosure\n * or a drill-in panel — a flat sidebar renders every row on every page, so\n * there is nothing to fetch. A previous pass's page is an orphan the\n * generator removes when the sidebar goes flat again.\n */\nconst writeNavFragments = (\n write: (path: string, content: string) => Promise<boolean>,\n srcDir: string,\n navFragments: boolean\n): Promise<boolean> =>\n navFragments\n ? write(\n join(\n srcDir,\n \"pages\",\n \"blume-nav\",\n \"[version]\",\n \"[locale]\",\n \"[id].astro\"\n ),\n navFragmentTemplate()\n )\n : Promise.resolve(false);\n\n/** {@link clientFeaturesFrom} over a fresh read of the raw Markdown (eject). */\nexport const clientFeaturesFor = async (\n project: BlumeProject\n): Promise<ClientFeatures> =>\n clientFeaturesFrom(project, await buildRawMarkdown(project));\n\n/**\n * Write (or update) the generated `.blume/` Astro runtime for a project.\n * Only files whose content changed are rewritten so Vite HMR stays fast.\n */\nexport const generateRuntime = async (\n project: BlumeProject\n): Promise<GenerateResult> => {\n const { context, config } = project;\n assertFontFilesExist(project);\n const out = context.outDir;\n const srcDir = join(out, \"src\");\n const generatedDir = join(srcDir, \"generated\");\n const askPath = join(srcDir, \"generated\", \"Ask.astro\");\n const themePath = join(srcDir, \"generated\", \"app.css\");\n const searchClientPath = join(srcDir, \"generated\", \"search-client.ts\");\n const consentClientPath = join(srcDir, \"generated\", \"consent-client.ts\");\n const featuresPath = join(srcDir, \"generated\", \"features.ts\");\n const examplesPath = join(srcDir, \"generated\", \"examples.ts\");\n const examplesThemePath = join(srcDir, \"generated\", \"examples.css\");\n\n // Record every file this pass writes so orphans (from a now-disabled feature)\n // can be pruned afterwards. `write` wraps the atomic writer and tracks paths.\n const written = new Set<string>();\n const write = (path: string, content: string): Promise<boolean> => {\n written.add(normalize(path));\n return writeIfChanged(path, content);\n };\n // The data snapshots the generated pages import (`blume:data`, the search\n // index, …) are collected here and published in memory at the end of the\n // pass — see `runtime-modules.ts`. An id a feature leaves unset is\n // unpublished, the in-memory counterpart of `pruneOrphans`.\n const modules: RuntimeModules = new Map();\n\n const depsLinkWarning = await ensureDepsLink(out);\n\n // The dev negotiation inputs. Published in memory (below) rather than baked\n // into the generated config, so a content-route change never rewrites\n // `astro.config.mjs` — which would restart the dev server in place.\n const contentRoutes = markdownRoutePaths(project);\n const homeLinkHeader =\n buildHomeLinkHeader(config, contentRoutes, \"dev\") ?? undefined;\n\n const assistantEnabled = config.ai.assistant?.enabled ?? false;\n const exportPdf = config.export.pdf;\n const exportEpub = config.export.epub;\n // Every route's source Markdown: published as `blume:raw-markdown` below,\n // and inspected here for the client features the site needs.\n const rawMarkdown = await buildRawMarkdown(project);\n const clientFeatures = clientFeaturesFrom(project, rawMarkdown);\n const navFragments = navVariants(project.graph).some(({ navigation }) =>\n hasDeferrableGroups(navigation.sidebar)\n );\n const languageIcons = languageIconCssFrom(project, rawMarkdown);\n // Staged (non-filesystem) sources materialize into `.blume/content`; keyed by\n // entryId so i18n duplicates of one entry write a single file. Collected here\n // so math detection also sees staged bodies (they never live under root).\n const staged = collectStaged(project);\n // Statically analyze `components.ts` overrides (never executed): drives\n // hydration on layout/mdx overrides, string-path resolution, and the\n // \"framework component with no client mode\" diagnostic. Independent of the\n // discovery reads, so it joins the same parallel batch.\n const [\n pages,\n detectedReact,\n usesMath,\n userTheme,\n userExamplesCss,\n integrationBridge,\n islandDiscovery,\n exampleDiscovery,\n overrideAnalysis,\n ] = await Promise.all([\n context.pagesRoot ? discoverPages(context.pagesRoot) : Promise.resolve([]),\n detectNeedsReact(context.root),\n detectUsesMath(context.root, staged.values()),\n readUserCss(context.themeFile, generatedDir),\n readUserCss(examplesCssFile(context.root, config), generatedDir),\n loadIntegrationBridge(config, context),\n discoverIslands(context.root),\n discoverExamples(context.root, config.examples.source),\n analyzeComponentsFile(context.componentsFile),\n ]);\n // The `islands/` convention and `components.ts` share one static plan: every\n // entry is imported by path, hydrated ones through a generated wrapper.\n const slotPlan = planComponentSlots(\n islandDiscovery.islands,\n overrideAnalysis\n );\n const overrideWarnings = overrideAnalysis.warnings;\n // Expose the discovered examples for agent-facing Markdown downleveling\n // (`<Component>` → source) before any consumer (raw `.md`, MCP, llms) runs.\n project.examples = exampleMarkdownLookup(exampleDiscovery.examples);\n\n // Each island/example framework enables its Astro renderer. React also\n // switches on for any project `.tsx`/`.jsx` and for the assistant; Vue/Svelte are\n // island/example-driven. `.astro` examples need no renderer. Component\n // overrides referencing a framework component enable its renderer too.\n const frameworks = new Set<string>([\n ...islandDiscovery.islands.map((island) => island.framework),\n ...exampleDiscovery.examples.map((example) => example.framework),\n ...slotPlan.frameworks,\n ]);\n const dependencyWarnings = await dependencyPreflight(project, frameworks);\n const needsReact =\n detectedReact || assistantEnabled || frameworks.has(\"react\");\n const needsVue = frameworks.has(\"vue\");\n const needsSvelte = frameworks.has(\"svelte\");\n\n // Whether react() turns the React Compiler on (false when off). Checked here,\n // Node-side, so an unresolvable compiler degrades to an uncompiled build\n // instead of failing it — see resolveReactCompiler. Any\n // unresolved-but-requested warning is folded into `warnings` below (declared\n // later).\n const reactCompiler = resolveReactCompiler(config, needsReact);\n\n // Custom pages that should get a generated OG card (the home most of all).\n // Computed before the MCP `.well-known` routes are appended below — those are\n // private and filtered out anyway, but the intent is the user's pages.\n const ogRoutes = customOgRoutes(pages, config.title, config.seo.og.titles);\n\n // Whether the generated `/changelog` index exists — shared by the OG endpoint\n // (which adds the index's own card) and the page write below. Computed here,\n // before the MCP discovery pages are appended, on the user's own pages.\n const changelogIndex = hasGeneratedChangelog(project, pages);\n\n // The hosted MCP server. The `.well-known` discovery docs are injected as\n // prerendered routes alongside user pages; the server endpoint itself is a\n // normal (server-rendered) page written by `writeMcpFiles`.\n const mcp = planMcp(project, srcDir, pages);\n pages.push(...mcp.discoveryPages);\n\n // The JSON docs API shares the MCP server's snapshot; build it once when\n // either is on.\n const api = planApi(project, srcDir, pages);\n const agentData = await publishAgentData(project, { api, mcp }, modules);\n\n // The parsed OpenAPI specs behind the `blume:openapi` alias, also the source\n // of the proxy's origin allowlist below. The source parsed them during the\n // scan, so reading them here is free.\n const openApiSource = project.sources.find(isOpenApiSource);\n const openApiData = openApiSource ? openApiSource.openApiData() : {};\n\n // The playground's built-in CORS proxy rides the same injection path as the\n // MCP discovery docs; the endpoint itself opts out of prerendering.\n const playgroundProxy = planPlaygroundProxy(config, srcDir);\n if (playgroundProxy.enabled) {\n pages.push({\n entrypoint: playgroundProxy.entrypoint,\n pattern: playgroundProxy.pattern,\n });\n }\n // Computed once: the endpoint template bakes it in below. A spec that\n // contributes no origin of its own gets a per-spec diagnostic\n // (`proxyAllowlistWarnings`) — the proxy would refuse its every send.\n const proxyOrigins = [\n ...new Set([...specOrigins(openApiData), ...apiPageOrigins(project)]),\n ].toSorted();\n\n const hasStaged = staged.size > 0;\n // Only emit a project-scanning `docs` collection when a filesystem source\n // actually feeds it. An all-staged project (openapi/notion/…) has only staged\n // sources, so the `docs` glob would otherwise scan (and watch) the whole\n // project root for nothing — see contentConfigTemplate.\n const hasFilesystemSource = project.sources.some((source) => !source.staged);\n const docsCollection = resolveDocsCollection(config, context.root);\n\n // All of these write to distinct generated paths and never read one another's\n // output, so the structural files, the per-convention hydration wrappers, and\n // the Ask/MCP writers all run in one parallel batch. Only the structural\n // writes' change flags feed `structuralChange`, so they stay a nested group.\n const [structural] = await Promise.all([\n Promise.all([\n write(\n join(out, \"astro.config.mjs\"),\n astroConfigTemplate({\n aliases: resolveTsconfigAliases(context.root),\n askPath,\n config,\n consentClientPath,\n contentRoot: docsCollection.base,\n contentRoutes,\n context,\n examplesPath,\n examplesThemePath,\n features: clientFeatures,\n featuresPath,\n integrationBridge,\n needsReact,\n needsSvelte,\n needsVue,\n pages,\n reactCompiler,\n searchClientPath,\n themePath,\n })\n ),\n write(\n join(out, \"package.json\"),\n runtimePackageTemplate(\n runtimeDependencies({ config, needsReact, needsSvelte, needsVue })\n )\n ),\n write(join(out, \"tsconfig.json\"), runtimeTsconfigTemplate()),\n write(\n join(srcDir, \"content.config.ts\"),\n contentConfigTemplate({\n collection: docsCollection,\n config,\n context,\n filesystem: hasFilesystemSource,\n staged: hasStaged,\n unparsable: project.unparsable,\n })\n ),\n write(\n join(srcDir, \"pages\", \"[...slug].astro\"),\n catchAllPageTemplate({\n exportEpub,\n exportPdf,\n mathEnabled: usesMath,\n navFragments,\n needsReact,\n })\n ),\n writeNavFragments(write, srcDir, navFragments),\n // The header's Ask trigger, behind the `blume:ask` alias. Always written\n // (even when Ask is off, as a component that renders nothing) so the alias\n // resolves — the same contract as `blume:search-client`.\n write(askPath, askComponentTemplate(assistantEnabled)),\n write(join(srcDir, \"generated\", \"components.ts\"), slotPlan.module),\n write(\n join(srcDir, \"generated\", \"examples.ts\"),\n exampleMapTemplate(exampleDiscovery.examples, config.basePath)\n ),\n // The isolated Tailwind entry for `<Component />` preview frames: only\n // the project (and an out-of-root examples directory) is scanned, so the\n // docs theme never reaches a preview. Anything further afield — a sibling\n // package the examples import — is the user's `@source` in examples.css.\n write(\n examplesThemePath,\n examplesEntryTemplate({\n configTokens: buildThemeCss(config.theme),\n sources: exampleScanRoots(context.root, exampleDiscovery.dir).map(\n (dir) => `${dir}/${EXAMPLE_SCAN_GLOB}`\n ),\n userCss: userExamplesCss,\n })\n ),\n write(\n themePath,\n tailwindEntryTemplate({\n configTokens: `${buildThemeCss(config.theme)}${buildFontsCss(config.theme.fonts)}`,\n languageIcons,\n sources: [\n `${BLUME_SRC}/**/*.{astro,ts,tsx}`,\n `${context.root}/**/*.{astro,jsx,mdx,ts,tsx}`,\n ],\n twoslashCss: twoslashCss(),\n userTheme,\n })\n ),\n ]),\n // Per-override hydration wrappers for `islands/` convention components and\n // `client:*` layout/mdx overrides. The generated `components.ts` (written\n // above) imports these; orphans from removed overrides are pruned at the\n // end of the pass.\n Promise.all(\n slotPlan.wrappers.map((wrapper) =>\n write(\n join(srcDir, \"generated\", \"component-slots\", `${wrapper.name}.astro`),\n wrapper.content\n )\n )\n ),\n // Per-example live wrappers for the `examples/` convention, resolved by\n // `<Component path>` through the `examples.ts` map (written above, always).\n Promise.all(\n exampleDiscovery.examples.map((example) =>\n write(\n join(\n srcDir,\n \"generated\",\n \"examples\",\n `${exampleSlug(example.path)}.astro`\n ),\n exampleWrapperTemplate(example)\n )\n )\n ),\n writeAskFiles(project, srcDir, write, modules),\n writeMcpFiles(mcp, write, agentData),\n writeApiFiles(project, api, write, agentData, mcp),\n playgroundProxy.enabled\n ? write(\n playgroundProxy.entrypoint,\n playgroundProxyTemplate(proxyOrigins, config.rateLimit)\n )\n : Promise.resolve(false),\n ]);\n\n if (config.seo.og.enabled) {\n await write(\n join(srcDir, \"pages\", \"og\", \"[...slug].png.ts\"),\n ogEndpointTemplate(\n ogRoutes,\n {\n ...projectOgFonts(project),\n cache: {\n dir: ogCacheDir(project.context),\n version: getBlumeVersion(),\n },\n pageDescriptions: config.seo.og.description !== false,\n },\n changelogIndex\n )\n );\n }\n\n // Changelog index (`/changelog`): every release as a row, grouped by year.\n if (changelogIndex) {\n await write(\n join(srcDir, \"pages\", \"changelog.astro\"),\n changelogIndexTemplate({\n exportEpub,\n exportPdf,\n needsReact,\n })\n );\n }\n\n // Three independent writes: the per-example preview routes that\n // `<Component />` iframes embed (returning a warning when the configured\n // examples.css is missing), the default 404 page (`/404`, unless the project\n // already owns the route), and the provider-specific client loader behind\n // the `blume:search-client` alias — always (re)generated so the alias\n // resolves even when search is disabled.\n const [examplesWarnings] = await Promise.all([\n writeExamplesPreview({\n config,\n hasExamples: exampleDiscovery.examples.length > 0,\n root: context.root,\n srcDir,\n write,\n }),\n writeNotFoundPage(write, srcDir, pages, project.graph.pages),\n write(searchClientPath, searchClientTemplate(config)),\n write(consentClientPath, consentClientTemplate(config.consent)),\n write(featuresPath, featuresTemplate(clientFeatures)),\n ]);\n\n // Client-loaded adapters (orama, flexsearch) ship a static index + endpoint.\n const searchAdapter = config.search.provider;\n if (searchAdapter.mode === \"static\") {\n const documents = await buildSearchDocuments(project);\n modules.set(\"blume:search-index\", JSON.stringify(documents));\n await write(\n join(srcDir, \"pages\", \"blume-search.json.ts\"),\n searchEndpointTemplate()\n );\n }\n\n // Mixedbread proxies queries through a server endpoint that holds the key.\n if (searchAdapter.kind === \"mixedbread\") {\n await write(\n join(srcDir, \"pages\", \"api\", \"search.ts\"),\n mixedbreadSearchEndpointTemplate(\n searchAdapter.options,\n sourcePages(project),\n config.rateLimit\n )\n );\n }\n\n // The include graph (partial → including pages) behind `includeHmrPlugin`:\n // editing a partial invalidates every page that splices it. Written even\n // when empty so the plugin's configured path always resolves.\n await write(\n join(srcDir, \"generated\", \"includes.json\"),\n `${JSON.stringify(buildIncludeGraph(project.graph.pages))}\\n`\n );\n\n modules.set(\"blume:raw-markdown\", JSON.stringify(rawMarkdown));\n // The originals behind the rewritten `/blume-assets/content/…` references in\n // the agent-facing Markdown, plus the endpoint that serves them (and the\n // remote-source assets materialized under `.blume/public/blume-assets`).\n const contentAssets = await collectContentAssets(project);\n modules.set(\"blume:content-assets\", JSON.stringify(contentAssets));\n await Promise.all([\n write(\n join(srcDir, \"pages\", \"[...slug].md.ts\"),\n rawMarkdownEndpointTemplate(\"md\")\n ),\n write(\n join(srcDir, \"pages\", \"[...slug].mdx.ts\"),\n rawMarkdownEndpointTemplate(\"mdx\")\n ),\n write(\n join(srcDir, \"pages\", \"blume-assets\", \"[...asset].ts\"),\n contentAssetsEndpointTemplate(\n join(project.context.outDir, \"public\", \"blume-assets\")\n )\n ),\n ]);\n\n // Automatic RSS feeds for blog/changelog content types (a no-op when no such\n // pages exist or no deployment.site is configured).\n const feeds = buildRssFeeds(project);\n if (feeds.length > 0) {\n const feedXml = Object.fromEntries(\n feeds.map((feed) => [feed.type, renderRssFeed(feed)])\n );\n modules.set(\"blume:rss\", JSON.stringify(feedXml));\n await write(\n join(srcDir, \"pages\", \"[section]\", \"rss.xml.ts\"),\n rssEndpointTemplate()\n );\n }\n\n // `scalar()` reference pages. One self-contained page per source, mounted\n // on its configured route and regenerated each run.\n const warnings: string[] = [\n ...(depsLinkWarning ? [depsLinkWarning] : []),\n ...proxyAllowlistWarnings(config, openApiData),\n ...apiPageProxyWarnings(project),\n ...reactCompilerWarnings(config, needsReact, reactCompiler),\n ...mcp.warnings,\n ...islandDiscovery.warnings,\n ...exampleDiscovery.warnings,\n ...examplesWarnings,\n ...overrideWarnings,\n ];\n\n // Missing-navigation-target check, now that every servable route is known\n // (see `navTargetRoutes`).\n // Curated `search.popular` icons live outside the navigation model, so they\n // miss `validateNavIcons` in the graph build — they're checked here too,\n // where the search config is known. A typo otherwise just renders the\n // default glyph.\n warnings.push(\n ...[\n ...validateNavTargets(\n project.graph.navigation,\n navTargetRoutes(project, pages),\n servedFiles(project)\n ),\n ...validateSearchPopularIcons(config.search.popular),\n ].map(diagnosticWarning)\n );\n\n // Unknown-component check: a `<Tag>` in MDX that isn't a built-in, an island,\n // or a `components.ts` override. Needs the project's own components, known here.\n const knownComponentTags = new Set<string>([\n ...islandDiscovery.islands.map((island) => island.name),\n ...overrideAnalysis.mdx.map((entry) => entry.key),\n ]);\n warnings.push(\n ...validateUsedComponents(\n project.graph.pages,\n knownComponentTags,\n new Set(registry.map((item) => item.name))\n ).map(diagnosticWarning),\n ...missingExampleDiagnostics(\n project.graph.pages,\n exampleDiscovery,\n context.root,\n knownComponentTags\n ).map(diagnosticWarning),\n // Printed whole, like a scan diagnostic, so the line it names shows.\n ...unknownPropDiagnostics(project.graph.pages, knownComponentTags).map(\n (diagnostic) =>\n formatDiagnostic(enrichDiagnostic(diagnostic), context.root)\n ),\n ...dependencyWarnings\n );\n if (hasScalarReferences(config)) {\n const references = await buildReferenceFiles({\n config,\n contentRoutes: new Set(project.graph.pages.map((page) => page.route)),\n root: context.root,\n });\n warnings.push(...references.warnings);\n await Promise.all(\n references.files.map((file) =>\n write(join(srcDir, \"pages\", file.pagePath), file.content)\n )\n );\n }\n\n // `blume:openapi` is always published — even as `{}` — so the import resolves\n // whether or not a reference is enabled; the specs were parsed during the\n // scan, so this is just serialization. `blume:data` is the page data every\n // layout reads. Neither is \"structural\" for Astro; publishing hot-reloads.\n modules.set(\"blume:data\", buildRuntimeData(project));\n modules.set(\"blume:openapi\", JSON.stringify(openApiData));\n // These write to distinct trees and never read one another, so they batch.\n // `writeStagedContent` owns the `.blume/content` tree (its own pruning),\n // outside `.blume/src`, so a removed remote entry doesn't linger.\n await Promise.all([\n write(\n join(out, \"blume.manifest.json\"),\n `${JSON.stringify(project.manifest, null, 2)}\\n`\n ),\n writeStagedContent(out, staged),\n ]);\n\n // Remove anything under `.blume/src` this pass didn't write — e.g. an assistant\n // endpoint left behind after the feature was switched off.\n await pruneOrphans(srcDir, written);\n\n // Publish last, once every page that imports a module is on disk: a live\n // dev server invalidates the changed modules and reloads the browser against\n // the finished tree, never a half-written one.\n publishDevNegotiation({ contentRoutes, homeLinkHeader });\n publishRuntimeModules(modules);\n\n return { structuralChange: structural.some(Boolean), warnings };\n};\n",
12
+ "import { createHash } from \"node:crypto\";\nimport { existsSync, readFileSync, realpathSync } from \"node:fs\";\nimport {\n lstat,\n mkdir,\n readFile,\n readlink,\n realpath,\n rm,\n symlink,\n} from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\n\nimport pMap from \"p-map\";\nimport { dirname, isAbsolute, join, normalize, relative, resolve } from \"pathe\";\nimport { glob } from \"tinyglobby\";\n\nimport { hasAiCatalog } from \"../ai/ai-catalog.ts\";\nimport { OPENAPI_PATH } from \"../ai/api/paths.ts\";\nimport { buildApiSpec } from \"../ai/api/spec.ts\";\nimport { buildAskData } from \"../ai/ask-data.ts\";\nimport { resolveAskBackend } from \"../ai/ask.ts\";\nimport { buildHomeLinkHeader } from \"../ai/link-headers.ts\";\nimport { buildRawMarkdown, markdownRoutePaths } from \"../ai/markdown.ts\";\nimport type { RawMarkdownEntry } from \"../ai/markdown.ts\";\nimport { buildMcpData } from \"../ai/mcp/data.ts\";\nimport type { McpData } from \"../ai/mcp/data.ts\";\nimport { buildMcpDiscovery, buildMcpServerCard } from \"../ai/mcp/discovery.ts\";\nimport { captchaSettings } from \"../captcha/schema.ts\";\nimport { parseApiEndpoint } from \"../components/content/api-page.ts\";\nimport {\n hasDeferrableGroups,\n navVariants,\n} from \"../components/layout/nav-utils.ts\";\nimport { normalizeBasePath, withBasePath } from \"../core/base-path.ts\";\nimport { withChangelogIndexText } from \"../core/changelog-index.ts\";\nimport {\n missingExampleDiagnostics,\n unknownPropDiagnostics,\n validateUsedComponents,\n} from \"../core/component-diagnostics.ts\";\nimport {\n analyzeComponentOverrides,\n emptyComponentOverrides,\n} from \"../core/component-overrides.ts\";\nimport type { ComponentOverrideAnalysis } from \"../core/component-overrides.ts\";\nimport {\n collectContentAssets,\n rewriteRelativeAssets,\n} from \"../core/content-assets.ts\";\nimport type {\n BlumeBanner,\n BlumeDataConfig,\n BlumeData,\n BlumeFavicon,\n BlumeLogo,\n} from \"../core/data.ts\";\nimport {\n BlumeError,\n enrichDiagnostic,\n formatDiagnostic,\n} from \"../core/diagnostics.ts\";\nimport { writeTextAtomic } from \"../core/fs-atomic.ts\";\nimport { gitIgnoredPaths } from \"../core/git-ignored.ts\";\nimport {\n apiUrl as githubApiUrl,\n editBaseUrl as githubEditBaseUrl,\n repoUrl as githubRepoUrl,\n} from \"../core/github.ts\";\nimport { EN_UI, resolveUIStrings } from \"../core/i18n-ui.ts\";\nimport { resolveFallbackLocale } from \"../core/i18n.ts\";\nimport { buildIncludeGraph } from \"../core/includes.ts\";\nimport { resolveLocalizable } from \"../core/localizable.ts\";\nimport {\n validateMcpClientIcons,\n validateNavTargets,\n validateSearchPopularIcons,\n} from \"../core/nav-diagnostics.ts\";\nimport { packageRoot } from \"../core/package-root.ts\";\nimport type { BlumeProject } from \"../core/project-graph.ts\";\nimport type { ResolvedConfig } from \"../core/schema.ts\";\nimport { resolveDocsCollection } from \"../core/sources/resolve.ts\";\nimport { svgDimensions } from \"../core/svg-dimensions.ts\";\nimport { trimChar } from \"../core/trim.ts\";\nimport { resolveTsconfigAliases } from \"../core/tsconfig-aliases.ts\";\nimport type { Diagnostic, Navigation } from \"../core/types.ts\";\nimport { getBlumeVersion } from \"../core/version.ts\";\nimport { servedFiles } from \"../deploy/generated-files.ts\";\nimport { buildRssFeeds, renderRssFeed } from \"../deploy/rss.ts\";\nimport {\n languageIconCss,\n languageIconSlugsIn,\n} from \"../markdown/language-icon.ts\";\nimport { hasMermaidFence } from \"../markdown/mermaid.ts\";\nimport { ogCacheDir } from \"../og/cache.ts\";\nimport { missingFontFiles, resolveOgFonts } from \"../og/derive.ts\";\nimport type { DerivedOgFonts } from \"../og/derive.ts\";\nimport { resolveOgLogo } from \"../og/logo.ts\";\nimport type { AsyncApiSpecValue } from \"../openapi/asyncapi.ts\";\nimport type { ApiSpecData, HttpMethod, OpenApiData } from \"../openapi/model.ts\";\nimport { HTTP_METHODS, withServerDefaults } from \"../openapi/model.ts\";\nimport {\n apiPagesUseBuiltinProxy,\n builtinProxyReferences,\n hasScalarReferences,\n needsPlaygroundProxy,\n} from \"../openapi/references.ts\";\nimport { buildReferenceFiles } from \"../openapi/scalar.ts\";\nimport { isOpenApiSource } from \"../openapi/source.ts\";\nimport { registry } from \"../registry/registry.ts\";\nimport { buildSearchDocuments } from \"../search/documents.ts\";\nimport { resolveSearchPopular } from \"../search/popular.ts\";\nimport { sourcePages } from \"../search/source-pages.ts\";\nimport {\n examplesEntryTemplate,\n tailwindEntryTemplate,\n} from \"../theme/entry.ts\";\nimport {\n buildFontsCss,\n configuredFonts,\n fontLocaleCodes,\n} from \"../theme/fonts.ts\";\nimport { buildThemeCss } from \"../theme/palette.ts\";\nimport { rebaseSourceDirectives } from \"../theme/sources.ts\";\nimport { twoslashCss } from \"../theme/twoslash.ts\";\nimport { planComponentSlots } from \"./component-slots.ts\";\nimport {\n EXAMPLE_SCAN_GLOB,\n discoverExamples,\n exampleMarkdownLookup,\n exampleScanRoots,\n} from \"./examples.ts\";\nimport { publishDevNegotiation } from \"./integration.ts\";\nimport { discoverIslands } from \"./islands.ts\";\nimport {\n customOgRoutes,\n discoverPages,\n hasGeneratedChangelog,\n navTargetRoutes,\n routeIsTaken,\n} from \"./pages.ts\";\nimport { candidateHolding } from \"./render-deps.ts\";\nimport { missingDependencyDiagnostic } from \"./runtime-deps.ts\";\nimport { publishRuntimeModules } from \"./runtime-modules.ts\";\nimport type { RuntimeModuleId } from \"./runtime-modules.ts\";\nimport {\n askComponentTemplate,\n askEndpointTemplate,\n astroConfigTemplate,\n catchAllPageTemplate,\n changelogIndexTemplate,\n contentAssetsEndpointTemplate,\n contentConfigTemplate,\n exampleMapTemplate,\n exampleWrapperTemplate,\n examplesPageTemplate,\n exampleSlug,\n apiNavigationTemplate,\n apiNotFoundTemplate,\n apiPageTemplate,\n apiPagesIndexTemplate,\n apiSearchTemplate,\n mcpEndpointTemplate,\n mcpPageFile,\n mixedbreadSearchEndpointTemplate,\n notFoundJsonTemplate,\n notFoundMarkdownTemplate,\n notFoundPageTemplate,\n ogEndpointTemplate,\n playgroundProxyTemplate,\n rawMarkdownEndpointTemplate,\n rssEndpointTemplate,\n staticJsonEndpointTemplate,\n runtimeDependencies,\n runtimePackageTemplate,\n runtimeTsconfigTemplate,\n featuresTemplate,\n navFragmentTemplate,\n consentClientTemplate,\n searchClientTemplate,\n searchEndpointTemplate,\n stagedContentDir,\n} from \"./templates.ts\";\nimport type { ClientFeatures } from \"./templates.ts\";\n\n// The render-deps plugin and the dependency-directory probe live in\n// `render-deps.ts`; `blume/astro` and existing callers import them from here.\nexport { blumeDepsDir, prerenderDepsPlugin } from \"./render-deps.ts\";\nexport type { PrerenderDepsPlugin } from \"./render-deps.ts\";\n\n/** Absolute path to the Blume package `src` directory. */\nconst BLUME_SRC = join(packageRoot(), \"src\");\n\n/**\n * Whether the generated `react()` call turns the React Compiler on: React and\n * `react.compiler` are both on, and `oxc-transform-react` (Blume ships it)\n * resolves. False when React or the compiler is off.\n *\n * The compiler is loaded by `@vitejs/plugin-react` with a bare\n * `import(\"oxc-transform-react\")` from its own directory, which fails the\n * build when it throws, so the check walks the same chain — Blume →\n * `@astrojs/react` → `@vitejs/plugin-react` — rather than resolving from\n * Blume's root, which a strict package manager may not link the plugin to.\n */\nexport const resolveReactCompiler = (\n config: ResolvedConfig,\n needsReact: boolean,\n pkgDir: string = packageRoot()\n): boolean => {\n if (!(needsReact && config.react.compiler)) {\n return false;\n }\n try {\n const astroReact = createRequire(\n pathToFileURL(join(pkgDir, \"_.js\")).href\n ).resolve(\"@astrojs/react\");\n const pluginReact = createRequire(astroReact).resolve(\n \"@vitejs/plugin-react\"\n );\n createRequire(pluginReact).resolve(\"oxc-transform-react\");\n return true;\n } catch {\n return false;\n }\n};\n\n/**\n * Warning (as a spreadable list) for the case where the React Compiler was\n * requested but its plugin couldn't be resolved — so the build silently drops\n * to uncompiled output rather than failing. Exported for testing.\n */\nexport const reactCompilerWarnings = (\n config: ResolvedConfig,\n needsReact: boolean,\n compiler: boolean\n): string[] =>\n needsReact && config.react.compiler && !compiler\n ? [\n \"React Compiler is enabled but `oxc-transform-react` could not be resolved; falling back to an uncompiled build. Reinstall Blume, or set `react: { compiler: false }` to silence this.\",\n ]\n : [];\n\n/** Resolve Astro's package.json directly inside a node_modules directory. */\nconst resolveAstroPackageJson = (modulesDir: string): string | null => {\n try {\n return realpathSync(join(modulesDir, \"astro\", \"package.json\"));\n } catch {\n return null;\n }\n};\n\n/**\n * The `astro` package reachable through the normal node_modules ancestor walk\n * from a generated runtime — its realpath'd `package.json` plus the\n * `node_modules` directory the walk found it in — or null when none resolves.\n *\n * This deliberately does not use `createRequire().resolve()`. pnpm's generated\n * bin shim adds Blume's virtual-store dependencies to `NODE_PATH`, which\n * CommonJS resolution honors but ESM package resolution ignores. The generated\n * Astro config uses ESM imports, so treating a NODE_PATH-only result as\n * reachable skips the dependency link and makes `import \"astro/config\"` fail.\n * Walking the physical node_modules ancestors mirrors the lookup that config\n * actually gets.\n *\n * The containing directory matters as much as the package: under an isolated\n * linker the walk can find a store-deduped astro in a directory that holds\n * nothing else of Blume's, so \"the right astro resolves\" does not imply \"the\n * integrations resolve\" — callers must check where the hit came from.\n */\nconst resolvedAstroHit = (\n fromDir: string\n): { modulesDir: string; pkg: string } | null => {\n let dir = normalize(fromDir);\n while (true) {\n const modulesDir = join(dir, \"node_modules\");\n const pkg = resolveAstroPackageJson(modulesDir);\n if (pkg) {\n return { modulesDir, pkg };\n }\n const parent = dirname(dir);\n if (parent === dir) {\n return null;\n }\n dir = parent;\n }\n};\n\n/**\n * Whether two paths name the same physical directory (realpath equality).\n * Exported for testing.\n */\nexport const sameRealDir = (a: string, b: string): boolean => {\n try {\n return realpathSync(a) === realpathSync(b);\n } catch {\n return false;\n }\n};\n\n/**\n * Create `link` as a directory symlink to `target`, falling back to a junction.\n *\n * The type only matters on Windows, and there a junction is the wrong first\n * choice: Windows can't follow a *relative* symlink reached through a\n * junction (it resolves the relative target against the junction-side path,\n * so it lands outside the store and every lookup is ENOENT), and Bun's\n * isolated linker writes exactly those into Blume's dependency directory\n * whenever it holds symlink privilege. A directory symlink traverses them\n * fine. Without that privilege (no Developer Mode, non-admin shell) creating\n * one fails, so fall back to a junction — and in that session the installer\n * had no privilege either, so the deps are absolute junctions a junction can\n * follow. Exported for testing.\n */\nexport const symlinkDir = async (\n target: string,\n link: string\n): Promise<void> => {\n try {\n await symlink(target, link, \"dir\");\n } catch {\n await symlink(target, link, \"junction\");\n }\n};\n\n/**\n * Point `link` at Blume's dependency directory via a `node_modules` link,\n * replacing a stale link we own and leaving a real directory untouched.\n *\n * `lstat`, not `existsSync`, so a broken link (target since moved) is still\n * detected — `existsSync` follows the link and reports a dangling one as absent.\n */\nconst linkDepsJunction = async (\n link: string,\n depsDir: string\n): Promise<void> => {\n let existing: Awaited<ReturnType<typeof lstat>> | null;\n try {\n existing = await lstat(link);\n } catch {\n existing = null;\n }\n if (existing) {\n if (!existing.isSymbolicLink()) {\n return;\n }\n // Already pointing at the right target — leave it alone. This runs on\n // every dev regeneration, and an unconditional rm+recreate opens a window\n // in which the Vite server's module resolution races a missing\n // `node_modules` and 500s intermittently.\n try {\n if (resolve(dirname(link), await readlink(link)) === resolve(depsDir)) {\n return;\n }\n } catch {\n // Unreadable link — replace it below.\n }\n await rm(link, { force: true });\n }\n await mkdir(dirname(link), { recursive: true });\n await symlinkDir(depsDir, link);\n};\n\n/** Read the `version` field of a `package.json`, or null when unreadable. */\nconst readPkgVersion = (pkgJsonPath: string | null): string | null => {\n if (!pkgJsonPath) {\n return null;\n }\n try {\n return JSON.parse(readFileSync(pkgJsonPath, \"utf-8\")).version ?? null;\n } catch {\n return null;\n }\n};\n\n/**\n * Build the diagnostic for a split-layout Astro conflict that a symlink can't\n * repair: a different Astro is hoisted to the project root, shadowing Blume's,\n * and `@astrojs/mdx` binds to the wrong copy. `blumeAstroPkg`/`shadowAstroPkg`\n * are the resolved `astro/package.json` paths for Blume's set and the one the\n * runtime actually resolves.\n */\nconst astroConflictWarning = (\n blumeAstroPkg: string | null,\n shadowAstroPkg: string | null\n): string => {\n const blume = readPkgVersion(blumeAstroPkg);\n const shadow = readPkgVersion(shadowAstroPkg);\n const versions =\n blume && shadow\n ? `astro@${shadow} shadowing Blume's astro@${blume}`\n : \"a second copy of Astro shadowing Blume's\";\n const pin = blume ?? \"<Blume's astro version>\";\n return `Astro version conflict: another dependency hoisted ${versions} to the project root, so @astrojs/mdx binds to the wrong copy and the build fails on a missing export (e.g. \"chunkToString\"). A single symlink can't reconcile a split install — pin Blume's Astro by adding a package.json \"overrides\" (npm/bun/pnpm) or \"resolutions\" (yarn) entry { \"astro\": \"${pin}\" }, then reinstall. Run \\`npm ls astro\\` to find the dependency pulling the older copy.`;\n};\n\n/**\n * Drop a `.blume/node_modules` junction that resolves a *different* Blume than\n * the one running. A restored build cache (e.g. Vercel's) can resurrect the\n * junction pointing into a superseded store directory — blume@1.1.0's isolated\n * deps dir after 1.1.1 was installed. Releases rarely bump Astro, so the stale\n * target still resolves the very same astro and every astro-based probe in\n * {@link ensureDepsLink} passes through the link — while the `blume/*` imports\n * in the freshly generated config load the previous release, crashing on any\n * export added since. Staleness is judged by realpath: the link is stale\n * exactly when the directory behind it holds a `blume` that isn't `pkgDir`.\n * A target with no `blume` entry (the workspace layout links\n * `packages/blume/node_modules`, which holds only the deps) resolves Blume\n * through the normal ancestor walk and stays. Real directories stay too,\n * mirroring {@link linkDepsJunction} — we only ever remove a link we own.\n */\nconst dropStaleDepsLink = async (\n link: string,\n pkgDir: string\n): Promise<void> => {\n let existing: Awaited<ReturnType<typeof lstat>>;\n try {\n existing = await lstat(link);\n } catch {\n return;\n }\n if (!existing.isSymbolicLink()) {\n return;\n }\n let linkedBlume: string;\n let runningBlume: string;\n try {\n linkedBlume = await realpath(join(link, \"blume\"));\n runningBlume = await realpath(pkgDir);\n } catch {\n return;\n }\n if (linkedBlume !== runningBlume) {\n await rm(link, { force: true });\n }\n};\n\n/**\n * Make the generated runtime resolve Astro and its integrations against Blume's\n * own dependency set. Three failure modes this repairs:\n *\n * - Astro is *unreachable* from `.blume/` (workspaces under isolated linkers,\n * pnpm) — the deps live in a store the upward walk can't see.\n * - Astro *resolves to the wrong copy* — a hoisted sibling pinned an older\n * major (e.g. `astro@6` for a type-only import) that shadows Blume's\n * `astro@7`, so `@astrojs/mdx@7` binds to it and crashes the build on a\n * missing export. Resolving merely *an* astro isn't enough; it must be the\n * same one Blume uses.\n * - The *integrations* are unreachable while astro is fine — npm's split\n * install. An `overrides` pin plus an incremental `npm install` hoists\n * astro to the project root (deleting Blume's nested copy) but leaves\n * `@astrojs/mdx` and friends nested under `blume/node_modules`, where the\n * upward walk from `.blume/` can't see them. The same shape arises under\n * an isolated linker when the workspace itself declares astro at a version\n * matching Blume's: the store dedupes both to one copy, so the walk finds\n * the \"correct\" astro through the workspace's own direct-dep symlink — in\n * a node_modules holding none of Blume's other deps.\n *\n * The repair is the same symlink: Blume's dependency directory linked in as\n * `.blume/node_modules` so the generated config's bare specifiers (`astro`,\n * `@astrojs/mdx`, …) bind to a consistent set. That's safe when the linked\n * directory holds the full set, or when it holds only the integrations but the\n * runtime already resolves Blume's astro — the junction has no `astro` entry,\n * so astro lookups fall through to the hoisted copy the integrations bind to\n * anyway. What it can't fix is the inverse split: Blume's astro nested under a\n * *conflicting* hoisted astro with the integrations hoisted away from it. No\n * single directory yields a consistent set there; only a root `overrides`/\n * `resolutions` pin does, so we return a diagnostic naming the conflict rather\n * than silently shipping a runtime that crashes downstream. Returns the\n * warning, or null when nothing needs saying.\n */\nexport const ensureDepsLink = async (\n outDir: string,\n pkgDir: string = packageRoot()\n): Promise<string | null> => {\n const astroDir = candidateHolding(pkgDir, \"astro\");\n if (!astroDir) {\n return null;\n }\n const mdxDir = candidateHolding(pkgDir, \"@astrojs\", \"mdx\");\n const blumeAstro = resolveAstroPackageJson(astroDir);\n // Before probing what `.blume/` resolves, drop a cache-restored junction\n // that binds it to a superseded Blume — the probes below would otherwise\n // pass right through it (same astro, older blume) and leave it in place.\n await dropStaleDepsLink(join(outDir, \"node_modules\"), pkgDir);\n const outDirHit = resolvedAstroHit(outDir);\n // `.blume/` resolves the very same astro Blume's deps provide.\n const astroCorrect = blumeAstro !== null && outDirHit?.pkg === blumeAstro;\n // Clean hoisted install: astro is correct, found in Blume's own dependency\n // directory, and the integrations sit beside it — the same walk resolves\n // them too, so there is nothing to do. Requiring the walk to land in\n // `astroDir` itself (not merely resolve an identical astro) matters under\n // isolated linkers: a workspace that declares astro at a version matching\n // Blume's gets a store-deduped symlink in its own node_modules, so the walk\n // finds the \"correct\" astro in a directory holding only the workspace's\n // direct deps — none of Blume's integrations (issue #103).\n const walkLandsInDeps =\n astroCorrect &&\n outDirHit !== null &&\n sameRealDir(outDirHit.modulesDir, astroDir);\n if (walkLandsInDeps && mdxDir === astroDir) {\n return null;\n }\n // Linking the integrations' directory yields a consistent set when it also\n // holds Blume's astro (the unreachable and repairable-conflict cases) or\n // when the correct astro is reachable without it (the npm split install).\n // Any existing link here is stale and gets replaced.\n if (mdxDir && (mdxDir === astroDir || astroCorrect)) {\n await linkDepsJunction(join(outDir, \"node_modules\"), mdxDir);\n return null;\n }\n // Split layout: Blume's astro is nested (a conflicting astro took the root\n // spot) but @astrojs/mdx hoisted away from it, binding to the shadow. Only a\n // root pin fixes this — surface it.\n return astroConflictWarning(blumeAstro, outDirHit?.pkg ?? null);\n};\n\n/** Absolute path to the configured `examples.css`, or null when unset. */\nconst examplesCssFile = (\n root: string,\n config: ResolvedConfig\n): string | null =>\n config.examples.css ? join(root, config.examples.css) : null;\n\n/**\n * Write the per-example preview route (`{basePath}/blume-examples/<path>`)\n * that `<Component />` iframes embed — the iframe boundary is what isolates\n * previews from the docs CSS. Nested under `basePath` in the filesystem so\n * the routes stay reachable behind a proxy that only forwards the base;\n * pruneOrphans clears a stale copy when `basePath` changes or the last\n * example is removed. Returns (as a spreadable list) a warning when the\n * configured `examples.css` doesn't exist.\n */\nconst writeExamplesPreview = async (options: {\n config: ResolvedConfig;\n hasExamples: boolean;\n root: string;\n srcDir: string;\n write: (path: string, content: string) => Promise<boolean>;\n}): Promise<string[]> => {\n const { config, hasExamples, root, srcDir, write } = options;\n if (hasExamples) {\n await write(\n join(\n srcDir,\n \"pages\",\n ...config.basePath.split(\"/\").filter(Boolean),\n \"blume-examples\",\n \"[...path].astro\"\n ),\n examplesPageTemplate()\n );\n }\n const cssFile = examplesCssFile(root, config);\n return cssFile && !existsSync(cssFile)\n ? [\n `examples.css points at \"${config.examples.css}\", which doesn't exist; previews render without it.`,\n ]\n : [];\n};\n\n/** Read a file's contents, or return an empty string if it is absent. */\nconst readOptional = async (path: string | null): Promise<string> => {\n if (!path) {\n return \"\";\n }\n try {\n return await readFile(path, \"utf-8\");\n } catch {\n return \"\";\n }\n};\n\n/**\n * Read a user stylesheet (`theme.css`, `examples.css`) that gets inlined into\n * a generated Tailwind entry under `outputDir`, re-rooting its relative\n * `@source` paths so they still resolve from where the author wrote them.\n */\nconst readUserCss = async (\n file: string | null,\n outputDir: string\n): Promise<string> => {\n const css = await readOptional(file);\n return file\n ? rebaseSourceDirectives(css, { from: file, to: outputDir })\n : css;\n};\n\n/** Heuristically detect whether the project uses React islands. */\nexport const detectNeedsReact = async (root: string): Promise<boolean> => {\n const matches = await glob([\"**/*.{tsx,jsx}\"], {\n cwd: root,\n ignore: [\"**/node_modules/**\", \"**/.blume/**\", \"**/dist/**\"],\n onlyFiles: true,\n });\n return matches.length > 0;\n};\n\n/** Block math (`$$…$$`) or an explicitly authored `<Math …>` component. */\nconst containsMath = (content: string): boolean =>\n content.includes(\"$$\") || content.includes(\"<Math\");\n\n/** Ceiling on concurrent content-file reads; unbounded fan-out risks EMFILE. */\nconst READ_CONCURRENCY = 16;\n\n/**\n * Detect whether the project can render math: block math (`$$…$$`) or an\n * explicit `<Math>` tag in any local `.md`/`.mdx`, or in staged (non-filesystem)\n * source bodies. Drives whether the generated runtime imports the `<Math>`\n * component and KaTeX's stylesheet, so a math-free site ships no KaTeX CSS.\n * Math parsing itself is always on but block-only, so one of those literals is\n * a necessary condition — no false negatives. A stray `$$` (e.g. inside a code\n * fence) merely over-includes the idempotent import, which is harmless.\n */\nexport const detectUsesMath = async (\n root: string,\n staged: Iterable<string> = []\n): Promise<boolean> => {\n const files = await glob([\"**/*.{md,mdx}\"], {\n cwd: root,\n ignore: [\"**/node_modules/**\", \"**/.blume/**\", \"**/dist/**\"],\n onlyFiles: true,\n });\n const contents = await pMap(files, (file) => readOptional(join(root, file)), {\n concurrency: READ_CONCURRENCY,\n });\n return [...contents, ...staged].some(containsMath);\n};\n\nconst hashConfigSource = (source: string): string =>\n createHash(\"sha256\").update(source).digest(\"hex\");\n\nconst loadIntegrationBridge = async (\n config: ResolvedConfig,\n context: BlumeProject[\"context\"]\n): Promise<Parameters<typeof astroConfigTemplate>[0][\"integrationBridge\"]> => {\n if (config.integrations.length === 0 || !context.configFile) {\n return;\n }\n return {\n configFile: relative(context.outDir, context.configFile),\n sourceHash: hashConfigSource(await readOptional(context.configFile)),\n };\n};\n\nconst writeIfChanged = async (\n path: string,\n content: string\n): Promise<boolean> => {\n let existing: string | null = null;\n try {\n existing = await readFile(path, \"utf-8\");\n } catch {\n existing = null;\n }\n if (existing === content) {\n return false;\n }\n // Atomic temp-write + rename, so a watching dev server never observes a\n // missing or half-written file mid-regeneration.\n await writeTextAtomic(path, content);\n return true;\n};\n\n/**\n * Delete generated files under `srcDir` that this pass didn't (re)write. The\n * generator emits many files conditionally — an assistant endpoint, OG images, a\n * search index, RSS feeds, reference pages, the MCP server — so toggling a\n * feature off would otherwise leave a stale file behind, and a leftover\n * server-rendered endpoint breaks the static build. `writeIfChanged` only ever\n * adds or updates, so this closes the loop. Scoped to `.blume/src`, so it never\n * touches Astro's `dist/`, `.astro/` cache, or the symlinked `node_modules`\n * (all of which live outside `src`). `written` holds normalized absolute paths.\n */\nexport const pruneOrphans = async (\n srcDir: string,\n written: Set<string>\n): Promise<void> => {\n const existing = await glob(\"**/*\", {\n absolute: true,\n cwd: srcDir,\n onlyFiles: true,\n });\n const removals: Promise<void>[] = [];\n for (const path of existing) {\n const normalized = normalize(path);\n if (!written.has(normalized)) {\n removals.push(rm(normalized, { force: true }));\n }\n }\n await Promise.all(removals);\n};\n\n/**\n * Collect staged (non-filesystem) page bodies keyed by their Astro entry id, so\n * i18n duplicates of one entry collapse to a single materialized file. Shared\n * with `eject`, which materializes the same bodies into the owned project.\n */\nexport const collectStaged = (project: BlumeProject): Map<string, string> => {\n const staged = new Map<string, string>();\n for (const page of project.graph.pages) {\n if (page.collection === \"staged\" && page.entryId && page.body) {\n // A colocated `./image.png` reference resolves against `.blume/content`\n // once the body is materialized there, where the file does not exist.\n // Point it at the served original instead — the same rewrite the\n // agent-facing Markdown gets.\n const text = page.sourcePath\n ? rewriteRelativeAssets({\n deployBase: project.config.deployment.options.base,\n projectRoot: project.context.root,\n source: page.body.text,\n sourcePath: page.sourcePath,\n })\n : page.body.text;\n staged.set(page.entryId, text);\n }\n }\n return staged;\n};\n\n/**\n * Materialize staged source bodies under `.blume/content` and prune orphans in\n * that tree (separate from `.blume/src`), so a removed remote entry is cleaned up.\n */\nconst writeStagedContent = async (\n out: string,\n staged: Map<string, string>\n): Promise<void> => {\n const contentDir = stagedContentDir(out);\n const written = new Set<string>();\n await Promise.all(\n [...staged].map(async ([entryId, text]) => {\n const path = join(contentDir, entryId);\n written.add(normalize(path));\n await writeIfChanged(path, text);\n })\n );\n if (existsSync(contentDir)) {\n await pruneOrphans(contentDir, written);\n }\n};\n\ninterface LogoDimensions {\n height: number;\n width: number;\n}\n\n/**\n * Read dimensions from an SVG's explicit size or its view box, with the same\n * root-tag parser og/card.ts uses for the OG brand mark so the header and the\n * card can't disagree about one logo. An SVG with no usable size collapses to\n * undefined.\n */\nconst logoDimensions = (svg: string | undefined): LogoDimensions | undefined =>\n svg ? (svgDimensions(svg) ?? undefined) : undefined;\n\n/** Read a local SVG logo from the project root or public directory. */\nconst readLogoSvg = (\n project: BlumeProject,\n source: string | undefined\n): string | undefined => {\n if (!source?.toLowerCase().endsWith(\".svg\")) {\n return;\n }\n const rel = source.replace(/^\\//u, \"\");\n const file = [\n join(project.context.root, \"public\", rel),\n join(project.context.root, rel),\n ].find((path) => existsSync(path));\n return file ? readFileSync(file, \"utf-8\") : undefined;\n};\n\n/** Narrows a config union's string shorthand from its object form. */\nconst isStringShorthand = <T>(value: T | string): value is string =>\n typeof value === \"string\";\n\n/**\n * The URL behind the footer's repo mark. A string is used as-is: `github`\n * drives the per-page edit link, the footer mark and the manifest's\n * `repository` together, so a project whose docs repo is private has to unset\n * all three, and would otherwise have no way to point the mark at anything.\n */\nconst footerRepoUrl = (\n repo: boolean | string,\n derived: string | null\n): string | null => {\n if (isStringShorthand(repo)) {\n return repo;\n }\n return repo ? derived : null;\n};\n\n/**\n * Resolve the configured logo. A single SVG is read and inlined so a\n * `currentColor` logo follows the theme; other images keep their URL for an\n * `<img>`. The file is looked up under `public/` and the project root.\n */\nconst resolveLogo = (project: BlumeProject): BlumeLogo | null => {\n const { logo } = project.config;\n if (!logo) {\n return null;\n }\n const config = isStringShorthand(logo) ? { image: logo } : logo;\n // `text` is passed through verbatim: `undefined` lets the brand fall back to\n // the site title, `\"\"` renders the mark alone (a logo with the wordmark baked\n // in).\n const { href, image: source, text } = config;\n const image = isStringShorthand(source) ? { light: source } : source;\n const light = image?.light ?? image?.dark;\n const dark = image?.dark ?? image?.light;\n const alt = image?.alt ?? \"\";\n const brandHref = href ?? \"/\";\n const lightSvg = readLogoSvg(project, light);\n const darkSvg = dark === light ? lightSvg : readLogoSvg(project, dark);\n\n if (light && light === dark && lightSvg) {\n return { alt, href: brandHref, svg: lightSvg, text };\n }\n\n const lightDimensions = logoDimensions(lightSvg);\n const darkDimensions = logoDimensions(darkSvg);\n const dimensions =\n lightDimensions || darkDimensions\n ? { dark: darkDimensions, light: lightDimensions }\n : undefined;\n return { alt, dark, dimensions, href: brandHref, light, text };\n};\n\n/**\n * Favicon filenames Blume auto-detects, in priority order. Mirrors the Next.js\n * convention: an `icon.*` or `favicon.*` file in `public/` or the project root\n * becomes the site favicon, no config required.\n */\nconst FAVICON_CANDIDATES = [\n \"icon.svg\",\n \"favicon.svg\",\n \"icon.png\",\n \"favicon.png\",\n \"favicon.ico\",\n \"icon.ico\",\n];\n\n/**\n * Derive the `-dark` sibling of an icon filename (`icon.svg` → `icon-dark.svg`),\n * inserting the suffix before the extension.\n */\nconst darkSibling = (name: string): string =>\n name.replace(/\\.(?=[^.]+$)/u, \"-dark.\");\n\n/** `<link type>` MIME for the favicon extensions we recognize. */\nconst FAVICON_TYPES = new Map([\n [\"ico\", \"image/x-icon\"],\n [\"jpeg\", \"image/jpeg\"],\n [\"jpg\", \"image/jpeg\"],\n [\"png\", \"image/png\"],\n [\"svg\", \"image/svg+xml\"],\n]);\n\n/** Infer the `<link type>` MIME from a filename, when we recognize the extension. */\nconst faviconType = (name: string): string | undefined => {\n const ext = name.split(\".\").pop()?.toLowerCase();\n return ext ? FAVICON_TYPES.get(ext) : undefined;\n};\n\n/** Read a file and encode it as a `data:` URI of the given MIME type. */\nconst inlineDataUri = (file: string, type: string): string =>\n `data:${type};base64,${readFileSync(file).toString(\"base64\")}`;\n\n/**\n * The bundled Blume favicon, inlined as a data URI so it needs no public file.\n * The mark is dark, so it ships with a light-on-transparent dark-scheme variant —\n * otherwise it disappears against dark browser chrome.\n */\nconst defaultFavicon = (): BlumeFavicon => ({\n dark: {\n href: inlineDataUri(\n join(BLUME_SRC, \"assets\", \"icon-dark.png\"),\n \"image/png\"\n ),\n type: \"image/png\",\n },\n href: inlineDataUri(join(BLUME_SRC, \"assets\", \"icon.png\"), \"image/png\"),\n type: \"image/png\",\n});\n\n/**\n * Apple touch icon filenames Blume auto-detects, in priority order. Mirrors the\n * Next.js `apple-icon.*` convention (plus the `apple-touch-icon.png` most favicon\n * generators emit): a match in `public/` or the project root becomes the iOS\n * home-screen icon, no config required.\n */\nconst APPLE_ICON_CANDIDATES = [\n \"apple-icon.png\",\n \"apple-icon.jpg\",\n \"apple-icon.jpeg\",\n \"apple-touch-icon.png\",\n];\n\n/**\n * Resolve an icon file by convention. A candidate in `public/` is served as-is\n * and referenced by URL; one at the project root is inlined as a data URI (the\n * root isn't a served directory). Returns null when the project ships none.\n */\nconst resolveIconFile = (\n project: BlumeProject,\n candidates: string[]\n): BlumeFavicon | null => {\n const { root } = project.context;\n for (const name of candidates) {\n if (existsSync(join(root, \"public\", name))) {\n return { href: `/${name}`, type: faviconType(name) };\n }\n }\n for (const name of candidates) {\n const file = join(root, name);\n if (existsSync(file)) {\n const type = faviconType(name);\n return { href: inlineDataUri(file, type ?? \"image/x-icon\"), type };\n }\n }\n return null;\n};\n\n/**\n * Resolve the site favicon by convention, falling back to the bundled Blume mark\n * when the project ships no `icon.*`/`favicon.*` file. The dark-scheme variant\n * is anchored to the resolved icon: its `-dark` sibling (e.g. `icon.svg` →\n * `icon-dark.svg`) in the same directory — never an unrelated `-dark` file, so a\n * stale or foreign `favicon-dark.*` can't silently pair with a different mark.\n * A `-dark` file with no light sibling is the site's only mark and is used for\n * both schemes, mirroring how `resolveLogo` treats a single-variant image.\n */\nconst resolveFavicon = (project: BlumeProject): BlumeFavicon => {\n const { root } = project.context;\n for (const name of FAVICON_CANDIDATES) {\n if (existsSync(join(root, \"public\", name))) {\n const type = faviconType(name);\n const sibling = darkSibling(name);\n return existsSync(join(root, \"public\", sibling))\n ? { dark: { href: `/${sibling}`, type }, href: `/${name}`, type }\n : { href: `/${name}`, type };\n }\n }\n for (const name of FAVICON_CANDIDATES) {\n const file = join(root, name);\n if (existsSync(file)) {\n const type = faviconType(name);\n const mime = type ?? \"image/x-icon\";\n const siblingFile = join(root, darkSibling(name));\n return existsSync(siblingFile)\n ? {\n dark: { href: inlineDataUri(siblingFile, mime), type },\n href: inlineDataUri(file, mime),\n type,\n }\n : { href: inlineDataUri(file, mime), type };\n }\n }\n return (\n resolveIconFile(project, FAVICON_CANDIDATES.map(darkSibling)) ??\n defaultFavicon()\n );\n};\n\n/**\n * Resolve the Apple touch icon by convention, or null when the project ships\n * none (unlike the favicon, there's no bundled default). Note: iOS ignores\n * `data:`-URI apple-touch-icons, so a `public/` file (served by URL) is the\n * reliable path; a root-level file is still inlined for symmetry with favicons.\n * Deliberately no `-dark` sibling detection here: iOS ignores `media` on\n * `apple-touch-icon` links, so a dark variant could never be served.\n */\nconst resolveAppleIcon = (project: BlumeProject): BlumeFavicon | null =>\n resolveIconFile(project, APPLE_ICON_CANDIDATES);\n\n/** Normalize the banner config (string shorthand or object) for the runtime. */\nconst resolveBanner = (config: ResolvedConfig): BlumeBanner | null => {\n const { banner } = config;\n if (!banner) {\n return null;\n }\n if (isStringShorthand(banner)) {\n return { content: banner, dismissible: false, key: banner };\n }\n // `link.href` stays as authored; the link the banner renders is the\n // navigation's `bannerHref`, localized and mounted under `basePath`.\n return {\n content: banner.content,\n dismissible: banner.dismissible,\n key:\n banner.id ??\n resolveLocalizable(banner.content, undefined, config.i18n?.defaultLocale),\n link: banner.link,\n };\n};\n\n/** The URL the built-in proxy is injected at (see {@link planPlaygroundProxy}). */\nexport const playgroundProxyPattern = (config: ResolvedConfig): string =>\n withBasePath(config.basePath, \"/_api-proxy\");\n\n/**\n * The hand-written endpoint defaults for the runtime, the playground's\n * `proxy: true` resolved to the built-in route's URL, as an OpenAPI\n * reference's is.\n */\nconst resolveApiPages = (config: ResolvedConfig): BlumeDataConfig[\"api\"] => {\n const { auth, playground, server } = config.api;\n const resolved: BlumeDataConfig[\"api\"] = {\n playground: {\n enabled: playground.enabled,\n proxy:\n playground.proxy === true\n ? playgroundProxyPattern(config)\n : playground.proxy,\n },\n };\n if (auth) {\n resolved.auth = auth;\n }\n if (server) {\n resolved.server = server;\n }\n return resolved;\n};\n\n/** The footer config for the runtime: `null` when unset or empty, so no bare border renders. */\nconst resolveFooter = (\n config: ResolvedConfig\n): ResolvedConfig[\"footer\"] | null => {\n const { footer } = config;\n return footer &&\n (footer.copyright !== undefined ||\n footer.links.length > 0 ||\n Object.keys(footer.socials).length > 0)\n ? footer\n : null;\n};\n\n/**\n * The OG card's brand mark: a `seo.og.logo` of `false` opts out of any mark,\n * a configured SVG wins over the site logo, and a non-SVG value resolves to\n * `undefined` (the card falls back to the accent-initial tile).\n */\nconst resolveOgMark = (\n project: BlumeProject,\n siteLogo: string | undefined\n): string | false | undefined => {\n const configured = project.config.seo.og.logo;\n if (configured === false) {\n return false;\n }\n if (configured) {\n return resolveOgLogo(project, configured);\n }\n return siteLogo;\n};\n\n/**\n * The OG card's footer site text. A `seo.og.site` override wins (`false`\n * hides it); the default is the deployment site's host plus the normalized\n * deployment base — on a subpath deploy (a GitHub Pages project site) the\n * bare host is the platform's shared apex, not this site (#139).\n */\nconst resolveOgSite = (config: ResolvedConfig): string | undefined => {\n const configured = config.seo.og.site;\n if (configured === false) {\n return;\n }\n if (configured !== undefined) {\n return configured;\n }\n return config.deployment.options.site\n ? `${new URL(config.deployment.options.site).host}${normalizeBasePath(\n config.deployment.options.base\n )}`\n : undefined;\n};\n\n/**\n * The OG card's site-wide subtitle: `seo.og.description` (`false` omits it)\n * over the site description. The generated endpoint prefers a page's own\n * description and falls back to this.\n */\nconst resolveOgDescription = (config: ResolvedConfig): string | undefined => {\n const configured = config.seo.og.description;\n if (configured === false) {\n return;\n }\n return configured ?? config.description;\n};\n\n/**\n * Repo coordinates for content components. `host` and the derived `api` ride\n * along so a card on an Enterprise site links and queries that instance rather\n * than the public one.\n */\nconst resolveGithubData = (\n github: ResolvedConfig[\"github\"]\n): BlumeData[\"config\"][\"github\"] =>\n github\n ? {\n api: githubApiUrl(github),\n host: github.host,\n owner: github.owner,\n repo: github.repo,\n }\n : null;\n\n/** The assistant's snapshot: what the panel needs, never a secret. */\nconst resolveAssistant = (\n config: ResolvedConfig\n): BlumeDataConfig[\"assistant\"] => {\n const { assistant } = config.ai;\n if (!assistant?.enabled) {\n return null;\n }\n return {\n captcha: assistant.captcha ? captchaSettings(assistant.captcha) : null,\n endpoint: assistant.endpoint ?? null,\n suggestions: assistant.suggestions,\n support: assistant.support ?? null,\n };\n};\n\n/** Serialize the content graph into the data module the runtime consumes. */\nexport const buildRuntimeData = (project: BlumeProject): string => {\n const { config, context, graph, manifest } = project;\n const { github } = config;\n const repoUrl = github ? githubRepoUrl(github) : null;\n const editBase = github ? githubEditBaseUrl(github) : null;\n const logo = resolveLogo(project);\n const ogLogo = resolveOgMark(project, logo?.svg);\n // Files git ignores (a generated reference in a gitignored folder) are\n // never in the repository, so an edit link would 404. One git call covers\n // every page an edit link is built for.\n const ignored = editBase\n ? gitIgnoredPaths(\n context.root,\n manifest.routes.flatMap((route) =>\n route.editUrl === undefined && route.sourcePath\n ? [route.sourcePath]\n : []\n )\n )\n : new Set<string>();\n\n const editUrlFor = (sourcePath?: string): string | null => {\n if (!(editBase && sourcePath) || ignored.has(sourcePath)) {\n return null;\n }\n const rel = relative(context.root, sourcePath).split(\"\\\\\").join(\"/\");\n // The edit path is repo-relative: `github.dir` places the project inside\n // the repo, so a source above the project dir (a monorepo vault beside the\n // docs app) still resolves to an in-repo file. A path that escapes the\n // repo itself has nothing to edit — fabricating one yields a 404 link.\n // `dir` is a bare string in the schema, so a leading slash (`/apps/docs`)\n // is trimmed rather than read as an absolute path — which would drop the\n // link from every page of a site that has always written it that way.\n const editDir = trimChar(github?.dir ?? \"\", \"/\");\n const editPath = normalize(editDir ? join(editDir, rel) : rel);\n if (editPath.startsWith(\"..\") || isAbsolute(editPath)) {\n return null;\n }\n return `${editBase}/${editPath}`;\n };\n\n const { i18n } = config;\n\n // Resolve the footer's repo link per locale. API references no longer add a tab\n // automatically — authors point a `navigation.tabs` entry at the reference\n // route to surface it (see `referenceRoutes`).\n const markUrl = footerRepoUrl(config.navigation.repo, repoUrl);\n const withRepoUrl = (nav: Navigation): Navigation => ({\n ...nav,\n repoUrl: markUrl,\n });\n\n // Resolved UI dictionaries: one per locale under i18n, English baseline\n // otherwise. Threaded into chrome so the catch-all can pick the active locale.\n // The `changelog` config's title and description replace the dictionaries'.\n const uiByLocale = i18n\n ? Object.fromEntries(\n i18n.locales.map(({ code }) => [\n code,\n withChangelogIndexText(\n config,\n resolveUIStrings(code, {\n defaultLocale: i18n.defaultLocale,\n overrides: i18n.ui,\n }),\n code\n ),\n ])\n )\n : {};\n const defaultUi = withChangelogIndexText(\n config,\n i18n\n ? resolveUIStrings(i18n.defaultLocale, {\n defaultLocale: i18n.defaultLocale,\n overrides: i18n.ui,\n })\n : EN_UI,\n i18n?.defaultLocale\n );\n\n const navigationByLocale = i18n\n ? Object.fromEntries(\n i18n.locales.map(({ code }) => [\n code,\n withRepoUrl(\n graph.navigationByLocale[code] ?? {\n actions: [],\n cta: null,\n featured: [],\n selectors: [],\n sidebar: [],\n tabs: [],\n }\n ),\n ])\n )\n : {};\n\n const data: BlumeData = {\n config: {\n analytics: config.analytics,\n api: resolveApiPages(config),\n appleIcon: resolveAppleIcon(project),\n assistant: resolveAssistant(config),\n banner: resolveBanner(config),\n basePath: config.basePath,\n codeThemes: config.markdown.code.theme,\n codeWrap: config.markdown.code.wrap,\n consent: config.consent,\n dateFormat: config.dateFormat,\n description: config.description,\n discovery: {\n agentReadability: config.agents.agentReadability,\n aiCatalog: hasAiCatalog(config),\n api: config.agents.api,\n llmsTxt: config.agents.llmsTxt.enabled,\n // Mirrors `buildSitemapFiles`: no site, no sitemap.\n sitemap: config.seo.sitemap && Boolean(config.deployment.options.site),\n },\n favicon: resolveFavicon(project),\n feedback: config.feedback.enabled,\n feedbackComments: config.feedback.comments,\n footer: resolveFooter(config),\n github: resolveGithubData(github),\n i18n: i18n\n ? {\n defaultLocale: i18n.defaultLocale,\n // The locale fallback content is rendered from, so the catch-all can\n // set the content direction to the language it's actually written in.\n fallbackLocale: resolveFallbackLocale(i18n),\n hideDefaultLocalePrefix: i18n.hideDefaultLocalePrefix,\n locales: i18n.locales.map(({ code, dir, label }) => ({\n code,\n dir,\n label,\n })),\n routeByBrowserLanguage: i18n.routeByBrowserLanguage,\n }\n : null,\n // `undefined` members drop out of the JSON snapshot; the null keeps the\n // \"nothing configured\" case explicit for the layouts.\n identity:\n config.seo.organization || config.seo.software\n ? {\n organization: config.seo.organization,\n software: config.seo.software,\n }\n : null,\n imageZoom: config.markdown.imageZoom,\n logo,\n mcp: config.agents.mcp.enabled\n ? {\n clients: config.agents.mcp.clients,\n name: config.agents.mcp.name ?? config.title,\n route: config.agents.mcp.route,\n }\n : null,\n metatags: config.seo.metatags ?? null,\n narration: config.narration.enabled\n ? { generated: config.narration.provider !== null }\n : null,\n // `og.enabled` is resolved to a definite boolean in `loadConfig`; coerce\n // the optional schema type so the serialized shape stays `boolean`.\n // Card fonts are baked into the generated OG endpoint (they can carry\n // absolute build-machine paths), not serialized here — this snapshot\n // ends up in every page's client data.\n og: {\n description: resolveOgDescription(config),\n enabled: config.seo.og.enabled ?? false,\n logo: ogLogo,\n palette: config.seo.og.palette,\n site: resolveOgSite(config),\n },\n openInChat: config.ai.openInChat,\n repoUrl,\n search: {\n analytics: config.search.analytics,\n enabled: config.search.provider.mode !== \"none\",\n popular: resolveSearchPopular(config.search.popular, config.basePath),\n provider: config.search.provider.kind,\n },\n site: config.deployment.options.site ?? null,\n structuredData: config.seo.structuredData,\n theme: config.theme,\n title: config.title,\n toc: config.toc,\n versions: config.versions ?? null,\n webmcp: {\n enabled: config.agents.webmcp,\n llms: config.agents.llmsTxt.enabled,\n },\n x: config.seo.x,\n },\n feeds: buildRssFeeds(project).map((feed) => ({\n href: feed.path,\n title: feed.title,\n })),\n // CSS variables for Astro's <Font> component; matches the astro.config\n // `fonts:` entries derived from the same theme.fonts config (and the\n // same locale-derived subsets, so preloads cover the scripts pages use).\n fontCssVars: configuredFonts(\n config.theme.fonts,\n fontLocaleCodes(config.i18n)\n ),\n navigation: withRepoUrl(graph.navigation),\n // Per-locale navigation; the catch-all selects the active locale's tree.\n navigationByLocale,\n // Per-archived-version navigation; the catch-all selects by the route's\n // version, then locale.\n navigationByVersion: Object.fromEntries(\n Object.entries(graph.navigationByVersion).map(([id, byLocale]) => [\n id,\n Object.fromEntries(\n Object.entries(byLocale).map(([code, nav]) => [\n code,\n withRepoUrl(nav),\n ])\n ),\n ])\n ),\n routes: manifest.routes.map((route) => ({\n alternates: route.alternates,\n collection: route.collection,\n description: route.description ?? null,\n draft: route.draft,\n editUrl: route.editUrl ?? editUrlFor(route.sourcePath),\n entryId: route.entryId,\n fallback: route.fallback ?? false,\n hidden: route.hidden,\n id: route.id,\n indexable: route.indexable,\n lastModified: route.lastModified ?? null,\n locale: route.locale,\n monolingual: route.monolingual ?? false,\n path: route.path,\n title: route.title,\n version: route.version,\n versionAlternates: route.versionAlternates,\n })),\n // Default-locale chrome strings (English baseline when not under i18n).\n ui: defaultUi,\n // Per-locale chrome strings, selected by the catch-all under i18n.\n uiByLocale,\n };\n return `${JSON.stringify(data, null, 2)}\\n`;\n};\n\n/** The resolved plan for the hosted MCP server within a single generate pass. */\ninterface McpPlan {\n /** Directory holding the injected discovery endpoints (`.blume/src/blume-mcp`). */\n dir: string;\n /** `.well-known` discovery routes to inject as prerendered pages. */\n discoveryPages: { entrypoint: string; pattern: string }[];\n enabled: boolean;\n route: string;\n srcDir: string;\n warnings: string[];\n}\n\n/**\n * Decide whether (and how) to generate the MCP server. Skipped — with a\n * warning — when a content page or a custom `.astro` page already occupies its\n * route, so the user's page keeps working instead of colliding.\n */\nconst planMcp = (\n project: BlumeProject,\n srcDir: string,\n userPages: { pattern: string }[]\n): McpPlan => {\n const { config } = project;\n const { route } = config.agents.mcp;\n const dir = join(srcDir, \"blume-mcp\");\n const base: McpPlan = {\n dir,\n discoveryPages: [],\n enabled: false,\n route,\n srcDir,\n warnings: [],\n };\n if (!config.agents.mcp.enabled) {\n return base;\n }\n if (routeIsTaken(userPages, project.graph.pages, route)) {\n return {\n ...base,\n warnings: [\n `MCP server route \"${route}\" is already used by a content or custom page; the MCP server was not generated. Set a different \"agents.mcp.route\" in blume.config.ts.`,\n ],\n };\n }\n return {\n ...base,\n discoveryPages: [\n {\n entrypoint: join(dir, \"discovery.ts\"),\n pattern: \"/.well-known/mcp.json\",\n },\n {\n entrypoint: join(dir, \"server-card.ts\"),\n pattern: \"/.well-known/mcp/server-card.json\",\n },\n ],\n enabled: true,\n };\n};\n\n/** A pass's runtime data modules, published together once every writer ran. */\ntype RuntimeModules = Map<RuntimeModuleId, string>;\n\n/**\n * The agent data snapshot (`blume:mcp-data`) behind the MCP server and the\n * JSON docs API: built once per pass when either is on, published to the\n * runtime modules, and handed to both writers. Null when neither needs it.\n */\nconst publishAgentData = async (\n project: BlumeProject,\n plans: { api: ApiPlan; mcp: McpPlan },\n modules: RuntimeModules\n): Promise<McpData | null> => {\n if (!(plans.mcp.enabled || plans.api.enabled)) {\n return null;\n }\n const data = await buildMcpData(project);\n modules.set(\"blume:mcp-data\", JSON.stringify(data));\n return data;\n};\n\n/** Write the MCP server endpoint and discovery documents. */\nconst writeMcpFiles = async (\n plan: McpPlan,\n write: (path: string, content: string) => Promise<boolean>,\n data: McpData | null\n): Promise<void> => {\n if (!(plan.enabled && data)) {\n return;\n }\n const discoveryInput = {\n base: data.base,\n name: data.name,\n route: plan.route,\n site: data.site,\n version: data.version,\n };\n await Promise.all([\n write(\n join(plan.srcDir, \"pages\", mcpPageFile(plan.route)),\n mcpEndpointTemplate()\n ),\n write(\n join(plan.dir, \"discovery.ts\"),\n staticJsonEndpointTemplate(buildMcpDiscovery(discoveryInput))\n ),\n write(\n join(plan.dir, \"server-card.ts\"),\n staticJsonEndpointTemplate(buildMcpServerCard(discoveryInput))\n ),\n ]);\n};\n\n/** The resolved plan for the JSON docs API within a single generate pass. */\ninterface ApiPlan {\n /**\n * Whether the `/api/` catch-all (JSON 404s) is written: server output, no\n * user page owning a rest route under `/api/`, and no content page served\n * from the `/api` namespace (the catch-all would outrank those pages).\n */\n catchAll: boolean;\n enabled: boolean;\n /** Whether the live endpoints (search) are written — server output only. */\n server: boolean;\n /**\n * Whether `/openapi.json` is generated: skipped when a `public/openapi.json`\n * or a user page owns the route, so a site can publish its own description.\n */\n spec: boolean;\n srcDir: string;\n}\n\n/** Whether a user page pattern is a rest route under `/api/` (`/api/[...x]`). */\nconst ownsApiRest = (page: { pattern: string }): boolean =>\n page.pattern.startsWith(\"/api/[\");\n\n/**\n * Whether a content route lives in the `/api` namespace — a docs section\n * about an API commonly does (`content/api/overview.md` → `/api/overview`).\n * Astro ranks `/api/[...path]` above the content catch-all (`/[...slug]`),\n * so the JSON 404 route would shadow those pages wherever routing decides\n * (the dev server, adapters that don't serve prerendered files first).\n */\nconst contentUnderApi = (page: { route: string }): boolean =>\n page.route === \"/api\" || page.route.startsWith(\"/api/\");\n\n/**\n * Decide what the JSON docs API generates. The prerendered endpoints always\n * ride along when the feature is on (they live under Blume's own `/api/docs/`\n * namespace); the live ones need server output; the OpenAPI description yields\n * to one the project ships itself.\n */\nconst planApi = (\n project: BlumeProject,\n srcDir: string,\n userPages: { pattern: string }[]\n): ApiPlan => {\n const { config, context } = project;\n const server = config.deployment.options.output === \"server\";\n return {\n catchAll:\n server &&\n !userPages.some(ownsApiRest) &&\n !project.graph.pages.some(contentUnderApi),\n enabled: config.agents.api,\n server,\n spec:\n !routeIsTaken(userPages, project.graph.pages, OPENAPI_PATH) &&\n !existsSync(join(context.root, \"public\", \"openapi.json\")),\n srcDir,\n };\n};\n\n/**\n * Write the JSON docs API: the prerendered page index, per-page documents, and\n * navigation; on server output the search endpoint and the `/api/` catch-all;\n * and the OpenAPI description of the whole agent-facing surface. The MCP\n * route reaches the description only when the server was actually planned (a\n * collision can disable it), so it never advertises an endpoint that isn't\n * there.\n */\nconst writeApiFiles = async (\n project: BlumeProject,\n plan: ApiPlan,\n write: (path: string, content: string) => Promise<boolean>,\n data: McpData | null,\n mcp: McpPlan\n): Promise<void> => {\n if (!(plan.enabled && data)) {\n return;\n }\n const { config } = project;\n const mcpRoute = mcp.enabled ? mcp.route : null;\n const apiDir = join(plan.srcDir, \"pages\", \"api\");\n const writes = [\n write(join(apiDir, \"docs\", \"pages.json.ts\"), apiPagesIndexTemplate()),\n write(\n join(apiDir, \"docs\", \"pages\", \"[...route].json.ts\"),\n apiPageTemplate()\n ),\n write(join(apiDir, \"docs\", \"navigation.json.ts\"), apiNavigationTemplate()),\n ];\n if (plan.server) {\n writes.push(write(join(apiDir, \"docs\", \"search.ts\"), apiSearchTemplate()));\n }\n if (plan.catchAll) {\n writes.push(\n write(\n join(apiDir, \"[...path].ts\"),\n apiNotFoundTemplate({ base: data.base, site: data.site })\n )\n );\n }\n if (plan.spec) {\n writes.push(\n write(\n join(plan.srcDir, \"pages\", \"openapi.json.ts\"),\n staticJsonEndpointTemplate(\n buildApiSpec({\n agentReadability: config.agents.agentReadability,\n base: data.base,\n description: config.description,\n llmsTxt: config.agents.llmsTxt.enabled,\n mcpRoute,\n name: config.title,\n search: plan.server,\n site: data.site,\n version: data.version,\n })\n )\n )\n );\n }\n await Promise.all(writes);\n};\n\n/** The proxy endpoint's file under the Astro `src/` dir (eject writes it too). */\nexport const PLAYGROUND_PROXY_ENTRY = join(\"blume-openapi\", \"api-proxy.ts\");\n\n/**\n * Decide whether to generate the playground's built-in CORS proxy endpoint.\n * Only the Blume renderer's playground with `proxy: true` needs it — a proxy\n * URL string points at an external service, and `false` sends requests\n * directly. Injected at `/_api-proxy` (rather than written under `pages/`)\n * because Astro treats `_`-prefixed page files as private; the endpoint's own\n * `prerender = false` export wins over the injection default. Mounted under\n * the site `basePath`, at the URL the playground sends to (see\n * openapi/source.ts); Astro layers `deployment.base` onto both.\n */\nconst planPlaygroundProxy = (config: ResolvedConfig, srcDir: string) => ({\n enabled: needsPlaygroundProxy(config),\n entrypoint: join(srcDir, PLAYGROUND_PROXY_ENTRY),\n pattern: playgroundProxyPattern(config),\n});\n\n/**\n * The origins the built-in proxy is allowed to reach: one per absolute\n * `servers[].url` across the parsed specs — the document's, each path item's,\n * and each operation's, since an operation's playground sends to the most\n * specific of those. This is the endpoint's whole trust boundary — the client\n * sends the target as a query parameter, and a reader's custom base URL is not\n * a documented server — so it is derived here, at build time, from the same\n * documents the operation pages render.\n *\n * A templated URL (`https://{env}.api.example.com`) is allowed as the\n * playground sends it, with each variable at its declared default. Relative\n * (`/v1`) URLs, and templates with a variable left undefaulted, carry no\n * origin to allow and are skipped; AsyncAPI documents declare `servers` as a\n * map and contribute nothing (the proxy is OpenAPI-only).\n */\nconst specOriginsOf = (spec: ApiSpecData): string[] => {\n const origins = new Set<string>();\n // A GraphQL schema names no servers; its configured live endpoint is the\n // one origin the playground targets.\n if (spec.endpoint !== undefined) {\n try {\n origins.add(new URL(spec.endpoint).origin);\n } catch {\n // Not an absolute URL: nothing to allow.\n }\n }\n // SAFETY: `document` is arbitrary parsed JSON; the assertion only names\n // the optional `servers` and `paths` shapes, and every access below\n // re-checks them — `Array.isArray` guards each list, optional chaining each\n // path item and operation, and `server.url ?? \"\"` the url.\n const document = spec.document as {\n paths?: Record<string, DocumentPathItem | null | undefined>;\n servers?: DocumentServer[];\n };\n const lists = [document.servers];\n for (const item of Object.values(document.paths ?? {})) {\n lists.push(item?.servers);\n for (const method of HTTP_METHODS) {\n lists.push(item?.[method]?.servers);\n }\n }\n for (const servers of lists) {\n for (const server of Array.isArray(servers) ? servers : []) {\n const url = withServerDefaults(server.url ?? \"\", server.variables);\n // `new URL(\"https://{region}.api.example.com\")` parses — the braces land\n // in the hostname — so a variable with no default needs an explicit\n // check or its junk literal becomes an allowlist entry no real request\n // can match.\n if (url.includes(\"{\")) {\n continue;\n }\n try {\n origins.add(new URL(url).origin);\n } catch {\n // Not an absolute URL: nothing to allow.\n }\n }\n }\n return [...origins];\n};\n\n/** A `servers[]` entry as a parsed spec document declares it. */\ninterface DocumentServer {\n url?: string;\n variables?: AsyncApiSpecValue;\n}\n\n/** An OpenAPI path item: its own `servers` plus one per operation. */\ntype DocumentPathItem = { servers?: DocumentServer[] } & Partial<\n Record<HttpMethod, { servers?: DocumentServer[] } | null>\n>;\n\n/** The built-in proxy's allowlist: every spec's origins, deduped and sorted. */\nexport const specOrigins = (data: OpenApiData): string[] =>\n [...new Set(Object.values(data).flatMap(specOriginsOf))].toSorted();\n\n/** The origin of an absolute URL, or `null` for a path or anything unparsable. */\nconst originOf = (url: string): string | null => {\n try {\n return new URL(url).origin;\n } catch {\n return null;\n }\n};\n\n/**\n * The origins hand-written endpoint pages send to through the built-in\n * proxy: the site's `api.server`, and every page whose `api` names a full\n * URL. Empty unless those pages use the built-in proxy.\n */\nexport const apiPageOrigins = (project: BlumeProject): string[] => {\n const { config } = project;\n if (!apiPagesUseBuiltinProxy(config)) {\n return [];\n }\n const targets = project.graph.pages.map(\n (page) => parseApiEndpoint(page.meta.api ?? \"\")?.target ?? \"\"\n );\n return [config.api.server ?? \"\", ...targets].flatMap((target) => {\n const origin = originOf(target);\n return origin ? [origin] : [];\n });\n};\n\n/**\n * A warning when the hand-written endpoint pages send through the built-in\n * proxy but name no absolute origin for it to allow, so it would refuse every\n * request they send.\n */\nexport const apiPageProxyWarnings = (project: BlumeProject): string[] =>\n apiPagesUseBuiltinProxy(project.config) &&\n apiPageOrigins(project).length === 0\n ? [\n \"api.playground.proxy is true, but api.server isn't an absolute URL and no page's api frontmatter names one, so the built-in proxy has no origin to allow and will refuse every request the endpoint pages send. Set api.server to the API's URL, like https://api.acme.com/v1.\",\n ]\n : [];\n\n/**\n * Build-time diagnostics for playground sends the built-in proxy would refuse.\n * The baked-in allowlist pools every documented origin, but each spec's\n * playground only ever targets that spec's own servers/endpoint — so a\n * non-empty pool can still leave one spec's Send 403ing on every request.\n * Hence the check is per spec: any spec routed through the built-in proxy\n * whose own origins came out empty (no absolute `servers[].url`, no absolute\n * GraphQL `endpoint`) gets a warning naming it.\n */\nexport const proxyAllowlistWarnings = (\n config: ResolvedConfig,\n data: OpenApiData\n): string[] => {\n const proxied = new Set(\n builtinProxyReferences(config).map((reference) => reference.slug)\n );\n const warnings: string[] = [];\n for (const spec of Object.values(data)) {\n if (!proxied.has(spec.slug) || specOriginsOf(spec).length > 0) {\n continue;\n }\n warnings.push(\n spec.kind === \"graphql\"\n ? `The \"${spec.label}\" GraphQL reference (${spec.route}) has playground.proxy: true, but no absolute endpoint is configured for it, so the built-in proxy has no origin to allow and will refuse every request its playground sends. Set \\`endpoint\\` on the graphql() adapter (or the source) to the live GraphQL URL, or point playground.proxy at an external proxy URL.`\n : `The \"${spec.label}\" reference (${spec.route}) has playground.proxy: true, but its spec declares no absolute servers[].url (relative URLs, and templated ones with a variable missing its default, carry no origin), so the built-in proxy has no origin to allow and will refuse every request its playground sends. Add an absolute server URL to the spec, or point playground.proxy at an external proxy URL.`\n );\n }\n return warnings;\n};\n\n/**\n * Write the assistant endpoint and, unless the backend runs its own retrieval\n * (Inkeep), the grounding snapshot the endpoint queries at request time. A no-op\n * when the assistant is disabled.\n */\nconst writeAskFiles = async (\n project: BlumeProject,\n srcDir: string,\n write: (path: string, content: string) => Promise<boolean>,\n modules: RuntimeModules\n): Promise<void> => {\n const { assistant } = project.config.ai;\n if (!(assistant?.enabled && !assistant.endpoint)) {\n return;\n }\n const backend = resolveAskBackend(assistant.provider);\n if (backend.grounded) {\n modules.set(\"blume:ask-data\", JSON.stringify(await buildAskData(project)));\n }\n await write(\n join(srcDir, \"pages\", \"api\", \"ask.ts\"),\n askEndpointTemplate(backend, {\n captcha: assistant.captcha,\n cors: assistant.cors,\n instructions: assistant.instructions,\n rateLimit: project.config.rateLimit,\n retrieval: assistant.retrieval,\n tools: assistant.tools ?? backend.toolsByDefault,\n })\n );\n};\n\n/**\n * Write the default 404 page at Astro's reserved `src/pages/404.astro` path so\n * static builds emit `dist/404.html`, plus its Markdown twin at `404.md.ts`\n * (`dist/404.md`) for agents that ask a missing URL for Markdown and its JSON\n * twin at `404.json.ts` (`dist/404.json`, RFC 9457 problem details) for those\n * that ask for JSON. All three are skipped when the project already owns\n * `/404` (a custom `pages/404.astro` or a `404.md` content page), letting it\n * be fully overridden without a route collision; `pruneOrphans` then removes\n * any previously-generated copies.\n */\nconst writeNotFoundPage = async (\n write: (path: string, content: string) => Promise<boolean>,\n srcDir: string,\n pages: { pattern: string }[],\n contentPages: { route: string }[]\n): Promise<void> => {\n if (routeIsTaken(pages, contentPages, \"/404\")) {\n return;\n }\n await Promise.all([\n write(join(srcDir, \"pages\", \"404.astro\"), notFoundPageTemplate()),\n write(join(srcDir, \"pages\", \"404.md.ts\"), notFoundMarkdownTemplate()),\n write(join(srcDir, \"pages\", \"404.json.ts\"), notFoundJsonTemplate()),\n ]);\n};\n\n/**\n * Flatten a diagnostic to a single warning line, appending the suggestion when\n * one exists. Exported for testing.\n */\nexport const diagnosticWarning = (diagnostic: Diagnostic): string =>\n diagnostic.suggestion\n ? `${diagnostic.message} ${diagnostic.suggestion}`\n : diagnostic.message;\n\n/**\n * Missing-dependency preflight: the search provider's SDK, content source\n * SDKs, the assistant backend's and narration provider's SDKs, the deployment\n * adapter's package, and — since React ships with Blume while Vue/Svelte\n * don't — any island framework's Astro integration. A build fails here,\n * before anything is written, with the install command for the project's\n * package manager — otherwise Vite dies later on an opaque unresolved import\n * from the hidden runtime. Dev warns and keeps serving: only the pages and\n * routes that import the package break, and installing it is picked up on\n * the next restart. Dev leaves narration's SDK out, since only a build\n * generates the clips.\n */\nconst dependencyPreflight = async (\n project: BlumeProject,\n frameworks: Set<string>\n): Promise<string[]> => {\n const build = project.mode === \"build\";\n const { config } = project;\n const diagnostic = await missingDependencyDiagnostic(\n build\n ? config\n : { ...config, narration: { ...config.narration, provider: null } },\n project.context.root,\n build ? \"error\" : \"warning\",\n frameworks\n );\n if (!diagnostic) {\n return [];\n }\n if (build) {\n throw new BlumeError(diagnostic);\n }\n return [diagnosticWarning(diagnostic)];\n};\n\nexport interface GenerateResult {\n /** Whether any structural file changed (config/page/content config). */\n structuralChange: boolean;\n /** Non-fatal warnings raised while generating (e.g. a missing API spec). */\n warnings: string[];\n}\n\n/**\n * Statically analyze the user's `components.ts` (never executing it). Empty for\n * a project with no components file; throws `BLUME_COMPONENTS_INVALID` for an\n * override that isn't one of the accepted static forms.\n */\nexport const analyzeComponentsFile = async (\n componentsFile: string | null\n): Promise<ComponentOverrideAnalysis> =>\n componentsFile\n ? analyzeComponentOverrides(\n await readFile(componentsFile, \"utf-8\"),\n componentsFile\n )\n : emptyComponentOverrides();\n\n/** The OG endpoint fonts for a scanned project (see {@link resolveOgFonts}). */\nconst projectOgFonts = (project: BlumeProject): DerivedOgFonts =>\n resolveOgFonts(\n {\n locales: fontLocaleCodes(project.config.i18n),\n ogFonts: project.config.seo.og.fonts,\n themeFonts: project.config.theme.fonts,\n themeFontsConfigured: project.themeFontsConfigured,\n },\n project.context.root\n );\n\n/**\n * Fail generation when a configured local font file is missing. Warning and\n * continuing is not an option here — the path is emitted into the Astro\n * config and the OG endpoint, which would crash later with a bare ENOENT.\n */\nconst assertFontFilesExist = (project: BlumeProject): void => {\n const { config, context } = project;\n const missing = missingFontFiles(\n { ogFonts: config.seo.og.fonts ?? [], themeFonts: config.theme.fonts },\n context.root\n );\n if (missing.length > 0) {\n throw new BlumeError({\n code: \"BLUME_FONT_FILE_MISSING\",\n message: `Configured font file(s) not found: ${missing.join(\", \")}. Font paths resolve relative to the project root.`,\n severity: \"error\",\n });\n }\n};\n\n/**\n * The client libraries a site needs (see `featuresTemplate`): the EPUB\n * generator when `export.epub` is on, and the Mermaid element when any page's\n * source has a mermaid fence — read from the raw-Markdown mirrors (every\n * route's verbatim source) and, for sources that carry their text on the\n * page record, the record itself.\n */\nexport const clientFeaturesFrom = (\n project: BlumeProject,\n rawMarkdown: Record<string, RawMarkdownEntry>\n): ClientFeatures => ({\n epub: project.config.export.epub,\n mermaid:\n Object.values(rawMarkdown).some((entry) =>\n hasMermaidFence(entry.mdx ?? entry.md ?? \"\")\n ) ||\n project.graph.pages.some(\n (page) => page.body !== undefined && hasMermaidFence(page.body.text)\n ),\n});\n\n/**\n * The theme's code-block icon rules for the languages the site's Markdown\n * uses (see `languageIconCss`), read from the raw-Markdown mirrors and the\n * page records that carry their text.\n */\nexport const languageIconCssFrom = (\n project: BlumeProject,\n rawMarkdown: Record<string, RawMarkdownEntry>\n): string =>\n languageIconCss(\n languageIconSlugsIn(\n [\n ...Object.values(rawMarkdown).map(\n (entry) => entry.mdx ?? entry.md ?? \"\"\n ),\n ...project.graph.pages.map((page) => page.body?.text ?? \"\"),\n ].join(\"\\n\")\n )\n );\n\n/** {@link languageIconCssFrom} over a fresh read of the raw Markdown (eject). */\nexport const languageIconCssFor = async (\n project: BlumeProject\n): Promise<string> =>\n languageIconCssFrom(project, await buildRawMarkdown(project));\n\n/**\n * The deferred sidebar fragments page, only when some group is a disclosure\n * or a drill-in panel — a flat sidebar renders every row on every page, so\n * there is nothing to fetch. A previous pass's page is an orphan the\n * generator removes when the sidebar goes flat again.\n */\nconst writeNavFragments = (\n write: (path: string, content: string) => Promise<boolean>,\n srcDir: string,\n navFragments: boolean\n): Promise<boolean> =>\n navFragments\n ? write(\n join(\n srcDir,\n \"pages\",\n \"blume-nav\",\n \"[version]\",\n \"[locale]\",\n \"[id].astro\"\n ),\n navFragmentTemplate()\n )\n : Promise.resolve(false);\n\n/** {@link clientFeaturesFrom} over a fresh read of the raw Markdown (eject). */\nexport const clientFeaturesFor = async (\n project: BlumeProject\n): Promise<ClientFeatures> =>\n clientFeaturesFrom(project, await buildRawMarkdown(project));\n\n/**\n * Write (or update) the generated `.blume/` Astro runtime for a project.\n * Only files whose content changed are rewritten so Vite HMR stays fast.\n */\nexport const generateRuntime = async (\n project: BlumeProject\n): Promise<GenerateResult> => {\n const { context, config } = project;\n assertFontFilesExist(project);\n const out = context.outDir;\n const srcDir = join(out, \"src\");\n const generatedDir = join(srcDir, \"generated\");\n const askPath = join(srcDir, \"generated\", \"Ask.astro\");\n const themePath = join(srcDir, \"generated\", \"app.css\");\n const searchClientPath = join(srcDir, \"generated\", \"search-client.ts\");\n const consentClientPath = join(srcDir, \"generated\", \"consent-client.ts\");\n const featuresPath = join(srcDir, \"generated\", \"features.ts\");\n const examplesPath = join(srcDir, \"generated\", \"examples.ts\");\n const examplesThemePath = join(srcDir, \"generated\", \"examples.css\");\n\n // Record every file this pass writes so orphans (from a now-disabled feature)\n // can be pruned afterwards. `write` wraps the atomic writer and tracks paths.\n const written = new Set<string>();\n const write = (path: string, content: string): Promise<boolean> => {\n written.add(normalize(path));\n return writeIfChanged(path, content);\n };\n // The data snapshots the generated pages import (`blume:data`, the search\n // index, …) are collected here and published in memory at the end of the\n // pass — see `runtime-modules.ts`. An id a feature leaves unset is\n // unpublished, the in-memory counterpart of `pruneOrphans`.\n const modules: RuntimeModules = new Map();\n\n const depsLinkWarning = await ensureDepsLink(out);\n\n // The dev negotiation inputs. Published in memory (below) rather than baked\n // into the generated config, so a content-route change never rewrites\n // `astro.config.mjs` — which would restart the dev server in place.\n const contentRoutes = markdownRoutePaths(project);\n const homeLinkHeader =\n buildHomeLinkHeader(config, contentRoutes, \"dev\") ?? undefined;\n\n const assistantEnabled = config.ai.assistant?.enabled ?? false;\n const exportPdf = config.export.pdf;\n const exportEpub = config.export.epub;\n // Every route's source Markdown: published as `blume:raw-markdown` below,\n // and inspected here for the client features the site needs.\n const rawMarkdown = await buildRawMarkdown(project);\n const clientFeatures = clientFeaturesFrom(project, rawMarkdown);\n const navFragments = navVariants(project.graph).some(({ navigation }) =>\n hasDeferrableGroups(navigation.sidebar)\n );\n const languageIcons = languageIconCssFrom(project, rawMarkdown);\n // Staged (non-filesystem) sources materialize into `.blume/content`; keyed by\n // entryId so i18n duplicates of one entry write a single file. Collected here\n // so math detection also sees staged bodies (they never live under root).\n const staged = collectStaged(project);\n // Statically analyze `components.ts` overrides (never executed): drives\n // hydration on layout/mdx overrides, string-path resolution, and the\n // \"framework component with no client mode\" diagnostic. Independent of the\n // discovery reads, so it joins the same parallel batch.\n const [\n pages,\n detectedReact,\n usesMath,\n userTheme,\n userExamplesCss,\n integrationBridge,\n islandDiscovery,\n exampleDiscovery,\n overrideAnalysis,\n ] = await Promise.all([\n context.pagesRoot ? discoverPages(context.pagesRoot) : Promise.resolve([]),\n detectNeedsReact(context.root),\n detectUsesMath(context.root, staged.values()),\n readUserCss(context.themeFile, generatedDir),\n readUserCss(examplesCssFile(context.root, config), generatedDir),\n loadIntegrationBridge(config, context),\n discoverIslands(context.root),\n discoverExamples(context.root, config.examples.source),\n analyzeComponentsFile(context.componentsFile),\n ]);\n // The `islands/` convention and `components.ts` share one static plan: every\n // entry is imported by path, hydrated ones through a generated wrapper.\n const slotPlan = planComponentSlots(\n islandDiscovery.islands,\n overrideAnalysis\n );\n const overrideWarnings = overrideAnalysis.warnings;\n // Expose the discovered examples for agent-facing Markdown downleveling\n // (`<Component>` → source) before any consumer (raw `.md`, MCP, llms) runs.\n project.examples = exampleMarkdownLookup(exampleDiscovery.examples);\n\n // Each island/example framework enables its Astro renderer. React also\n // switches on for any project `.tsx`/`.jsx` and for the assistant; Vue/Svelte are\n // island/example-driven. `.astro` examples need no renderer. Component\n // overrides referencing a framework component enable its renderer too.\n const frameworks = new Set<string>([\n ...islandDiscovery.islands.map((island) => island.framework),\n ...exampleDiscovery.examples.map((example) => example.framework),\n ...slotPlan.frameworks,\n ]);\n const dependencyWarnings = await dependencyPreflight(project, frameworks);\n const needsReact =\n detectedReact || assistantEnabled || frameworks.has(\"react\");\n const needsVue = frameworks.has(\"vue\");\n const needsSvelte = frameworks.has(\"svelte\");\n\n // Whether react() turns the React Compiler on (false when off). Checked here,\n // Node-side, so an unresolvable compiler degrades to an uncompiled build\n // instead of failing it — see resolveReactCompiler. Any\n // unresolved-but-requested warning is folded into `warnings` below (declared\n // later).\n const reactCompiler = resolveReactCompiler(config, needsReact);\n\n // Custom pages that should get a generated OG card (the home most of all).\n // Computed before the MCP `.well-known` routes are appended below — those are\n // private and filtered out anyway, but the intent is the user's pages.\n const ogRoutes = customOgRoutes(pages, config.title, config.seo.og.titles);\n\n // Whether the generated `/changelog` index exists — shared by the OG endpoint\n // (which adds the index's own card) and the page write below. Computed here,\n // before the MCP discovery pages are appended, on the user's own pages.\n const changelogIndex = hasGeneratedChangelog(project, pages);\n\n // The hosted MCP server. The `.well-known` discovery docs are injected as\n // prerendered routes alongside user pages; the server endpoint itself is a\n // normal (server-rendered) page written by `writeMcpFiles`.\n const mcp = planMcp(project, srcDir, pages);\n pages.push(...mcp.discoveryPages);\n\n // The JSON docs API shares the MCP server's snapshot; build it once when\n // either is on.\n const api = planApi(project, srcDir, pages);\n const agentData = await publishAgentData(project, { api, mcp }, modules);\n\n // The parsed OpenAPI specs behind the `blume:openapi` alias, also the source\n // of the proxy's origin allowlist below. The source parsed them during the\n // scan, so reading them here is free.\n const openApiSource = project.sources.find(isOpenApiSource);\n const openApiData = openApiSource ? openApiSource.openApiData() : {};\n\n // The playground's built-in CORS proxy rides the same injection path as the\n // MCP discovery docs; the endpoint itself opts out of prerendering.\n const playgroundProxy = planPlaygroundProxy(config, srcDir);\n if (playgroundProxy.enabled) {\n pages.push({\n entrypoint: playgroundProxy.entrypoint,\n pattern: playgroundProxy.pattern,\n });\n }\n // Computed once: the endpoint template bakes it in below. A spec that\n // contributes no origin of its own gets a per-spec diagnostic\n // (`proxyAllowlistWarnings`) — the proxy would refuse its every send.\n const proxyOrigins = [\n ...new Set([...specOrigins(openApiData), ...apiPageOrigins(project)]),\n ].toSorted();\n\n const hasStaged = staged.size > 0;\n // Only emit a project-scanning `docs` collection when a filesystem source\n // actually feeds it. An all-staged project (openapi/notion/…) has only staged\n // sources, so the `docs` glob would otherwise scan (and watch) the whole\n // project root for nothing — see contentConfigTemplate.\n const hasFilesystemSource = project.sources.some((source) => !source.staged);\n const docsCollection = resolveDocsCollection(config, context.root);\n\n // All of these write to distinct generated paths and never read one another's\n // output, so the structural files, the per-convention hydration wrappers, and\n // the Ask/MCP writers all run in one parallel batch. Only the structural\n // writes' change flags feed `structuralChange`, so they stay a nested group.\n const [structural] = await Promise.all([\n Promise.all([\n write(\n join(out, \"astro.config.mjs\"),\n astroConfigTemplate({\n aliases: resolveTsconfigAliases(context.root),\n askPath,\n config,\n consentClientPath,\n contentRoot: docsCollection.base,\n contentRoutes,\n context,\n examplesPath,\n examplesThemePath,\n features: clientFeatures,\n featuresPath,\n integrationBridge,\n needsReact,\n needsSvelte,\n needsVue,\n pages,\n reactCompiler,\n searchClientPath,\n themePath,\n })\n ),\n write(\n join(out, \"package.json\"),\n runtimePackageTemplate(\n runtimeDependencies({ config, needsReact, needsSvelte, needsVue })\n )\n ),\n write(join(out, \"tsconfig.json\"), runtimeTsconfigTemplate()),\n write(\n join(srcDir, \"content.config.ts\"),\n contentConfigTemplate({\n collection: docsCollection,\n config,\n context,\n filesystem: hasFilesystemSource,\n staged: hasStaged,\n unparsable: project.unparsable,\n })\n ),\n write(\n join(srcDir, \"pages\", \"[...slug].astro\"),\n catchAllPageTemplate({\n exportEpub,\n exportPdf,\n mathEnabled: usesMath,\n navFragments,\n needsReact,\n })\n ),\n writeNavFragments(write, srcDir, navFragments),\n // The header's Ask trigger, behind the `blume:ask` alias. Always written\n // (even when Ask is off, as a component that renders nothing) so the alias\n // resolves — the same contract as `blume:search-client`.\n write(askPath, askComponentTemplate(assistantEnabled)),\n write(join(srcDir, \"generated\", \"components.ts\"), slotPlan.module),\n write(\n join(srcDir, \"generated\", \"examples.ts\"),\n exampleMapTemplate(exampleDiscovery.examples, config.basePath)\n ),\n // The isolated Tailwind entry for `<Component />` preview frames: only\n // the project (and an out-of-root examples directory) is scanned, so the\n // docs theme never reaches a preview. Anything further afield — a sibling\n // package the examples import — is the user's `@source` in examples.css.\n write(\n examplesThemePath,\n examplesEntryTemplate({\n configTokens: buildThemeCss(config.theme),\n sources: exampleScanRoots(context.root, exampleDiscovery.dir).map(\n (dir) => `${dir}/${EXAMPLE_SCAN_GLOB}`\n ),\n userCss: userExamplesCss,\n })\n ),\n write(\n themePath,\n tailwindEntryTemplate({\n configTokens: `${buildThemeCss(config.theme)}${buildFontsCss(config.theme.fonts)}`,\n languageIcons,\n sources: [\n `${BLUME_SRC}/**/*.{astro,ts,tsx}`,\n `${context.root}/**/*.{astro,jsx,mdx,ts,tsx}`,\n ],\n twoslashCss: twoslashCss(),\n userTheme,\n })\n ),\n ]),\n // Per-override hydration wrappers for `islands/` convention components and\n // `client:*` layout/mdx overrides. The generated `components.ts` (written\n // above) imports these; orphans from removed overrides are pruned at the\n // end of the pass.\n Promise.all(\n slotPlan.wrappers.map((wrapper) =>\n write(\n join(srcDir, \"generated\", \"component-slots\", `${wrapper.name}.astro`),\n wrapper.content\n )\n )\n ),\n // Per-example live wrappers for the `examples/` convention, resolved by\n // `<Component path>` through the `examples.ts` map (written above, always).\n Promise.all(\n exampleDiscovery.examples.map((example) =>\n write(\n join(\n srcDir,\n \"generated\",\n \"examples\",\n `${exampleSlug(example.path)}.astro`\n ),\n exampleWrapperTemplate(example)\n )\n )\n ),\n writeAskFiles(project, srcDir, write, modules),\n writeMcpFiles(mcp, write, agentData),\n writeApiFiles(project, api, write, agentData, mcp),\n playgroundProxy.enabled\n ? write(\n playgroundProxy.entrypoint,\n playgroundProxyTemplate(proxyOrigins, config.rateLimit)\n )\n : Promise.resolve(false),\n ]);\n\n if (config.seo.og.enabled) {\n await write(\n join(srcDir, \"pages\", \"og\", \"[...slug].png.ts\"),\n ogEndpointTemplate(\n ogRoutes,\n {\n ...projectOgFonts(project),\n cache: {\n dir: ogCacheDir(project.context),\n version: getBlumeVersion(),\n },\n pageDescriptions: config.seo.og.description !== false,\n },\n changelogIndex\n )\n );\n }\n\n // Changelog index (`/changelog`): every release as a row, grouped by year.\n if (changelogIndex) {\n await write(\n join(srcDir, \"pages\", \"changelog.astro\"),\n changelogIndexTemplate({\n exportEpub,\n exportPdf,\n needsReact,\n })\n );\n }\n\n // Three independent writes: the per-example preview routes that\n // `<Component />` iframes embed (returning a warning when the configured\n // examples.css is missing), the default 404 page (`/404`, unless the project\n // already owns the route), and the provider-specific client loader behind\n // the `blume:search-client` alias — always (re)generated so the alias\n // resolves even when search is disabled.\n const [examplesWarnings] = await Promise.all([\n writeExamplesPreview({\n config,\n hasExamples: exampleDiscovery.examples.length > 0,\n root: context.root,\n srcDir,\n write,\n }),\n writeNotFoundPage(write, srcDir, pages, project.graph.pages),\n write(searchClientPath, searchClientTemplate(config)),\n write(consentClientPath, consentClientTemplate(config.consent)),\n write(featuresPath, featuresTemplate(clientFeatures)),\n ]);\n\n // Client-loaded adapters (orama, flexsearch) ship a static index + endpoint.\n const searchAdapter = config.search.provider;\n if (searchAdapter.mode === \"static\") {\n const documents = await buildSearchDocuments(project);\n modules.set(\"blume:search-index\", JSON.stringify(documents));\n await write(\n join(srcDir, \"pages\", \"blume-search.json.ts\"),\n searchEndpointTemplate()\n );\n }\n\n // Mixedbread proxies queries through a server endpoint that holds the key.\n if (searchAdapter.kind === \"mixedbread\") {\n await write(\n join(srcDir, \"pages\", \"api\", \"search.ts\"),\n mixedbreadSearchEndpointTemplate(\n searchAdapter.options,\n sourcePages(project),\n config.rateLimit\n )\n );\n }\n\n // The include graph (partial → including pages) behind `includeHmrPlugin`:\n // editing a partial invalidates every page that splices it. Written even\n // when empty so the plugin's configured path always resolves.\n await write(\n join(srcDir, \"generated\", \"includes.json\"),\n `${JSON.stringify(buildIncludeGraph(project.graph.pages))}\\n`\n );\n\n modules.set(\"blume:raw-markdown\", JSON.stringify(rawMarkdown));\n // The originals behind the rewritten `/blume-assets/content/…` references in\n // the agent-facing Markdown, plus the endpoint that serves them (and the\n // remote-source assets materialized under `.blume/public/blume-assets`).\n const contentAssets = await collectContentAssets(project);\n modules.set(\"blume:content-assets\", JSON.stringify(contentAssets));\n await Promise.all([\n write(\n join(srcDir, \"pages\", \"[...slug].md.ts\"),\n rawMarkdownEndpointTemplate(\"md\")\n ),\n write(\n join(srcDir, \"pages\", \"[...slug].mdx.ts\"),\n rawMarkdownEndpointTemplate(\"mdx\")\n ),\n write(\n join(srcDir, \"pages\", \"blume-assets\", \"[...asset].ts\"),\n contentAssetsEndpointTemplate(\n join(project.context.outDir, \"public\", \"blume-assets\")\n )\n ),\n ]);\n\n // Automatic RSS feeds for blog/changelog content types (a no-op when no such\n // pages exist or no deployment.site is configured).\n const feeds = buildRssFeeds(project);\n if (feeds.length > 0) {\n const feedXml = Object.fromEntries(\n feeds.map((feed) => [feed.type, renderRssFeed(feed)])\n );\n modules.set(\"blume:rss\", JSON.stringify(feedXml));\n await write(\n join(srcDir, \"pages\", \"[section]\", \"rss.xml.ts\"),\n rssEndpointTemplate()\n );\n }\n\n // `scalar()` reference pages. One self-contained page per source, mounted\n // on its configured route and regenerated each run.\n const warnings: string[] = [\n ...(depsLinkWarning ? [depsLinkWarning] : []),\n ...proxyAllowlistWarnings(config, openApiData),\n ...apiPageProxyWarnings(project),\n ...reactCompilerWarnings(config, needsReact, reactCompiler),\n ...mcp.warnings,\n ...islandDiscovery.warnings,\n ...exampleDiscovery.warnings,\n ...examplesWarnings,\n ...overrideWarnings,\n ];\n\n // Missing-navigation-target check, now that every servable route is known\n // (see `navTargetRoutes`).\n // Curated `search.popular` icons and custom MCP clients' icons live outside\n // the navigation model, so they miss `validateNavIcons` in the graph build —\n // they're checked here too, where their config is known. A typo otherwise\n // just renders the default glyph, or no icon at all.\n warnings.push(\n ...[\n ...validateNavTargets(\n project.graph.navigation,\n navTargetRoutes(project, pages),\n servedFiles(project)\n ),\n ...validateSearchPopularIcons(config.search.popular),\n ...(config.agents.mcp.enabled\n ? validateMcpClientIcons(\n config.agents.mcp.clients,\n config.i18n?.defaultLocale\n )\n : []),\n ].map(diagnosticWarning)\n );\n\n // Unknown-component check: a `<Tag>` in MDX that isn't a built-in, an island,\n // or a `components.ts` override. Needs the project's own components, known here.\n const knownComponentTags = new Set<string>([\n ...islandDiscovery.islands.map((island) => island.name),\n ...overrideAnalysis.mdx.map((entry) => entry.key),\n ]);\n warnings.push(\n ...validateUsedComponents(\n project.graph.pages,\n knownComponentTags,\n new Set(registry.map((item) => item.name))\n ).map(diagnosticWarning),\n ...missingExampleDiagnostics(\n project.graph.pages,\n exampleDiscovery,\n context.root,\n knownComponentTags\n ).map(diagnosticWarning),\n // Printed whole, like a scan diagnostic, so the line it names shows.\n ...unknownPropDiagnostics(project.graph.pages, knownComponentTags).map(\n (diagnostic) =>\n formatDiagnostic(enrichDiagnostic(diagnostic), context.root)\n ),\n ...dependencyWarnings\n );\n if (hasScalarReferences(config)) {\n const references = await buildReferenceFiles({\n config,\n contentRoutes: new Set(project.graph.pages.map((page) => page.route)),\n root: context.root,\n });\n warnings.push(...references.warnings);\n await Promise.all(\n references.files.map((file) =>\n write(join(srcDir, \"pages\", file.pagePath), file.content)\n )\n );\n }\n\n // `blume:openapi` is always published — even as `{}` — so the import resolves\n // whether or not a reference is enabled; the specs were parsed during the\n // scan, so this is just serialization. `blume:data` is the page data every\n // layout reads. Neither is \"structural\" for Astro; publishing hot-reloads.\n modules.set(\"blume:data\", buildRuntimeData(project));\n modules.set(\"blume:openapi\", JSON.stringify(openApiData));\n // These write to distinct trees and never read one another, so they batch.\n // `writeStagedContent` owns the `.blume/content` tree (its own pruning),\n // outside `.blume/src`, so a removed remote entry doesn't linger.\n await Promise.all([\n write(\n join(out, \"blume.manifest.json\"),\n `${JSON.stringify(project.manifest, null, 2)}\\n`\n ),\n writeStagedContent(out, staged),\n ]);\n\n // Remove anything under `.blume/src` this pass didn't write — e.g. an assistant\n // endpoint left behind after the feature was switched off.\n await pruneOrphans(srcDir, written);\n\n // Publish last, once every page that imports a module is on disk: a live\n // dev server invalidates the changed modules and reloads the browser against\n // the finished tree, never a half-written one.\n publishDevNegotiation({ contentRoutes, homeLinkHeader });\n publishRuntimeModules(modules);\n\n return { structuralChange: structural.some(Boolean), warnings };\n};\n",
13
13
  "/**\n * RFC 9457 problem details — the one error shape every Blume JSON endpoint\n * returns, so an agent that hits a missing page, a bad query, or an unknown\n * API route always gets a stable machine-readable `code`, a human-readable\n * `detail`, and a `resolution` telling it where to go next.\n */\n\nexport const PROBLEM_TYPE = \"application/problem+json\";\n\n/** A recovery link carried on a problem (the 404's \"where to look next\"). */\nexport interface ProblemLink {\n href: string;\n label: string;\n}\n\nexport interface Problem {\n /** Stable, screaming-snake error code for programmatic handling. */\n code: string;\n /** Human-readable explanation specific to this occurrence. */\n detail: string;\n /** The request path the problem occurred on, when known. */\n instance?: string;\n /** Recovery links, when the problem has somewhere useful to send the caller. */\n links?: ProblemLink[];\n /** What to do next — the hint agents act on. */\n resolution: string;\n status: number;\n title: string;\n /** Problem type URI; `about:blank` when the status code says it all. */\n type: string;\n}\n\n/** The problem's members, with `type` defaulting to `about:blank`. */\nexport const problem = (\n input: Omit<Problem, \"type\"> & { type?: string }\n): Problem => {\n const body: Problem = {\n code: input.code,\n detail: input.detail,\n resolution: input.resolution,\n status: input.status,\n title: input.title,\n type: input.type ?? \"about:blank\",\n };\n if (input.instance !== undefined) {\n body.instance = input.instance;\n }\n if (input.links !== undefined) {\n body.links = input.links;\n }\n return body;\n};\n\n/** A `Response` carrying the problem as `application/problem+json`. */\nexport const problemResponse = (\n input: Omit<Problem, \"type\"> & { type?: string }\n): Response => {\n const body = problem(input);\n return new Response(`${JSON.stringify(body, null, 2)}\\n`, {\n headers: { \"Content-Type\": `${PROBLEM_TYPE}; charset=utf-8` },\n status: body.status,\n });\n};\n",
14
14
  "import { apiNamePhrase } from \"../../core/api-name.ts\";\nimport { mountBasePath } from \"../../core/base-path.ts\";\nimport { absoluteUrl, siteRoot } from \"../../core/site-url.ts\";\nimport {\n API_NAVIGATION_PATH,\n API_PAGE_PATH,\n API_PAGES_PATH,\n API_SEARCH_PATH,\n} from \"./paths.ts\";\nimport { PROBLEM_TYPE } from \"./problem.ts\";\n\n/**\n * The OpenAPI 3.1 description of a Blume site's machine-readable surface,\n * served at `/openapi.json`. It documents the JSON docs API (`/api/docs/…`)\n * in full — one `operationId` and description per operation, typed\n * parameters, response schemas, and the RFC 9457 problem shape every error\n * uses — and lists the text surfaces alongside (the `.md` mirrors, `llms.txt`,\n * `llms-full.txt`, `agent-readability.json`) plus the MCP endpoint, so a\n * function-calling framework that ingests OpenAPI gets the same reach an MCP\n * client has. Generated per build from config, so it only describes what the\n * deployed site actually serves.\n */\n\n/** What the document needs to know about the site. */\nexport interface ApiSpecInput {\n /** Whether `agent-readability.json` is published. */\n agentReadability: boolean;\n /** Normalized `deployment.base` (`\"\"` or `/seg`). */\n base: string;\n description?: string;\n /** Whether `llms.txt`/`llms-full.txt` are published. */\n llmsTxt: boolean;\n /** The MCP server's route, or null when the server is off. */\n mcpRoute: string | null;\n name: string;\n /** Whether the live search endpoint exists (server output only). */\n search: boolean;\n site: string | null;\n /** The generating Blume version — the API contract's version. */\n version: string;\n}\n\n/** A schema reference into `components.schemas`. */\ninterface SchemaRef {\n $ref: string;\n}\n\n/** An inline schema, as the text and generic-object responses use. */\ninterface InlineSchema {\n type: string;\n}\n\ninterface MediaType {\n schema: InlineSchema | SchemaRef;\n}\n\n/** A response object: its description and the media types it may carry. */\ninterface ResponseObject {\n content?: Record<string, MediaType>;\n description: string;\n}\n\n/** A parameter object, as this builder emits it. */\ninterface Parameter {\n description: string;\n explode?: boolean;\n in: \"path\" | \"query\";\n name: string;\n required: boolean;\n schema: object;\n style?: \"deepObject\" | \"form\";\n}\n\n/** An operation object, as this builder emits it. */\nexport interface Operation {\n description: string;\n operationId: string;\n parameters?: Parameter[];\n requestBody?: { content: Record<string, MediaType>; required: boolean };\n responses: Record<string, ResponseObject>;\n summary: string;\n tags: string[];\n}\n\n/** A path item: the HTTP methods this builder emits. */\nexport interface PathItem {\n get?: Operation;\n post?: Operation;\n}\n\ninterface Tag {\n description: string;\n name: string;\n}\n\ninterface Info {\n description: string;\n title: string;\n version: string;\n \"x-generator\": string;\n}\n\n/** The OpenAPI document, as this builder emits it. */\nexport interface ApiSpecDocument {\n components: { schemas: typeof schemas };\n externalDocs?: { description: string; url: string };\n info: Info;\n openapi: \"3.1.0\";\n paths: Record<string, PathItem>;\n security: never[];\n servers: { description: string; url: string }[];\n tags: Tag[];\n}\n\nconst JSON_TYPE = \"application/json\";\nconst EVENT_STREAM_TYPE = \"text/event-stream\";\nconst MARKDOWN_TYPE = \"text/markdown\";\nconst TEXT_TYPE = \"text/plain\";\n\nconst ref = (name: string): SchemaRef => ({\n $ref: `#/components/schemas/${name}`,\n});\n\nconst jsonResponse = (description: string, schema: string): ResponseObject => ({\n content: { [JSON_TYPE]: { schema: ref(schema) } },\n description,\n});\n\nconst problemResponse = (description: string): ResponseObject => ({\n content: { [PROBLEM_TYPE]: { schema: ref(\"Problem\") } },\n description,\n});\n\nconst textResponse = (description: string, type: string): ResponseObject => ({\n content: { [type]: { schema: { type: \"string\" } } },\n description,\n});\n\nconst string = (description: string) => ({ description, type: \"string\" });\n\nconst facetsSchema = {\n additionalProperties: { type: \"string\" },\n description:\n \"Facet values the site declares for the page's content type (`content.types.<type>.facets`), key → value.\",\n type: \"object\",\n};\n\nconst versionProperty = {\n description:\n 'Docs version the page belongs to on a versioned site: `\"\"` for the current docs, else an archived version id. Absent on unversioned sites.',\n type: \"string\",\n};\n\n/** The shared filter parameters of the search operation. */\nconst searchParameters: Parameter[] = [\n {\n description: \"The search query.\",\n in: \"query\",\n name: \"q\",\n required: true,\n schema: { minLength: 1, type: \"string\" },\n },\n {\n description: \"Maximum hits to return (default 8, at most 20).\",\n in: \"query\",\n name: \"limit\",\n required: false,\n schema: { default: 8, maximum: 20, minimum: 1, type: \"integer\" },\n },\n {\n description:\n \"Only include pages of these content types (frontmatter `type`, e.g. `doc`, `rfc`). Comma-separated or repeated. Omit for every type.\",\n explode: false,\n in: \"query\",\n name: \"contentTypes\",\n required: false,\n schema: { items: { type: \"string\" }, type: \"array\" },\n style: \"form\",\n },\n {\n description:\n \"Only include pages in this locale (e.g. `fr`). Omit for every language.\",\n in: \"query\",\n name: \"locale\",\n required: false,\n schema: { type: \"string\" },\n },\n {\n description:\n \"Docs version to scope to on a versioned site: `latest` (the default — current docs only), `all`, or an archived version id. Ignored when the site is unversioned.\",\n in: \"query\",\n name: \"version\",\n required: false,\n schema: { type: \"string\" },\n },\n {\n description:\n \"Only include pages matching every facet, as `filters[key]=value` pairs (e.g. `filters[status]=enforced`). Facets are metadata the site declares per content type; the page index shows each page's values.\",\n explode: true,\n in: \"query\",\n name: \"filters\",\n required: false,\n schema: { additionalProperties: { type: \"string\" }, type: \"object\" },\n style: \"deepObject\",\n },\n];\n\nconst schemas = {\n JsonRpcRequest: {\n description: \"A JSON-RPC 2.0 request, as the Model Context Protocol sends.\",\n properties: {\n id: { description: \"Request id (absent on notifications).\" },\n jsonrpc: { const: \"2.0\", type: \"string\" },\n method: string(\"The MCP method, e.g. `initialize` or `tools/call`.\"),\n params: { description: \"Method parameters.\", type: \"object\" },\n },\n required: [\"jsonrpc\", \"method\"],\n type: \"object\",\n },\n JsonRpcResponse: {\n description: \"A JSON-RPC 2.0 response: a `result` or an `error`.\",\n properties: {\n error: {\n properties: {\n code: { type: \"integer\" },\n data: {},\n message: { type: \"string\" },\n },\n required: [\"code\", \"message\"],\n type: \"object\",\n },\n id: {},\n jsonrpc: { const: \"2.0\", type: \"string\" },\n result: { type: \"object\" },\n },\n required: [\"jsonrpc\"],\n type: \"object\",\n },\n NavLink: {\n properties: {\n href: string(\"Link target — an internal route or an external URL.\"),\n icon: string(\"Optional icon name.\"),\n label: { type: \"string\" },\n },\n required: [\"href\", \"label\"],\n type: \"object\",\n },\n NavNode: {\n description:\n \"A sidebar entry: a page (linking to its route) or a group holding further nodes.\",\n oneOf: [\n {\n properties: {\n badge: { type: \"string\" },\n deprecated: { type: \"boolean\" },\n description: { type: \"string\" },\n icon: { type: \"string\" },\n kind: { const: \"page\", type: \"string\" },\n label: { type: \"string\" },\n pageId: string(\"The page's stable content id.\"),\n route: string(\"The page's route.\"),\n },\n required: [\"kind\", \"label\", \"pageId\", \"route\"],\n type: \"object\",\n },\n {\n properties: {\n badge: { type: \"string\" },\n children: { items: ref(\"NavNode\"), type: \"array\" },\n collapsed: { type: \"boolean\" },\n icon: { type: \"string\" },\n kind: { const: \"group\", type: \"string\" },\n label: { type: \"string\" },\n path: string(\"The group's route prefix (not necessarily a page).\"),\n route: string(\"The group's index page route, when it has one.\"),\n },\n required: [\"children\", \"kind\", \"label\"],\n type: \"object\",\n },\n ],\n },\n NavSelector: {\n description:\n \"A top-level partition selector (products, versions, languages).\",\n properties: {\n items: {\n items: {\n properties: {\n description: { type: \"string\" },\n label: { type: \"string\" },\n path: { type: \"string\" },\n tag: { type: \"string\" },\n },\n required: [\"label\", \"path\"],\n type: \"object\",\n },\n type: \"array\",\n },\n kind: { type: \"string\" },\n label: { type: \"string\" },\n },\n required: [\"items\", \"kind\", \"label\"],\n type: \"object\",\n },\n NavTab: {\n properties: {\n href: string(\n \"The clickable target when it differs from `path` (the section's first page).\"\n ),\n icon: { type: \"string\" },\n label: { type: \"string\" },\n path: string(\"The tab's section prefix.\"),\n },\n required: [\"label\", \"path\"],\n type: \"object\",\n },\n Navigation: {\n description:\n \"The docs navigation model: header tabs, the sidebar tree, partition selectors, and pinned links.\",\n properties: {\n actions: { items: ref(\"NavLink\"), type: \"array\" },\n cta: { oneOf: [ref(\"NavLink\"), { type: \"null\" }] },\n featured: { items: ref(\"NavLink\"), type: \"array\" },\n repoUrl: { type: [\"string\", \"null\"] },\n root: string(\"The tree root's route (`/`, or a locale/version prefix).\"),\n selectors: { items: ref(\"NavSelector\"), type: \"array\" },\n sidebar: { items: ref(\"NavNode\"), type: \"array\" },\n tabs: { items: ref(\"NavTab\"), type: \"array\" },\n },\n required: [\"featured\", \"selectors\", \"sidebar\", \"tabs\"],\n type: \"object\",\n },\n Page: {\n allOf: [\n ref(\"PageSummary\"),\n {\n properties: {\n markdown: string(\n \"The page as agent Markdown: frontmatter included, components downleveled to plain Markdown.\"\n ),\n },\n required: [\"markdown\"],\n type: \"object\",\n },\n ],\n description: \"A page's index entry plus its full Markdown body.\",\n },\n PageSummary: {\n properties: {\n contentType: string(\"The page's content type (frontmatter `type`).\"),\n description: { type: \"string\" },\n facets: facetsSchema,\n json: {\n description:\n \"This page's JSON representation (the `getPage` operation).\",\n format: \"uri-reference\",\n type: \"string\",\n },\n lastModified: {\n description: \"ISO 8601 last-modified date, when known.\",\n type: [\"string\", \"null\"],\n },\n locale: string(\"The page's locale code.\"),\n markdownUrl: {\n description:\n \"The page's raw-Markdown mirror (the `getPageMarkdown` operation).\",\n format: \"uri-reference\",\n type: \"string\",\n },\n route: string(\n \"The page's route (`/guides/install`); the key every other operation takes.\"\n ),\n title: { type: \"string\" },\n url: {\n description: \"Where the rendered page is served.\",\n format: \"uri-reference\",\n type: \"string\",\n },\n version: versionProperty,\n },\n required: [\n \"contentType\",\n \"json\",\n \"lastModified\",\n \"locale\",\n \"markdownUrl\",\n \"route\",\n \"title\",\n \"url\",\n ],\n type: \"object\",\n },\n PagesIndex: {\n properties: {\n count: { type: \"integer\" },\n generator: string(\"The Blume version that built the site.\"),\n pages: { items: ref(\"PageSummary\"), type: \"array\" },\n site: { type: [\"string\", \"null\"] },\n },\n required: [\"count\", \"generator\", \"pages\", \"site\"],\n type: \"object\",\n },\n Problem: {\n description:\n \"RFC 9457 problem details, with a stable code and a resolution hint.\",\n properties: {\n code: string(\"Stable error code (e.g. `PAGE_NOT_FOUND`).\"),\n detail: string(\"Human-readable explanation of this occurrence.\"),\n instance: string(\"The request path the problem occurred on.\"),\n links: {\n description: \"Recovery links, when there is somewhere useful to go.\",\n items: {\n properties: { href: { type: \"string\" }, label: { type: \"string\" } },\n required: [\"href\", \"label\"],\n type: \"object\",\n },\n type: \"array\",\n },\n resolution: string(\"What to do next.\"),\n status: { type: \"integer\" },\n title: { type: \"string\" },\n type: string(\"Problem type URI; `about:blank` by default.\"),\n },\n required: [\"code\", \"detail\", \"resolution\", \"status\", \"title\", \"type\"],\n type: \"object\",\n },\n SearchHit: {\n properties: {\n contentType: { type: \"string\" },\n excerpt: string(\"The page description, else the start of its content.\"),\n facets: facetsSchema,\n route: string(\"The page's route; pass it to `getPage`.\"),\n title: { type: \"string\" },\n url: { format: \"uri-reference\", type: \"string\" },\n version: versionProperty,\n },\n required: [\"excerpt\", \"route\", \"title\", \"url\"],\n type: \"object\",\n },\n SearchResponse: {\n properties: {\n count: { type: \"integer\" },\n query: { type: \"string\" },\n results: { items: ref(\"SearchHit\"), type: \"array\" },\n },\n required: [\"count\", \"query\", \"results\"],\n type: \"object\",\n },\n};\n\nconst ROUTE_PARAM: Parameter = {\n description:\n \"The page route without its leading slash (`guides/install`), or `index` for the home page. May contain slashes.\",\n in: \"path\",\n name: \"route\",\n required: true,\n schema: { type: \"string\" },\n};\n\n/** The document's `servers[0].url`: the site origin plus base, or the base. */\nconst serverUrl = (input: ApiSpecInput): string => {\n if (input.site) {\n return input.base\n ? absoluteUrl(input.site, input.base)\n : siteRoot(input.site);\n }\n return input.base || \"/\";\n};\n\n/** Build the OpenAPI document. Plain data, ready to serialize. */\nexport const buildApiSpec = (input: ApiSpecInput): ApiSpecDocument => {\n const pathEntries: [string, PathItem][] = [\n [\n API_PAGES_PATH,\n {\n get: {\n description:\n \"Every documentation page with its route, title, description, content type, locale, facets, and the URLs of its rendered, Markdown, and JSON forms. Unfiltered; on a versioned site every version is listed with its `version`. Use it to enumerate the docs or to find a page when search is too narrow.\",\n operationId: \"listPages\",\n responses: {\n \"200\": jsonResponse(\"The page index.\", \"PagesIndex\"),\n default: problemResponse(\"An error, as problem details.\"),\n },\n summary: \"List every page\",\n tags: [\"Pages\"],\n },\n },\n ],\n [\n API_PAGE_PATH,\n {\n get: {\n description:\n \"A single page as JSON: its index entry plus the page's agent Markdown (frontmatter included, components downleveled to plain Markdown). Take `route` from `listPages` or `searchDocs`.\",\n operationId: \"getPage\",\n parameters: [ROUTE_PARAM],\n responses: {\n \"200\": jsonResponse(\"The page.\", \"Page\"),\n \"404\": problemResponse(\"No page has that route.\"),\n default: problemResponse(\"An error, as problem details.\"),\n },\n summary: \"Get a page as JSON\",\n tags: [\"Pages\"],\n },\n },\n ],\n [\n API_NAVIGATION_PATH,\n {\n get: {\n description:\n \"The navigation tree (header tabs and the sidebar hierarchy) as readers see it, for the default locale and the current docs.\",\n operationId: \"getNavigation\",\n responses: {\n \"200\": jsonResponse(\"The navigation tree.\", \"Navigation\"),\n default: problemResponse(\"An error, as problem details.\"),\n },\n summary: \"Get the navigation tree\",\n tags: [\"Navigation\"],\n },\n },\n ],\n ];\n if (input.search) {\n pathEntries.push([\n API_SEARCH_PATH,\n {\n get: {\n description:\n \"Full-text search across the documentation. Returns matching pages with their title, route, content type, and a short excerpt; narrow by content type, locale, version, or facet. Use it first to discover relevant pages, then `getPage` to read one in full.\",\n operationId: \"searchDocs\",\n parameters: searchParameters,\n responses: {\n \"200\": jsonResponse(\n \"The matching pages, best first.\",\n \"SearchResponse\"\n ),\n \"400\": problemResponse(\"The query was missing or blank.\"),\n default: problemResponse(\"An error, as problem details.\"),\n },\n summary: \"Search the docs\",\n tags: [\"Search\"],\n },\n },\n ]);\n }\n pathEntries.push([\n \"/{route}.md\",\n {\n get: {\n description:\n \"A page's raw-Markdown mirror: append `.md` to any page URL. Components are downleveled to plain Markdown; `.mdx` serves the source as written. The same body the `getPage` operation carries in its `markdown` field.\",\n operationId: \"getPageMarkdown\",\n parameters: [ROUTE_PARAM],\n responses: {\n \"200\": textResponse(\"The page as Markdown.\", MARKDOWN_TYPE),\n \"404\": textResponse(\n \"No page has that route; the body lists where to look next.\",\n MARKDOWN_TYPE\n ),\n },\n summary: \"Get a page as Markdown\",\n tags: [\"Markdown\"],\n },\n },\n ]);\n if (input.llmsTxt) {\n pathEntries.push(\n [\n \"/llms.txt\",\n {\n get: {\n description:\n \"The llms.txt index: the site's summary, when to use it, and every page with a one-line description, grouped by section.\",\n operationId: \"getLlmsTxt\",\n responses: {\n \"200\": textResponse(\"The index.\", TEXT_TYPE),\n },\n summary: \"Get llms.txt\",\n tags: [\"Markdown\"],\n },\n },\n ],\n [\n \"/llms-full.txt\",\n {\n get: {\n description:\n \"The full Markdown of every current-docs page in one file.\",\n operationId: \"getLlmsFullTxt\",\n responses: {\n \"200\": textResponse(\"Every page's Markdown.\", TEXT_TYPE),\n },\n summary: \"Get llms-full.txt\",\n tags: [\"Markdown\"],\n },\n },\n ]\n );\n }\n if (input.agentReadability) {\n pathEntries.push([\n \"/agent-readability.json\",\n {\n get: {\n description:\n \"A manifest indexing every agent-facing artifact the site publishes — this API, the Markdown mirrors, llms.txt, the MCP server, feeds, and the sitemap.\",\n operationId: \"getAgentReadability\",\n responses: {\n \"200\": {\n content: { [JSON_TYPE]: { schema: { type: \"object\" } } },\n description: \"The manifest.\",\n },\n },\n summary: \"Get the agent-readability manifest\",\n tags: [\"Discovery\"],\n },\n },\n ]);\n }\n if (input.mcpRoute) {\n pathEntries.push([\n input.mcpRoute,\n {\n post: {\n description:\n \"The Model Context Protocol server (Streamable HTTP, stateless, JSON responses). Send `Accept: application/json, text/event-stream`: the Streamable HTTP transport requires a client to accept both and answers `406` otherwise, though this server always replies with JSON. Tools: `search_docs`, `get_page`, `list_pages`, `get_navigation` — the same operations this API exposes — plus every page as a `text/markdown` resource. Discovery document at `/.well-known/mcp.json`.\",\n operationId: \"mcp\",\n requestBody: {\n content: { [JSON_TYPE]: { schema: ref(\"JsonRpcRequest\") } },\n required: true,\n },\n responses: {\n // Both media types, so a generated client sends the Accept header\n // the transport requires; OpenAPI ignores an `Accept` parameter.\n \"200\": {\n content: {\n [JSON_TYPE]: { schema: ref(\"JsonRpcResponse\") },\n [EVENT_STREAM_TYPE]: { schema: { type: \"string\" } },\n },\n description: \"The JSON-RPC response.\",\n },\n \"406\": jsonResponse(\n \"The request's `Accept` header doesn't list both `application/json` and `text/event-stream`.\",\n \"JsonRpcResponse\"\n ),\n },\n summary: \"Call the MCP server\",\n tags: [\"MCP\"],\n },\n },\n ]);\n }\n\n const tags: Tag[] = [\n { description: \"Enumerate and read documentation pages.\", name: \"Pages\" },\n ...(input.search\n ? [{ description: \"Full-text search over the docs.\", name: \"Search\" }]\n : []),\n { description: \"How the docs are organized.\", name: \"Navigation\" },\n { description: \"Plain-text and Markdown surfaces.\", name: \"Markdown\" },\n ...(input.agentReadability\n ? [{ description: \"Agent discovery documents.\", name: \"Discovery\" }]\n : []),\n ...(input.mcpRoute\n ? [{ description: \"The Model Context Protocol endpoint.\", name: \"MCP\" }]\n : []),\n ];\n\n const info: Info = {\n description: [\n `Read-only JSON API over the ${input.name} documentation${input.description ? `: ${input.description}` : \".\"}`,\n \"Every operation is public and needs no authentication. Errors are RFC 9457 problem details (`application/problem+json`) with a stable `code`, a `detail`, and a `resolution` hint.\",\n ].join(\"\\n\\n\"),\n title: apiNamePhrase(input.name),\n version: input.version,\n \"x-generator\": `blume@${input.version}`,\n };\n const document: ApiSpecDocument = {\n components: { schemas },\n info,\n openapi: \"3.1.0\",\n paths: Object.fromEntries(pathEntries),\n security: [],\n servers: [{ description: input.name, url: serverUrl(input) }],\n tags,\n };\n if (input.site) {\n document.externalDocs = {\n description: `${input.name} documentation`,\n url: absoluteUrl(input.site, mountBasePath(input.base, \"/\")),\n };\n }\n return document;\n};\n",
15
15
  "import type { BlumeProject } from \"../core/project-graph.ts\";\nimport { buildSearchDocuments } from \"../search/documents.ts\";\nimport type { OramaDoc } from \"../search/orama-index.ts\";\nimport type { AskData } from \"./ask-context.ts\";\n\n/**\n * Build the grounding snapshot the assistant endpoint serves. Like the MCP server,\n * the assistant is independent of on-page search, so documents are indexed even when the\n * search provider is `none` (`includeWhenDisabled`). `locale` is kept so\n * retrieval can be filtered to the current page's language, and on a\n * versioned site `version` too, so archived snapshots don't crowd the docs\n * being read out of the answer. Content is kept as Markdown so grounding sees\n * fenced code examples — the model answers \"what does the config look like?\"\n * from the docs instead of declining.\n * The reader is an AI agent, so `<Visibility>` resolves for the agents audience\n * (web-only content removed, agents-only unwrapped) and components downlevel to\n * Markdown, both matching llms-full.txt.\n */\nexport const buildAskData = async (project: BlumeProject): Promise<AskData> => {\n const documents = await buildSearchDocuments(project, {\n audience: \"agents\",\n content: \"markdown\",\n includeWhenDisabled: true,\n });\n const versioned = Boolean(project.config.versions);\n const data: AskData = {\n defaultLocale: project.config.i18n?.defaultLocale,\n documents: documents.map((doc) => {\n const document: OramaDoc = {\n content: doc.content,\n description: doc.description,\n locale: doc.locale,\n route: doc.route,\n title: doc.title,\n };\n if (versioned) {\n document.version = doc.version;\n }\n if (doc.boost !== undefined) {\n document.boost = doc.boost;\n }\n if (doc.keywords) {\n document.keywords = doc.keywords;\n }\n return document;\n }),\n site: project.config.deployment.options.site ?? null,\n };\n if (versioned) {\n data.versioned = true;\n }\n return data;\n};\n",
@@ -30,7 +30,7 @@
30
30
  "/**\n * CSS for Twoslash's rich renderer, emitted into the Tailwind entry (Twoslash\n * runs on any fence with the `twoslash` meta). It is the shipped\n * `@shikijs/twoslash` stylesheet plus a Blume-themed override layer:\n *\n * - maps the renderer's `--twoslash-*` variables onto Blume tokens so popups\n * match the active theme (light/dark);\n * - lets popups escape the code block's horizontal scroll container; and\n * - restores backgrounds the theme's `pre.astro-code span { background:\n * transparent !important }` rule would otherwise clear from popup chrome.\n */\n\nimport { readFileSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\n\nconst require = createRequire(import.meta.url);\n\n/** Blume-token theming layered over the shipped rich renderer styles. */\nconst OVERRIDES = `\n/* Twoslash: theme the rich renderer with Blume tokens. */\n:root {\n --twoslash-border-color: var(--blume-border);\n --twoslash-popup-bg: var(--blume-code-background);\n --twoslash-popup-color: var(--blume-foreground);\n --twoslash-popup-shadow: 0 6px 24px oklch(0 0 0 / 0.18);\n --twoslash-docs-color: var(--blume-muted-foreground);\n --twoslash-docs-font: var(--font-sans);\n --twoslash-code-font: var(--font-mono);\n --twoslash-matched-color: var(--blume-foreground);\n --twoslash-unmatched-color: var(--blume-muted-foreground);\n --twoslash-cursor-color: var(--blume-muted-foreground);\n}\n\n/* Popups are absolutely positioned and must escape the pre's scroll container.\n The base prose pre rule (from the typography layer) wins the cascade here\n despite lower specificity, so !important is needed to force visibility.\n Regular code blocks scroll their inner code element and carry the horizontal\n padding there; twoslash code opts out of that scroller (popups again), so the\n padding is restored on the pre. */\n.prose pre.twoslash {\n overflow: visible !important;\n padding-left: 1.25rem;\n padding-right: 1.25rem;\n}\n\n/* Twoslash blocks keep \\`overflow: visible\\` so popups can escape, which means\n long lines can't scroll — they'd push past the viewport on narrow screens.\n Wrap them on mobile instead; hover popups still position against the token. */\n@media (max-width: 640px) {\n .prose pre.twoslash code {\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n }\n}\n\n/* The rich renderer renders each popup's type signature as a nested Shiki\n pre. Strip the code-block chrome (border, radius, padding, background) so it\n sits flush inside the popup, which owns the frame. */\n.prose pre.twoslash .twoslash-popup-container pre {\n background: transparent !important;\n border: 0 !important;\n border-radius: 0 !important;\n margin: 0 !important;\n padding: 0 !important;\n}\n\n/* Re-assert chrome backgrounds the transparent token-span rule would clear. */\n.twoslash .twoslash-popup-container,\n.twoslash .twoslash-popup-arrow,\n.twoslash .twoslash-completion-cursor .twoslash-completion-list {\n background: var(--twoslash-popup-bg) !important;\n}\n.twoslash .twoslash-popup-error {\n background: var(--twoslash-error-bg) !important;\n}\n.twoslash .twoslash-highlighted {\n background: var(--twoslash-highlighted-bg) !important;\n}\n\n/* The error squiggle uses a background image the transparent rule clears, so\n draw it as a wavy underline instead. */\n.twoslash .twoslash-error {\n text-decoration: underline wavy var(--twoslash-error-color);\n text-underline-offset: 0.25em;\n}\n\n.twoslash-popup-container {\n max-width: min(90vw, 36rem);\n}\n`;\n\n/** The full Twoslash stylesheet (shipped rich styles + Blume overrides). */\nexport const twoslashCss = (): string => {\n const file = require.resolve(\"@shikijs/twoslash/style-rich.css\");\n return `${readFileSync(file, \"utf-8\")}\\n${OVERRIDES}`;\n};\n",
31
31
  "import { existsSync, realpathSync } from \"node:fs\";\nimport {\n lstat,\n mkdir,\n readdir,\n readlink,\n realpath,\n rm,\n symlink,\n} from \"node:fs/promises\";\nimport { isBuiltin } from \"node:module\";\n\nimport {\n basename,\n dirname,\n isAbsolute,\n join,\n normalize,\n relative,\n resolve,\n} from \"pathe\";\n\nimport { packageRoot } from \"../core/package-root.ts\";\n\n/**\n * The two places an installer can put Blume's dependencies:\n * - `<blume>/node_modules` — deps nested under the package (workspace source,\n * or npm nesting them away from a conflicting hoisted copy)\n * - `dirname(<blume>)` — deps as siblings in the store (isolated/pnpm)\n *\n * `packageRoot()` resolves to Blume's real on-disk path (Node follows the\n * install symlink), so its parent is the store's package directory where the\n * isolated linker places the siblings.\n */\nexport const depsCandidates = (pkgDir: string): string[] => [\n join(pkgDir, \"node_modules\"),\n dirname(pkgDir),\n];\n\n/** First dependency candidate containing the package dir `segments`, or null. */\nexport const candidateHolding = (\n pkgDir: string,\n ...segments: string[]\n): string | null =>\n depsCandidates(pkgDir).find((dir) => existsSync(join(dir, ...segments))) ??\n null;\n\nconst holdsAstro = (dir: string): boolean => existsSync(join(dir, \"astro\"));\nconst holdsMdx = (dir: string): boolean =>\n existsSync(join(dir, \"@astrojs\", \"mdx\"));\n\n/**\n * Locate the directory that holds Blume's installed dependencies (Astro and its\n * integrations).\n *\n * With a clean hoisted install this is moot — the deps sit in a `node_modules`\n * the generated `.blume/` already walks up into. But under isolated linkers\n * (Bun's `isolated` mode, pnpm) Blume's deps are NOT hoisted into the project;\n * they live beside the Blume package in a virtual store, invisible to the\n * upward walk from `.blume/` — so probe the {@link depsCandidates}.\n *\n * Astro alone is a bad probe: an npm split install (an `overrides` pin plus an\n * incremental install) hoists `astro` to the project root while Blume's other\n * deps stay nested, and probing for astro then picks the root directory — one\n * that holds none of them. Prefer a candidate with the full set (astro beside\n * `@astrojs/mdx`, the integration every generated runtime declares), then one\n * with the integrations (astro hoisted away — the rest of Blume's deps sit\n * there too), then one with astro alone.\n */\nexport const blumeDepsDir = (pkgDir: string = packageRoot()): string | null => {\n const candidates = depsCandidates(pkgDir);\n return (\n candidates.find((dir) => holdsAstro(dir) && holdsMdx(dir)) ??\n candidates.find(holdsMdx) ??\n candidates.find(holdsAstro) ??\n null\n );\n};\n\n/**\n * The package a bare specifier names (`@scope/name` or `name`, whatever\n * subpath follows), or null for a Node builtin.\n */\nexport const packageNameOf = (specifier: string): string | null => {\n if (isBuiltin(specifier)) {\n return null;\n }\n const [first = \"\", second] = specifier.split(\"/\");\n if (!first.startsWith(\"@\")) {\n return first || null;\n }\n return second ? `${first}/${second}` : null;\n};\n\n/**\n * The directory an import of package `name` loads from when resolved from\n * `fromDir`: the first `node_modules/<name>` up the physical ancestors — the\n * walk Node itself performs — as a real path, or null when none holds it.\n */\nexport const packageDirFrom = (\n name: string,\n fromDir: string\n): string | null => {\n let dir = normalize(fromDir);\n while (true) {\n const candidate = join(dir, \"node_modules\", name);\n if (existsSync(join(candidate, \"package.json\"))) {\n return normalize(realpathSync(candidate));\n }\n const parent = dirname(dir);\n if (parent === dir) {\n return null;\n }\n dir = parent;\n }\n};\n\n/** Whether `child` is `parent` or sits somewhere under it. */\nconst isWithin = (parent: string, child: string): boolean => {\n const path = relative(parent, child);\n return path === \"\" || !(path.startsWith(\"..\") || isAbsolute(path));\n};\n\n/**\n * Point `link` at the package directory `target`, replacing a link to anything\n * else and leaving a real directory alone. The link is relative, so it keeps\n * working when the project moves as a whole (a server build shipped with its\n * `node_modules`); without symlink privilege on Windows it falls back to a\n * junction, which must be absolute.\n */\nconst linkPackageDir = async (link: string, target: string): Promise<void> => {\n await mkdir(dirname(link), { recursive: true });\n // A relative link resolves from its folder's real path, which differs from\n // the logical one under a symlinked parent (macOS's `/var` → `/private/var`),\n // so the relative target is computed from the real path.\n const from = normalize(await realpath(dirname(link)));\n let existing: Awaited<ReturnType<typeof lstat>> | null;\n try {\n existing = await lstat(link);\n } catch {\n existing = null;\n }\n if (existing) {\n if (!existing.isSymbolicLink()) {\n return;\n }\n try {\n // Both sides in one separator style: Windows hands back `\\\\` paths.\n if (resolve(from, await readlink(link)) === normalize(target)) {\n return;\n }\n } catch {\n // An unreadable link is replaced below.\n }\n await rm(link, { force: true });\n }\n try {\n await symlink(relative(from, target), link, \"dir\");\n } catch {\n await symlink(target, link, \"junction\");\n }\n};\n\n/** The package names a `node_modules` directory holds, scoped ones included. */\nconst packageNames = async (modulesDir: string): Promise<string[]> => {\n const entries = await readdir(modulesDir);\n const grouped = await Promise.all(\n entries\n .filter((entry) => !entry.startsWith(\".\"))\n .map(async (entry) => {\n if (!entry.startsWith(\"@\")) {\n return [entry];\n }\n const scoped = await readdir(join(modulesDir, entry));\n return scoped.map((name) => `${entry}/${name}`);\n })\n );\n return grouped.flat();\n};\n\n/**\n * Give a server-side build output its own `node_modules`: one link per package\n * its bundles import by bare name, each to the copy the importing module\n * resolves. A render bundle mixes code from Blume, Astro, and the adapters\n * into one set of chunks, and its bare imports resolve by walking up from the\n * chunk — so without these links the copy the package manager happened to\n * hoist wins, not the one the importer declared. A root `js-yaml@4` (pulled in\n * by the Netlify or Cloudflare adapter) then breaks Blume's `js-yaml@5`\n * import, a Yarn-hoisted `cookie@0.7` breaks Astro's `cookie@2` import, and\n * under pnpm the server bundle can't reach Blume's dependencies at all.\n *\n * Under an isolated linker the links also cover the rest of Blume's own\n * dependencies, which the upward walk can't reach from the output, so a\n * specifier the build never saw (loaded by a dependency at runtime) still\n * resolves as it did before.\n */\nexport const linkRenderDeps = async (\n dir: string,\n imported: ReadonlyMap<string, string>,\n pkgDir: string = packageRoot()\n): Promise<void> => {\n const modulesDir = join(dir, \"node_modules\");\n // An earlier release linked the whole directory here; per-package links\n // need a real directory in its place.\n try {\n const existing = await lstat(modulesDir);\n if (existing.isSymbolicLink()) {\n await rm(modulesDir, { force: true });\n }\n } catch {\n // Nothing there yet.\n }\n const links = new Map(imported);\n const depsDir = blumeDepsDir(pkgDir);\n if (\n depsDir &&\n !(basename(depsDir) === \"node_modules\" && isWithin(dirname(depsDir), dir))\n ) {\n for (const name of await packageNames(depsDir)) {\n if (!links.has(name)) {\n links.set(name, normalize(realpathSync(join(depsDir, name))));\n }\n }\n }\n await Promise.all(\n [...links].map(([name, target]) =>\n linkPackageDir(join(modulesDir, name), target)\n )\n );\n};\n\n/** The Vite environment a hook runs in (`client`, `ssr`, `prerender`). */\ninterface PluginEnvironment {\n name: string;\n}\n\n/** What `this.resolve` returns: the resolved id, and whether it's external. */\ninterface ResolvedModule {\n external?: boolean | \"absolute\" | \"relative\";\n id: string;\n}\n\n/** The `resolveId` hook options this plugin forwards to `this.resolve`. */\ninterface ResolveIdOptions {\n attributes?: Record<string, string>;\n isEntry?: boolean;\n kind?: string;\n}\n\n/** The slice of the plugin context the `resolveId` hook uses. */\ninterface ResolveContext {\n environment?: PluginEnvironment;\n resolve: (\n source: string,\n importer: string | undefined,\n options: ResolveIdOptions & { skipSelf: boolean }\n ) => Promise<ResolvedModule | null>;\n}\n\n/** The Vite plugin {@link prerenderDepsPlugin} returns. */\nexport interface PrerenderDepsPlugin {\n apply: \"build\";\n configResolved: (config: { root: string }) => void;\n enforce: \"pre\";\n name: string;\n resolveId: {\n filter: { id: RegExp };\n handler: (\n this: ResolveContext,\n source: string,\n importer: string | undefined,\n options: ResolveIdOptions\n ) => Promise<ResolvedModule | null>;\n };\n writeBundle: (\n this: { environment?: PluginEnvironment } | undefined,\n options: { dir?: string }\n ) => Promise<void>;\n}\n\n/**\n * A specifier that could name a package: not relative, absolute, virtual\n * (`\\0`), or carrying a scheme or drive letter (`node:`, `virtual:`, `C:`).\n */\nconst BARE_SPECIFIER = /^[^\\0./\\\\][^:]*$/u;\n\n/**\n * The directory a module id's imports resolve from, or undefined for an id\n * that isn't a file (a virtual module).\n */\nconst importerDir = (importer: string | undefined): string | undefined => {\n const [path = \"\"] = (importer ?? \"\").split(\"?\");\n return isAbsolute(path) ? dirname(path) : undefined;\n};\n\n/**\n * Vite plugin that makes a server-side build's externalized imports resolve\n * to the copies their importers declared, for the static prerender bundle\n * Astro imports to write the HTML and for a server build's output alike.\n *\n * While each server-side environment (`ssr`, `prerender`) builds, it records\n * every import Vite leaves external together with the package directory that\n * import resolves to from the module that makes it. Once the environment's\n * bundle is written, {@link linkRenderDeps} gives the output directory a\n * `node_modules` of links to exactly those directories. Astro deletes the\n * prerender output once generation finishes — `fs.rm` unlinks the links\n * without following them — while a server build ships its links, relative so\n * they survive the project moving as a whole, and a deploy adapter's file\n * trace follows them to the real files.\n *\n * Outside an environment-aware build (a direct call, as in the tests) only a\n * `.prerender` output is handled. The client build is never touched.\n */\nexport const prerenderDepsPlugin = (\n pkgDir: string = packageRoot()\n): PrerenderDepsPlugin => {\n const imported = new Map<string, Map<string, string>>();\n let root: string | undefined;\n\n const record = (\n environment: string,\n source: string,\n importer: string | undefined\n ): void => {\n const name = packageNameOf(source);\n const packages = imported.get(environment) ?? new Map<string, string>();\n imported.set(environment, packages);\n if (!name || packages.has(name)) {\n return;\n }\n const from = importerDir(importer) ?? root;\n const target = from === undefined ? null : packageDirFrom(name, from);\n if (target) {\n packages.set(name, target);\n }\n };\n\n return {\n apply: \"build\",\n configResolved: (config) => {\n ({ root } = config);\n },\n enforce: \"pre\",\n name: \"blume:prerender-deps\",\n resolveId: {\n filter: { id: BARE_SPECIFIER },\n async handler(source, importer, options) {\n const environment = this.environment?.name;\n if (environment === undefined || environment === \"client\") {\n return null;\n }\n const resolved = await this.resolve(source, importer, {\n ...options,\n skipSelf: true,\n });\n if (resolved?.external) {\n record(environment, source, importer);\n }\n return resolved;\n },\n },\n async writeBundle(options) {\n const environment = this?.environment?.name;\n const { dir } = options;\n const serverSide =\n environment === undefined\n ? dir !== undefined && basename(dir) === \".prerender\"\n : environment !== \"client\";\n if (!dir || !serverSide) {\n return;\n }\n const packages = imported.get(environment ?? \"\");\n // A bundle that leaves no package import external loads nothing from\n // `node_modules` at runtime, so it gets none. The Cloudflare adapter\n // bundles the Worker whole, and a copy of its output that follows the\n // links (a CI artifact) would otherwise upload every one of Blume's\n // dependencies as a Worker module.\n if (environment !== undefined && !packages?.size) {\n return;\n }\n await linkRenderDeps(dir, packages ?? new Map<string, string>(), pkgDir);\n },\n };\n};\n"
32
32
  ],
33
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,iBAAS,4BAAgB;;;ACFzB,oBAAS,kBAAS;;;ACWlB;AAEA;AAEA;;;AC2GA,IAAM,cAAc,IAAI,IAAI;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;A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