blume 2.0.2 → 2.1.0

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 (601) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +113 -0
  3. package/README.md +1 -1
  4. package/dist/cli/{chunk-6k4ftwze.js → chunk-0gz36akr.js} +18 -2
  5. package/dist/cli/{chunk-6k4ftwze.js.map → chunk-0gz36akr.js.map} +3 -3
  6. package/dist/cli/{chunk-zp79m0ts.js → chunk-1n228xqb.js} +2 -2
  7. package/dist/cli/{chunk-ddndchfr.js → chunk-2f3ndkpw.js} +57 -29
  8. package/dist/cli/chunk-2f3ndkpw.js.map +14 -0
  9. package/dist/cli/{chunk-fsmrqk8a.js → chunk-2f7n4qzt.js} +8 -2
  10. package/dist/cli/{chunk-fsmrqk8a.js.map → chunk-2f7n4qzt.js.map} +3 -3
  11. package/dist/cli/{chunk-ppzjqwx2.js → chunk-2n4ps1b3.js} +17 -18
  12. package/dist/cli/{chunk-ppzjqwx2.js.map → chunk-2n4ps1b3.js.map} +3 -3
  13. package/dist/cli/{chunk-5r8g91qn.js → chunk-43zcf4gz.js} +398 -159
  14. package/dist/cli/chunk-43zcf4gz.js.map +36 -0
  15. package/dist/cli/chunk-4ejxbzee.js +39 -0
  16. package/dist/cli/chunk-4ejxbzee.js.map +10 -0
  17. package/dist/cli/{chunk-hr8ne106.js → chunk-4h8z9vv5.js} +296 -77
  18. package/dist/cli/chunk-4h8z9vv5.js.map +16 -0
  19. package/dist/cli/{chunk-k7pj68a8.js → chunk-5cg2rzgf.js} +18 -16
  20. package/dist/cli/{chunk-k7pj68a8.js.map → chunk-5cg2rzgf.js.map} +2 -2
  21. package/dist/cli/{chunk-h2ez8dzb.js → chunk-5ffywsmb.js} +4 -4
  22. package/dist/cli/{chunk-g698a744.js → chunk-5wj2qwn2.js} +5 -5
  23. package/dist/cli/chunk-6bm0xpgd.js +18 -0
  24. package/dist/cli/chunk-6bm0xpgd.js.map +10 -0
  25. package/dist/cli/{chunk-3yce002v.js → chunk-713mngdq.js} +15 -8
  26. package/dist/cli/chunk-713mngdq.js.map +14 -0
  27. package/dist/cli/{chunk-91ws1n6j.js → chunk-9geymqns.js} +17 -15
  28. package/dist/cli/{chunk-91ws1n6j.js.map → chunk-9geymqns.js.map} +2 -2
  29. package/dist/cli/{chunk-6dtt0zfn.js → chunk-9xr4dgee.js} +27 -18
  30. package/dist/cli/chunk-9xr4dgee.js.map +10 -0
  31. package/dist/cli/{chunk-sqw4ekg1.js → chunk-amrb6hgh.js} +2 -2
  32. package/dist/cli/chunk-cm89scdv.js +443 -0
  33. package/dist/cli/chunk-cm89scdv.js.map +11 -0
  34. package/dist/cli/{chunk-wdrt2k2v.js → chunk-cmtcnh9f.js} +90 -26
  35. package/dist/cli/chunk-cmtcnh9f.js.map +10 -0
  36. package/dist/cli/chunk-cy5bm0j0.js +104 -0
  37. package/dist/cli/chunk-cy5bm0j0.js.map +11 -0
  38. package/dist/cli/{chunk-7mbqtmgb.js → chunk-e7vvk5ya.js} +21 -12
  39. package/dist/cli/chunk-e7vvk5ya.js.map +10 -0
  40. package/dist/cli/{chunk-qkb5a8sa.js → chunk-g2z9x01v.js} +6 -98
  41. package/dist/cli/chunk-g2z9x01v.js.map +10 -0
  42. package/dist/cli/{chunk-273ygyr4.js → chunk-ga0pf4aj.js} +7 -7
  43. package/dist/cli/{chunk-273ygyr4.js.map → chunk-ga0pf4aj.js.map} +3 -3
  44. package/dist/cli/{chunk-h7k3nq3v.js → chunk-gp84za0h.js} +2 -2
  45. package/dist/cli/{chunk-hqp2ajnh.js → chunk-h2a48yhd.js} +195 -73
  46. package/dist/cli/chunk-h2a48yhd.js.map +36 -0
  47. package/dist/cli/{chunk-pbg5a4s3.js → chunk-jnwj5kjj.js} +71 -47
  48. package/dist/cli/chunk-jnwj5kjj.js.map +19 -0
  49. package/dist/cli/chunk-kwrg63tm.js +31 -0
  50. package/dist/cli/chunk-kwrg63tm.js.map +10 -0
  51. package/dist/cli/{chunk-8g8ytmgx.js → chunk-nd1821sk.js} +21 -19
  52. package/dist/cli/{chunk-8g8ytmgx.js.map → chunk-nd1821sk.js.map} +2 -2
  53. package/dist/cli/{chunk-w4bxdvsa.js → chunk-ntv4qrt7.js} +17 -15
  54. package/dist/cli/{chunk-w4bxdvsa.js.map → chunk-ntv4qrt7.js.map} +2 -2
  55. package/dist/cli/{chunk-bfwp9vp6.js → chunk-p804f3pe.js} +7 -7
  56. package/dist/cli/{chunk-4e9b9ra6.js → chunk-py62fewh.js} +6 -6
  57. package/dist/cli/{chunk-4e9b9ra6.js.map → chunk-py62fewh.js.map} +1 -1
  58. package/dist/cli/chunk-q3wxxq39.js +126 -0
  59. package/dist/cli/chunk-q3wxxq39.js.map +11 -0
  60. package/dist/cli/{chunk-j85scx15.js → chunk-rekqz4qg.js} +142 -46
  61. package/dist/cli/chunk-rekqz4qg.js.map +10 -0
  62. package/dist/cli/{chunk-00gs3wqs.js → chunk-ta27feev.js} +1 -1
  63. package/dist/cli/{chunk-v6ya5kcb.js → chunk-xkz5xbtv.js} +4031 -1132
  64. package/dist/cli/chunk-xkz5xbtv.js.map +213 -0
  65. package/dist/cli/{chunk-bbnwccaz.js → chunk-y4ykbark.js} +2 -2
  66. package/dist/cli/{chunk-n1yg3tj3.js → chunk-y5h4r2y0.js} +6 -6
  67. package/dist/cli/{chunk-n1yg3tj3.js.map → chunk-y5h4r2y0.js.map} +3 -3
  68. package/dist/cli/{chunk-nfcyttvj.js → chunk-yj17vs39.js} +9 -9
  69. package/dist/cli/{chunk-nfcyttvj.js.map → chunk-yj17vs39.js.map} +1 -1
  70. package/dist/cli/{chunk-7vtckvaw.js → chunk-yxmk4pec.js} +16 -14
  71. package/dist/cli/{chunk-7vtckvaw.js.map → chunk-yxmk4pec.js.map} +2 -2
  72. package/dist/cli/{chunk-gs7r695n.js → chunk-zccbjcj0.js} +22 -8
  73. package/dist/cli/{chunk-gs7r695n.js.map → chunk-zccbjcj0.js.map} +3 -3
  74. package/dist/cli/{chunk-xh43dwgw.js → chunk-zf748avv.js} +415 -225
  75. package/dist/cli/chunk-zf748avv.js.map +37 -0
  76. package/dist/cli/{chunk-d1v5rhy0.js → chunk-zhvd6adm.js} +16 -14
  77. package/dist/cli/{chunk-d1v5rhy0.js.map → chunk-zhvd6adm.js.map} +2 -2
  78. package/dist/cli/index.js +28 -20
  79. package/dist/cli/index.js.map +5 -5
  80. package/dist/types/ai/agent-surface.d.ts +8 -7
  81. package/dist/types/ai/ai-catalog.d.ts +7 -0
  82. package/dist/types/ai/ask-context.d.ts +22 -0
  83. package/dist/types/ai/ask.d.ts +271 -58
  84. package/dist/types/ai/index.d.ts +2 -2
  85. package/dist/types/ai/link-headers.d.ts +8 -1
  86. package/dist/types/ai/openapi-components.d.ts +5 -2
  87. package/dist/types/ai/relative-links.d.ts +9 -7
  88. package/dist/types/ai/site-skill.d.ts +26 -0
  89. package/dist/types/ai/skills.d.ts +20 -1
  90. package/dist/types/ai/tar.d.ts +1 -3
  91. package/dist/types/analytics/index.d.ts +2 -0
  92. package/dist/types/analytics/one-dollar-stats.d.ts +48 -0
  93. package/dist/types/analytics/schema.d.ts +14 -0
  94. package/dist/types/astro/integration.d.ts +11 -2
  95. package/dist/types/captcha/hcaptcha.d.ts +27 -0
  96. package/dist/types/captcha/index.d.ts +28 -0
  97. package/dist/types/captcha/schema.d.ts +29 -0
  98. package/dist/types/captcha/turnstile.d.ts +28 -0
  99. package/dist/types/components/content/api-field.d.ts +59 -0
  100. package/dist/types/components/content/api-page.d.ts +95 -0
  101. package/dist/types/components/layout/nav-utils.d.ts +26 -0
  102. package/dist/types/components/openapi/helpers.d.ts +137 -0
  103. package/dist/types/components/openapi/security.d.ts +85 -0
  104. package/dist/types/consent/ethyca.d.ts +48 -0
  105. package/dist/types/consent/index.d.ts +37 -0
  106. package/dist/types/consent/native.d.ts +28 -0
  107. package/dist/types/consent/osano.d.ts +42 -0
  108. package/dist/types/consent/schema.d.ts +110 -0
  109. package/dist/types/core/base-path.d.ts +21 -7
  110. package/dist/types/core/config-input.d.ts +196 -27
  111. package/dist/types/core/data.d.ts +49 -4
  112. package/dist/types/core/directive-diagnostics.d.ts +12 -0
  113. package/dist/types/core/footer.d.ts +8 -0
  114. package/dist/types/core/heading-markers.d.ts +5 -7
  115. package/dist/types/core/i18n-ui.d.ts +86 -0
  116. package/dist/types/core/i18n.d.ts +2 -0
  117. package/dist/types/core/includes.d.ts +8 -2
  118. package/dist/types/core/last-modified.d.ts +10 -0
  119. package/dist/types/core/localizable.d.ts +7 -0
  120. package/dist/types/core/meta.d.ts +8 -0
  121. package/dist/types/core/page-modes.d.ts +29 -0
  122. package/dist/types/core/redirect-patterns.d.ts +144 -0
  123. package/dist/types/core/related.d.ts +40 -0
  124. package/dist/types/core/schema.d.ts +558 -56
  125. package/dist/types/core/sources/lower.d.ts +29 -16
  126. package/dist/types/core/sources/normalize.d.ts +13 -1
  127. package/dist/types/core/sources/read.d.ts +5 -0
  128. package/dist/types/core/sources/watch.d.ts +12 -5
  129. package/dist/types/core/standard-schema.d.ts +5 -0
  130. package/dist/types/core/types.d.ts +1 -1
  131. package/dist/types/core/variables.d.ts +42 -0
  132. package/dist/types/deploy/artifacts.d.ts +6 -4
  133. package/dist/types/deploy/headers.d.ts +5 -0
  134. package/dist/types/deploy/node-headers.d.ts +13 -2
  135. package/dist/types/deploy/platforms/cloudflare.d.ts +5 -0
  136. package/dist/types/deploy/platforms/netlify.d.ts +7 -0
  137. package/dist/types/deploy/platforms/types.d.ts +8 -0
  138. package/dist/types/deploy/platforms/vercel.d.ts +6 -0
  139. package/dist/types/deploy/redirects.d.ts +61 -22
  140. package/dist/types/deploy/vercel-negotiation.d.ts +9 -0
  141. package/dist/types/markdown/code-title.d.ts +17 -0
  142. package/dist/types/markdown/directives.d.ts +62 -0
  143. package/dist/types/markdown/features.d.ts +24 -2
  144. package/dist/types/markdown/mdast.d.ts +63 -0
  145. package/dist/types/narration/build.d.ts +70 -0
  146. package/dist/types/narration/provider.d.ts +26 -0
  147. package/dist/types/narration/script.d.ts +154 -0
  148. package/dist/types/openapi/asyncapi.d.ts +4 -2
  149. package/dist/types/openapi/model.d.ts +12 -6
  150. package/dist/types/openapi/overlay.d.ts +54 -0
  151. package/dist/types/openapi/parse.d.ts +13 -0
  152. package/dist/types/openapi/references.d.ts +14 -4
  153. package/dist/types/ratelimit/cloudflare.d.ts +39 -0
  154. package/dist/types/ratelimit/index.d.ts +27 -0
  155. package/dist/types/ratelimit/memory.d.ts +36 -0
  156. package/dist/types/ratelimit/schema.d.ts +111 -0
  157. package/dist/types/ratelimit/upstash.d.ts +21 -0
  158. package/dist/types/ratelimit/wrangler.d.ts +23 -0
  159. package/dist/types/reference/asyncapi.d.ts +10 -10
  160. package/dist/types/reference/graphql.d.ts +13 -10
  161. package/dist/types/reference/openapi.d.ts +33 -12
  162. package/dist/types/reference/options.d.ts +45 -5
  163. package/dist/types/reference/scalar.d.ts +13 -0
  164. package/dist/types/reference/schema.d.ts +60 -36
  165. package/dist/types/search/documents.d.ts +12 -1
  166. package/dist/types/search/orama-index.d.ts +4 -0
  167. package/dist/types/seo/metatags.d.ts +20 -0
  168. package/docs/02-deployment.mdx +44 -6
  169. package/docs/03-upgrading.mdx +4 -4
  170. package/docs/04-migrating.mdx +1 -1
  171. package/docs/08-faq.mdx +1 -1
  172. package/docs/advanced/changelog.mdx +2 -2
  173. package/docs/advanced/custom-pages.mdx +3 -3
  174. package/docs/advanced/skills.mdx +14 -0
  175. package/docs/cli/audit.mdx +38 -2
  176. package/docs/cli/evals.mdx +3 -3
  177. package/docs/cli/index.mdx +1 -0
  178. package/docs/cli/translate.mdx +3 -3
  179. package/docs/cli/version.mdx +1 -1
  180. package/docs/configuration/analytics.mdx +22 -1
  181. package/docs/configuration/assistant.mdx +188 -36
  182. package/docs/configuration/consent.mdx +100 -0
  183. package/docs/configuration/customization.mdx +6 -4
  184. package/docs/configuration/index.mdx +63 -5
  185. package/docs/configuration/meta.ts +3 -0
  186. package/docs/configuration/narration.mdx +119 -0
  187. package/docs/configuration/rate-limiting.mdx +69 -0
  188. package/docs/configuration/search.mdx +30 -2
  189. package/docs/configuration/theming.mdx +3 -1
  190. package/docs/content/components.mdx +107 -1
  191. package/docs/content/frontmatter.mdx +77 -1
  192. package/docs/content/i18n.mdx +40 -3
  193. package/docs/content/includes.mdx +16 -0
  194. package/docs/content/index.mdx +4 -2
  195. package/docs/content/islands.mdx +1 -1
  196. package/docs/content/meta.mdx +4 -1
  197. package/docs/content/meta.ts +1 -0
  198. package/docs/content/navigation.mdx +28 -6
  199. package/docs/content/sources/contentful.mdx +32 -0
  200. package/docs/content/sources/custom.mdx +39 -0
  201. package/docs/content/sources/github-releases.mdx +31 -0
  202. package/docs/content/sources/index.mdx +91 -0
  203. package/docs/content/sources/meta.ts +16 -0
  204. package/docs/content/sources/notion.mdx +32 -0
  205. package/docs/content/sources/obsidian.mdx +37 -0
  206. package/docs/content/sources/payload.mdx +30 -0
  207. package/docs/content/sources/remote-mdx.mdx +40 -0
  208. package/docs/content/sources/sanity.mdx +29 -0
  209. package/docs/content/sources/strapi.mdx +31 -0
  210. package/docs/content/syntax.mdx +81 -2
  211. package/docs/content/variables.mdx +41 -0
  212. package/docs/content/versioning.mdx +1 -1
  213. package/docs/discoverability/agent-discovery.mdx +30 -3
  214. package/docs/discoverability/index.mdx +3 -2
  215. package/docs/discoverability/llms-txt.mdx +1 -1
  216. package/docs/discoverability/markdown.mdx +2 -2
  217. package/docs/discoverability/metadata.mdx +17 -0
  218. package/docs/discoverability/open-graph.mdx +5 -3
  219. package/docs/discoverability/rss.mdx +1 -1
  220. package/docs/references/api-pages.mdx +74 -0
  221. package/docs/references/asyncapi.mdx +2 -2
  222. package/docs/references/graphql.mdx +3 -3
  223. package/docs/references/meta.ts +1 -1
  224. package/docs/references/openapi.mdx +106 -5
  225. package/docs/references/scalar.mdx +3 -1
  226. package/package.json +36 -1
  227. package/skills/blume/SKILL.md +3 -0
  228. package/skills/blume-migrate/SKILL.md +5 -5
  229. package/skills/blume-migrate/references/docusaurus.md +3 -3
  230. package/skills/blume-migrate/references/fumadocs.md +1 -1
  231. package/skills/blume-migrate/references/mintlify.md +37 -19
  232. package/skills/blume-migrate/references/nextra.md +3 -3
  233. package/skills/blume-migrate/references/starlight.md +2 -1
  234. package/skills/blume-migrate/scripts/mintlify-codemod.mjs +67 -16
  235. package/skills/blume-write-skill/SKILL.md +82 -0
  236. package/src/ai/agent-readability.ts +4 -3
  237. package/src/ai/agent-surface.ts +9 -7
  238. package/src/ai/ai-catalog.ts +12 -5
  239. package/src/ai/api/handlers.ts +2 -2
  240. package/src/ai/api/spec.ts +2 -2
  241. package/src/ai/api-catalog.ts +6 -2
  242. package/src/ai/ask-context.ts +73 -20
  243. package/src/ai/ask-data.ts +6 -0
  244. package/src/ai/ask-tools.ts +142 -0
  245. package/src/ai/ask.ts +354 -76
  246. package/src/ai/changelog-markdown.ts +2 -2
  247. package/src/ai/component-markdown.ts +75 -0
  248. package/src/ai/cors.ts +2 -0
  249. package/src/ai/index.ts +12 -0
  250. package/src/ai/link-headers.ts +14 -5
  251. package/src/ai/llms.ts +24 -9
  252. package/src/ai/markdown.ts +2 -1
  253. package/src/ai/mcp/data.ts +6 -0
  254. package/src/ai/mcp/discovery.ts +2 -2
  255. package/src/ai/mcp/query.ts +2 -2
  256. package/src/ai/mcp/server.ts +2 -2
  257. package/src/ai/openapi-components.ts +31 -9
  258. package/src/ai/relative-links.ts +42 -26
  259. package/src/ai/serializers.ts +2 -1
  260. package/src/ai/site-skill.ts +274 -0
  261. package/src/ai/skills.ts +49 -3
  262. package/src/ai/tar.ts +139 -12
  263. package/src/ai/write-skill.ts +97 -0
  264. package/src/analytics/head.ts +4 -0
  265. package/src/analytics/index.ts +5 -0
  266. package/src/analytics/one-dollar-stats.ts +86 -0
  267. package/src/analytics/schema.ts +2 -0
  268. package/src/astro/generate.ts +133 -19
  269. package/src/astro/include-hmr.ts +31 -12
  270. package/src/astro/include-refresh.ts +19 -8
  271. package/src/astro/index.ts +1 -0
  272. package/src/astro/integration.ts +143 -14
  273. package/src/astro/module-types.ts +6 -0
  274. package/src/astro/runtime-modules.ts +28 -13
  275. package/src/astro/templates.ts +364 -67
  276. package/src/astro/variables.ts +31 -0
  277. package/src/audit/catalog.ts +19 -0
  278. package/src/audit/checks/contrast.ts +183 -0
  279. package/src/audit/checks/i18n.ts +2 -3
  280. package/src/audit/checks/indexability.ts +2 -3
  281. package/src/audit/checks/links.ts +13 -13
  282. package/src/audit/checks/sitemap.ts +2 -3
  283. package/src/audit/graph.ts +3 -1
  284. package/src/audit/redirects.ts +46 -15
  285. package/src/audit/run.ts +14 -9
  286. package/src/audit/snapshot.ts +5 -0
  287. package/src/audit/types.ts +2 -1
  288. package/src/blume-modules.d.ts +7 -0
  289. package/src/captcha/client.ts +152 -0
  290. package/src/captcha/hcaptcha.ts +36 -0
  291. package/src/captcha/index.ts +28 -0
  292. package/src/captcha/schema.ts +32 -0
  293. package/src/captcha/turnstile.ts +38 -0
  294. package/src/captcha/verify.ts +71 -0
  295. package/src/cli/args.ts +32 -0
  296. package/src/cli/command-meta.ts +5 -0
  297. package/src/cli/commands/audit.ts +4 -1
  298. package/src/cli/commands/doctor.ts +25 -17
  299. package/src/cli/commands/eval.ts +19 -11
  300. package/src/cli/commands/skill.ts +96 -0
  301. package/src/cli/commands/translate.ts +9 -12
  302. package/src/cli/commands/validate.ts +3 -1
  303. package/src/cli/dev-lock.ts +157 -37
  304. package/src/cli/index.ts +5 -0
  305. package/src/cli/report-format.ts +11 -6
  306. package/src/cli/required-secrets.ts +71 -29
  307. package/src/components/BlumePage.astro +2 -0
  308. package/src/components/colors.ts +19 -0
  309. package/src/components/content/ApiEndpoint.astro +18 -0
  310. package/src/components/content/ApiField.astro +79 -0
  311. package/src/components/content/ApiPlayground.astro +62 -0
  312. package/src/components/content/ApiRail.astro +19 -0
  313. package/src/components/content/Badge.astro +5 -3
  314. package/src/components/content/Color.astro +1 -0
  315. package/src/components/content/Component.astro +2 -2
  316. package/src/components/content/FileTree.astro +1 -0
  317. package/src/components/content/GithubInfo.astro +1 -0
  318. package/src/components/content/Panel.astro +1 -0
  319. package/src/components/content/ParamField.astro +25 -0
  320. package/src/components/content/RequestExample.astro +17 -0
  321. package/src/components/content/ResponseExample.astro +17 -0
  322. package/src/components/content/ResponseField.astro +32 -0
  323. package/src/components/content/Step.astro +1 -0
  324. package/src/components/content/Tab.astro +0 -1
  325. package/src/components/content/Tabs.astro +4 -0
  326. package/src/components/content/Tile.astro +1 -0
  327. package/src/components/content/Tooltip.astro +1 -0
  328. package/src/components/content/Tree.astro +1 -0
  329. package/src/components/content/TypeTable.astro +4 -1
  330. package/src/components/content/View.astro +21 -0
  331. package/src/components/content/ViewSwitcher.astro +168 -0
  332. package/src/components/content/api-field.ts +100 -0
  333. package/src/components/content/api-page.ts +224 -0
  334. package/src/components/content/badge-color.ts +5 -2
  335. package/src/components/content/base-href.ts +13 -36
  336. package/src/components/content/view-switcher.ts +71 -0
  337. package/src/components/index.ts +2 -0
  338. package/src/components/islands/Assistant.astro +10 -1
  339. package/src/components/islands/assistant.tsx +125 -18
  340. package/src/components/islands/base-path.ts +47 -10
  341. package/src/components/islands/code-question.ts +62 -0
  342. package/src/components/islands/hooks.ts +145 -40
  343. package/src/components/islands/support-link.ts +68 -0
  344. package/src/components/islands/webmcp.ts +4 -2
  345. package/src/components/layout/Analytics.astro +11 -2
  346. package/src/components/layout/Banner.astro +14 -10
  347. package/src/components/layout/Breadcrumbs.astro +11 -4
  348. package/src/components/layout/ConsentBanner.astro +62 -0
  349. package/src/components/layout/ConsentHead.astro +38 -0
  350. package/src/components/layout/Directory.astro +94 -0
  351. package/src/components/layout/DiscoveryLinks.astro +9 -5
  352. package/src/components/layout/DrawerSwitchers.astro +51 -0
  353. package/src/components/layout/Empty.astro +2 -2
  354. package/src/components/layout/Header.astro +124 -82
  355. package/src/components/layout/LanguageSwitcher.astro +50 -17
  356. package/src/components/layout/NarrationPlayer.astro +1085 -0
  357. package/src/components/layout/NavSelector.astro +35 -9
  358. package/src/components/layout/NavTabMenu.astro +3 -3
  359. package/src/components/layout/NavTree.astro +16 -6
  360. package/src/components/layout/PageActions.astro +4 -3
  361. package/src/components/layout/PageFeedback.astro +54 -49
  362. package/src/components/layout/PageLayout.astro +78 -9
  363. package/src/components/layout/Pagination.astro +3 -3
  364. package/src/components/layout/ReferenceLayout.astro +17 -6
  365. package/src/components/layout/RelatedPages.astro +42 -0
  366. package/src/components/layout/RootLayout.astro +313 -50
  367. package/src/components/layout/Search.astro +64 -30
  368. package/src/components/layout/SiteFooter.astro +124 -0
  369. package/src/components/layout/SiteMetatags.astro +16 -0
  370. package/src/components/layout/VersionBanner.astro +2 -2
  371. package/src/components/layout/analytics-client.ts +12 -0
  372. package/src/components/layout/consent/native.ts +79 -0
  373. package/src/components/layout/consent/types.ts +37 -0
  374. package/src/components/layout/footer-links.ts +53 -0
  375. package/src/components/layout/footer-socials.ts +87 -0
  376. package/src/components/layout/locale-redirect.ts +107 -0
  377. package/src/components/layout/nav-utils.ts +83 -0
  378. package/src/components/layout/page-feedback.ts +96 -0
  379. package/src/components/layout/search/analytics.ts +98 -0
  380. package/src/components/layout/search/flexsearch.ts +17 -5
  381. package/src/components/layout/search/orama-cloud.ts +26 -14
  382. package/src/components/layout/search/types.ts +20 -0
  383. package/src/components/layout/search/typesense.ts +5 -1
  384. package/src/components/layout/toc-active.ts +41 -0
  385. package/src/components/layout/toc-element.ts +8 -14
  386. package/src/components/openapi/ApiTagOperations.astro +2 -2
  387. package/src/components/openapi/AsyncApiOperation.astro +7 -4
  388. package/src/components/openapi/GraphqlChip.astro +2 -2
  389. package/src/components/openapi/Operation.astro +163 -13
  390. package/src/components/openapi/Playground.astro +4 -4
  391. package/src/components/openapi/RequestBody.astro +6 -4
  392. package/src/components/openapi/RequestPanel.astro +63 -8
  393. package/src/components/openapi/Responses.astro +6 -4
  394. package/src/components/openapi/SchemaTable.astro +7 -0
  395. package/src/components/openapi/async-snippets.ts +4 -4
  396. package/src/components/openapi/async.ts +38 -6
  397. package/src/components/openapi/code-samples.ts +97 -0
  398. package/src/components/openapi/helpers.ts +19 -9
  399. package/src/components/openapi/message-composer.ts +6 -1
  400. package/src/components/openapi/message.ts +17 -2
  401. package/src/components/openapi/operation-model.ts +81 -11
  402. package/src/components/openapi/panel.ts +4 -2
  403. package/src/components/openapi/param-style.ts +181 -0
  404. package/src/components/openapi/playground-client.ts +73 -16
  405. package/src/components/openapi/request.ts +190 -26
  406. package/src/components/openapi/schema-tree.ts +30 -24
  407. package/src/components/openapi/security.ts +6 -3
  408. package/src/components/openapi/snippets.ts +953 -13
  409. package/src/components/openapi/ws-client.ts +18 -2
  410. package/src/components/props.ts +6 -0
  411. package/src/consent/client.ts +95 -0
  412. package/src/consent/clients.ts +19 -0
  413. package/src/consent/ethyca.ts +71 -0
  414. package/src/consent/head.ts +24 -0
  415. package/src/consent/index.ts +37 -0
  416. package/src/consent/init.ts +29 -0
  417. package/src/consent/native.ts +36 -0
  418. package/src/consent/osano.ts +59 -0
  419. package/src/consent/schema.ts +30 -0
  420. package/src/core/base-path.ts +62 -16
  421. package/src/core/builtin-tags.ts +5 -0
  422. package/src/core/client-address.ts +19 -0
  423. package/src/core/config-input.ts +203 -27
  424. package/src/core/data.ts +44 -4
  425. package/src/core/diagnostics.ts +5 -2
  426. package/src/core/directive-diagnostics.ts +99 -0
  427. package/src/core/footer.ts +26 -0
  428. package/src/core/frontmatter.ts +21 -18
  429. package/src/core/graph.ts +39 -36
  430. package/src/core/heading-markers.ts +5 -18
  431. package/src/core/i18n-ui.ts +82 -2
  432. package/src/core/i18n.ts +31 -3
  433. package/src/core/includes.ts +20 -3
  434. package/src/core/last-modified.ts +25 -3
  435. package/src/core/links.ts +16 -2
  436. package/src/core/locale-links.ts +5 -1
  437. package/src/core/localizable.ts +26 -0
  438. package/src/core/meta.ts +33 -19
  439. package/src/core/navigation.ts +71 -20
  440. package/src/core/page-modes.ts +56 -0
  441. package/src/core/project-graph.ts +138 -10
  442. package/src/core/redirect-patterns.ts +491 -0
  443. package/src/core/related.ts +131 -0
  444. package/src/core/schema.ts +342 -68
  445. package/src/core/sources/contentful-rich-text.ts +27 -20
  446. package/src/core/sources/filesystem.ts +20 -2
  447. package/src/core/sources/github-releases.ts +25 -6
  448. package/src/core/sources/lexical.ts +23 -18
  449. package/src/core/sources/lower.ts +201 -34
  450. package/src/core/sources/mdx-remote.ts +51 -16
  451. package/src/core/sources/normalize.ts +327 -91
  452. package/src/core/sources/notion.ts +52 -25
  453. package/src/core/sources/obsidian.ts +23 -6
  454. package/src/core/sources/portable-text.ts +38 -21
  455. package/src/core/sources/read.ts +8 -3
  456. package/src/core/sources/strapi-blocks.ts +20 -16
  457. package/src/core/sources/watch.ts +20 -7
  458. package/src/core/standard-schema.ts +10 -6
  459. package/src/core/types.ts +1 -1
  460. package/src/core/ui-packs/ar.ts +43 -0
  461. package/src/core/ui-packs/bg.ts +45 -0
  462. package/src/core/ui-packs/bn.ts +43 -0
  463. package/src/core/ui-packs/ca.ts +46 -0
  464. package/src/core/ui-packs/cs.ts +44 -0
  465. package/src/core/ui-packs/da.ts +45 -0
  466. package/src/core/ui-packs/de.ts +46 -0
  467. package/src/core/ui-packs/el.ts +45 -0
  468. package/src/core/ui-packs/es.ts +46 -0
  469. package/src/core/ui-packs/fa.ts +45 -0
  470. package/src/core/ui-packs/fi.ts +45 -0
  471. package/src/core/ui-packs/fr.ts +46 -0
  472. package/src/core/ui-packs/he.ts +43 -0
  473. package/src/core/ui-packs/hi.ts +44 -0
  474. package/src/core/ui-packs/hr.ts +45 -0
  475. package/src/core/ui-packs/hu.ts +44 -0
  476. package/src/core/ui-packs/id.ts +45 -0
  477. package/src/core/ui-packs/it.ts +45 -0
  478. package/src/core/ui-packs/ja.ts +45 -0
  479. package/src/core/ui-packs/ko.ts +44 -0
  480. package/src/core/ui-packs/nl.ts +46 -0
  481. package/src/core/ui-packs/no.ts +44 -0
  482. package/src/core/ui-packs/pl.ts +45 -0
  483. package/src/core/ui-packs/pt-br.ts +46 -0
  484. package/src/core/ui-packs/pt.ts +45 -0
  485. package/src/core/ui-packs/ro.ts +45 -0
  486. package/src/core/ui-packs/ru.ts +45 -0
  487. package/src/core/ui-packs/sk.ts +44 -0
  488. package/src/core/ui-packs/sr.ts +45 -0
  489. package/src/core/ui-packs/sv.ts +44 -0
  490. package/src/core/ui-packs/th.ts +43 -0
  491. package/src/core/ui-packs/tr.ts +45 -0
  492. package/src/core/ui-packs/uk.ts +45 -0
  493. package/src/core/ui-packs/vi.ts +45 -0
  494. package/src/core/ui-packs/zh-tw.ts +43 -0
  495. package/src/core/ui-packs/zh.ts +43 -0
  496. package/src/core/variables.ts +103 -0
  497. package/src/core/version-cut.ts +52 -15
  498. package/src/deploy/artifacts.ts +104 -14
  499. package/src/deploy/cloudflare-negotiation.ts +39 -17
  500. package/src/deploy/headers.ts +10 -5
  501. package/src/deploy/node-headers.ts +64 -10
  502. package/src/deploy/platforms/cloudflare.ts +44 -3
  503. package/src/deploy/platforms/netlify.ts +34 -1
  504. package/src/deploy/platforms/node.ts +1 -0
  505. package/src/deploy/platforms/static.ts +1 -0
  506. package/src/deploy/platforms/types.ts +8 -0
  507. package/src/deploy/platforms/vercel.ts +38 -2
  508. package/src/deploy/redirects.ts +139 -36
  509. package/src/deploy/robots.ts +2 -2
  510. package/src/deploy/rss.ts +4 -3
  511. package/src/deploy/sitemap.ts +7 -5
  512. package/src/deploy/vercel-negotiation.ts +36 -0
  513. package/src/markdown/api-rail.ts +259 -0
  514. package/src/markdown/base-links.ts +34 -36
  515. package/src/markdown/code-title.ts +35 -9
  516. package/src/markdown/directives.ts +242 -36
  517. package/src/markdown/features.ts +20 -2
  518. package/src/markdown/fence-meta.ts +2 -0
  519. package/src/markdown/include.ts +11 -1
  520. package/src/markdown/index.ts +35 -11
  521. package/src/markdown/math.ts +4 -4
  522. package/src/markdown/mdast.ts +5 -2
  523. package/src/markdown/relative-links.ts +12 -4
  524. package/src/markdown/variables.ts +56 -0
  525. package/src/markdown/views.ts +82 -0
  526. package/src/narration/build.ts +412 -0
  527. package/src/narration/player.ts +249 -0
  528. package/src/narration/provider.ts +29 -0
  529. package/src/narration/script.ts +592 -0
  530. package/src/og/card.ts +136 -11
  531. package/src/og/derive.ts +41 -31
  532. package/src/og/index.ts +1 -0
  533. package/src/openapi/asyncapi.ts +4 -2
  534. package/src/openapi/model.ts +77 -36
  535. package/src/openapi/overlay.ts +256 -0
  536. package/src/openapi/parse.ts +55 -2
  537. package/src/openapi/proxy.ts +63 -10
  538. package/src/openapi/references.ts +21 -5
  539. package/src/openapi/render-mdx.ts +46 -3
  540. package/src/openapi/scalar.ts +40 -6
  541. package/src/openapi/source.ts +1 -1
  542. package/src/ratelimit/cloudflare.ts +54 -0
  543. package/src/ratelimit/index.ts +30 -0
  544. package/src/ratelimit/memory.ts +45 -0
  545. package/src/ratelimit/runtime.ts +229 -0
  546. package/src/ratelimit/schema.ts +28 -0
  547. package/src/ratelimit/upstash.ts +30 -0
  548. package/src/ratelimit/wrangler.ts +70 -0
  549. package/src/reference/asyncapi.ts +2 -2
  550. package/src/reference/graphql.ts +5 -2
  551. package/src/reference/openapi.ts +21 -7
  552. package/src/reference/options.ts +51 -7
  553. package/src/reference/scalar.ts +33 -8
  554. package/src/registry/eject.ts +201 -28
  555. package/src/registry/registry.ts +7 -0
  556. package/src/search/adapters/version-scope.ts +30 -0
  557. package/src/search/documents.ts +93 -28
  558. package/src/search/orama-index.ts +28 -3
  559. package/src/search/pagefind-ranking.ts +39 -0
  560. package/src/search/popular.ts +2 -1
  561. package/src/search/sync/algolia.ts +15 -4
  562. package/src/search/sync/orama-cloud.ts +3 -0
  563. package/src/search/sync/typesense.ts +5 -0
  564. package/src/seo/jsonld.ts +7 -3
  565. package/src/seo/metatags.ts +67 -0
  566. package/src/theme/chrome-icons.ts +1 -0
  567. package/src/theme/color.ts +500 -0
  568. package/src/theme/entry.ts +56 -3
  569. package/src/theme/palette.ts +121 -45
  570. package/src/translate/meta.ts +68 -24
  571. package/src/translate/prompts.ts +1 -0
  572. package/src/translate/run.ts +3 -3
  573. package/src/translate/validate.ts +12 -3
  574. package/src/translate/work-list.ts +56 -17
  575. package/src/upgrade/upgrade.ts +4 -171
  576. package/dist/cli/chunk-3yce002v.js.map +0 -14
  577. package/dist/cli/chunk-5r8g91qn.js.map +0 -34
  578. package/dist/cli/chunk-6dtt0zfn.js.map +0 -10
  579. package/dist/cli/chunk-7mbqtmgb.js.map +0 -10
  580. package/dist/cli/chunk-ddndchfr.js.map +0 -14
  581. package/dist/cli/chunk-esh98wmb.js +0 -23
  582. package/dist/cli/chunk-esh98wmb.js.map +0 -10
  583. package/dist/cli/chunk-hqp2ajnh.js.map +0 -35
  584. package/dist/cli/chunk-hr8ne106.js.map +0 -13
  585. package/dist/cli/chunk-j85scx15.js.map +0 -10
  586. package/dist/cli/chunk-mqc662a6.js +0 -75
  587. package/dist/cli/chunk-mqc662a6.js.map +0 -11
  588. package/dist/cli/chunk-pbg5a4s3.js.map +0 -19
  589. package/dist/cli/chunk-qkb5a8sa.js.map +0 -10
  590. package/dist/cli/chunk-v6ya5kcb.js.map +0 -189
  591. package/dist/cli/chunk-wdrt2k2v.js.map +0 -10
  592. package/dist/cli/chunk-xh43dwgw.js.map +0 -36
  593. package/docs/content/sources.mdx +0 -338
  594. /package/dist/cli/{chunk-zp79m0ts.js.map → chunk-1n228xqb.js.map} +0 -0
  595. /package/dist/cli/{chunk-h2ez8dzb.js.map → chunk-5ffywsmb.js.map} +0 -0
  596. /package/dist/cli/{chunk-g698a744.js.map → chunk-5wj2qwn2.js.map} +0 -0
  597. /package/dist/cli/{chunk-sqw4ekg1.js.map → chunk-amrb6hgh.js.map} +0 -0
  598. /package/dist/cli/{chunk-h7k3nq3v.js.map → chunk-gp84za0h.js.map} +0 -0
  599. /package/dist/cli/{chunk-bfwp9vp6.js.map → chunk-p804f3pe.js.map} +0 -0
  600. /package/dist/cli/{chunk-00gs3wqs.js.map → chunk-ta27feev.js.map} +0 -0
  601. /package/dist/cli/{chunk-bbnwccaz.js.map → chunk-y4ykbark.js.map} +0 -0
@@ -4,6 +4,10 @@
4
4
  * blocks) renders inline runs, wraps them in block syntax, and joins blocks
5
5
  * with blank lines; these helpers keep that Markdown identical across them.
6
6
  */
7
+ /**
8
+ * CMS text as Markdown that renders as written, wherever it lands — a link
9
+ * label included, where GFM autolinks nothing, so every special is escaped.
10
+ */
7
11
  export declare const escapeMarkdownText: (text: string) => string;
8
12
  /** The marks a lowerer can put on an inline run. */
9
13
  export interface InlineMarks {
@@ -12,6 +16,17 @@ export interface InlineMarks {
12
16
  italic?: boolean;
13
17
  strike?: boolean;
14
18
  }
19
+ /** A run of CMS text and the marks on it. */
20
+ export interface InlineRun {
21
+ marks: InlineMarks;
22
+ text: string;
23
+ }
24
+ /** Inline Markdown a lowerer rendered itself: a link, an embed, a break. */
25
+ export interface InlineMarkdown {
26
+ markdown: string;
27
+ }
28
+ /** One piece of a block's inline content, in order. */
29
+ export type InlinePart = InlineMarkdown | InlineRun;
15
30
  /**
16
31
  * A code span whose delimiter outruns any backtick run inside it, padded with
17
32
  * a space on each side when the code starts or ends with a backtick (the
@@ -22,28 +37,26 @@ export declare const codeSpan: (code: string) => string;
22
37
  * A block's inline text, guarded where only the whole block can tell. Runs
23
38
  * are escaped one at a time, but "import" ending one run and a space or code
24
39
  * span opening the next form an MDX `import` statement only once they are
25
- * joined, and whitespace the first runs put in front of a block turns it into
26
- * an indented code block. Apply it to the joined text of a paragraph,
27
- * heading, quote, or list item — never to code.
40
+ * joined, whitespace the first runs put in front of a block turns it into
41
+ * an indented code block, two struck runs fuse into literal tildes, and a
42
+ * trailing ` #` is a heading's closing sequence. Apply it to the joined text
43
+ * of a paragraph, heading, quote, or list item — never to code.
28
44
  */
29
45
  export declare const guardBlockStart: (text: string) => string;
30
- /**
31
- * Wrap a text run in the Markdown for its marks. Code stays verbatim inside
32
- * the backticks (an escape would render as a backslash); everything else is
33
- * escaped first. Whitespace at either edge moves outside the delimiters,
34
- * since `** bold **` is not strong emphasis but `**bold**` is — editors
35
- * routinely bold a word together with the space after it.
36
- */
37
- export declare const renderInline: (text: string, marks: InlineMarks) => string;
46
+ /** A block's inline content as Markdown. */
47
+ export declare const renderInline: (parts: InlinePart[]) => string;
38
48
  /** A link or image destination as Markdown carries it verbatim. */
39
49
  export declare const destination: (url: string) => string;
40
50
  /**
41
- * A Markdown link, or the label alone when the target is missing — or unsafe:
42
- * CMS content is the editor's, not the site author's, so a destination that
43
- * isn't a web, mail, or relative address (`javascript:`, `data:`) never
44
- * becomes a clickable link on the docs site (see `safe-links.ts`).
51
+ * A Markdown link over inline parts, or the parts alone when the target is
52
+ * missing — or unsafe: CMS content is the editor's, not the site author's, so
53
+ * a destination that isn't a web, mail, or relative address (`javascript:`,
54
+ * `data:`) never becomes a clickable link on the docs site (see
55
+ * `safe-links.ts`). The parts stay parts then, so their runs merge with their
56
+ * neighbors'. A label escapes a bare URL too: GFM autolinks nothing inside a
57
+ * link, so its specials would read as syntax.
45
58
  */
46
- export declare const renderLink: (label: string, href?: string) => string;
59
+ export declare const linkParts: (parts: InlinePart[], href?: string) => InlinePart[];
47
60
  /** The ATX prefix for a heading level, clamped to Markdown's six. */
48
61
  export declare const headingPrefix: (level: number) => string;
49
62
  /** Quote every line of a block. */
@@ -21,6 +21,15 @@ export declare const slugify: (text: string) => string;
21
21
  * document. Each segment is slugged on its own and the separators kept.
22
22
  */
23
23
  export declare const slugifyPath: (text: string) => string;
24
+ /**
25
+ * The error for a content file Astro's content loader can't read, or
26
+ * undefined when it can. A `#` or `?` anywhere in the path the loader is
27
+ * handed (`sdks/c#.md`, `faq/why?.md`) truncates the file URL it reads
28
+ * through, so the read fails with ENOENT and the page renders "Page not
29
+ * found" at its route. A source leaves such a file out of its scan and
30
+ * reports this instead of publishing a route that can never render.
31
+ */
32
+ export declare const unloadablePathDiagnostic: (path: string, file: string) => Diagnostic | undefined;
24
33
  export declare const HTML_COMMENT: RegExp;
25
34
  export declare const INLINE_CODE: RegExp;
26
35
  /** A heading whose trailing `{#id}` marker is unescaped — see `BARE_CURLY_MARKER`. */
@@ -54,7 +63,10 @@ export interface BodyScan {
54
63
  /**
55
64
  * Scan a body for its headings, explicit HTML anchors, and unescaped `{#id}`
56
65
  * markers in one fence-aware walk (the same walk `extractHeadings` exposes for
57
- * headings alone).
66
+ * headings alone). The body is the page's content with its front matter
67
+ * already stripped — the renderers read front matter off the page and never
68
+ * again from its body — so a leading `---` block is a thematic break and
69
+ * content, in `.md` and `.mdx` alike.
58
70
  */
59
71
  export declare const scanBody: (body: string) => BodyScan;
60
72
  export declare const extractHeadings: (body: string) => Heading[];
@@ -1,7 +1,12 @@
1
1
  import type { PageRecord } from "../types.ts";
2
+ import type { ContentVariables } from "../variables.ts";
2
3
  import type { ContentSource } from "./types.ts";
3
4
  /** The subset of a scanned project the entry reader needs. */
4
5
  export interface EntryReadContext {
6
+ /** The site's content variables, substituted into what's read. */
7
+ config?: {
8
+ variables?: ContentVariables;
9
+ };
5
10
  /** The instantiated sources, keyed for `read()` lookups. */
6
11
  sources?: ContentSource[];
7
12
  }
@@ -32,14 +32,21 @@ export declare const baselineScanIgnore: () => string[];
32
32
  * the scan share the same never-content directory set.
33
33
  */
34
34
  export declare const BLUME_WATCH_IGNORE_DIRS: string[];
35
- /** Extract single-segment ignore dirs (`foo`) from `foo/**`-style excludes. */
35
+ /**
36
+ * Extract root-anchored ignore dirs (`/foo`) from `foo/**`-style excludes. The
37
+ * scan's glob `foo/**` matches `foo` at the source root only, so the watcher
38
+ * skips that one directory: a nested `guides/foo/` is still content, and an
39
+ * edit there must still reload.
40
+ */
36
41
  export declare const excludeDirSegments: (patterns: readonly string[]) => string[];
37
42
  /**
38
43
  * Build a recursive-watch listener that fires `onChange` for content changes but
39
- * ignores events whose path crosses an ignored directory segment — one in
40
- * `ignoreDirs`, or one `ignoreSegment` rejects, for a scan whose skip rule is
41
- * a shape (every dot-name) rather than a list. A missing `filename` — rare;
42
- * the platform couldn't name the changed path — falls through to `onChange`
44
+ * ignores events whose path crosses an ignored directory — a segment named in
45
+ * `ignoreDirs` at any depth, or one `ignoreSegment` rejects, for a scan whose
46
+ * skip rule is a shape (every dot-name) rather than a list. An entry written
47
+ * with a leading slash (`/drafts`, see {@link excludeDirSegments}) names a
48
+ * directory at the watched root only. A missing `filename` — rare; the
49
+ * platform couldn't name the changed path — falls through to `onChange`
43
50
  * rather than silently dropping a real edit. Exported for testing.
44
51
  */
45
52
  export declare const ignoringWatchListener: (onChange: () => void, ignoreDirs?: Iterable<string>, ignoreSegment?: (segment: string) => boolean) => WatchListener<string>;
@@ -41,5 +41,10 @@ export interface StandardSchema<Input = unknown, Output = Input> {
41
41
  * Whether a config-supplied value implements the `~standard` contract. Generic
42
42
  * so it can decode any input at the config boundary (`z.custom` hands it the
43
43
  * raw config value) while narrowing whatever type the caller holds.
44
+ *
45
+ * The contract is the `~standard` property, whatever carries it: Zod and
46
+ * Valibot schemas are objects, but an ArkType type is a callable function. The
47
+ * optional-chained probe reads the property off either, and off `null`,
48
+ * `undefined`, or a primitive it finds nothing.
44
49
  */
45
50
  export declare const isStandardSchema: <T>(value: T) => value is T & StandardSchema;
@@ -297,7 +297,7 @@ export interface Navigation {
297
297
  cta?: HeaderAction | null;
298
298
  /** Pinned links shown above the sidebar sections, unscoped by tab. */
299
299
  featured: FeaturedLink[];
300
- /** Repo URL for the header link, or null when hidden (`navigation.repo`). */
300
+ /** Repo URL for the footer's GitHub link, or null when hidden (`navigation.repo`). */
301
301
  repoUrl?: string | null;
302
302
  /**
303
303
  * Where the header's brand link points in this locale: `logo.href` moved
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Content variables: `variables: { version: "2.1.0" }` in `blume.config.ts`
3
+ * makes `{{version}}` in a page read `2.1.0` wherever it appears in the body,
4
+ * code and links included. The syntax is Mintlify's, so migrated pages keep
5
+ * working.
6
+ *
7
+ * Substitution is textual, before any parsing, so a page's HTML, its search
8
+ * entry, its `.md` mirror, and `llms-full.txt` all agree: the MDX pipeline
9
+ * substitutes in a Vite transform ahead of the compiler (an MDX parser would
10
+ * read `{{version}}` as a JavaScript expression), the Markdown pipeline in a
11
+ * plugin over the parsed text, includes as their files are read, and the raw
12
+ * readers through {@link substituteVariables}. Only defined names are
13
+ * replaced; an undefined one in prose is a build error
14
+ * (`BLUME_UNDEFINED_VARIABLE`), and inside code it is left alone, since
15
+ * templating examples (`{{name}}` in a Handlebars snippet) are common there.
16
+ */
17
+ /** The variables a site defines, name to value. */
18
+ export type ContentVariables = Readonly<Record<string, string>>;
19
+ /** A variable name: letters, digits, `_`, and `-` (Mintlify's `api-url`). */
20
+ export declare const VARIABLE_NAME: RegExp;
21
+ /** Whether a site defines any variables, so the rest can be skipped. */
22
+ export declare const hasVariables: (variables?: ContentVariables) => variables is ContentVariables;
23
+ /** `text` with every reference to a defined variable replaced by its value. */
24
+ export declare const substituteVariables: (text: string, variables?: ContentVariables) => string;
25
+ /**
26
+ * {@link substituteVariables} over a page's raw source, leaving its front
27
+ * matter as written: the rendered page reads its title and description from
28
+ * the unsubstituted front matter, so the other surfaces must too.
29
+ */
30
+ export declare const substituteVariablesInBody: (source: string, variables?: ContentVariables) => string;
31
+ /** An undefined variable referenced in prose, with its 1-based line. */
32
+ export interface UndefinedVariable {
33
+ line: number;
34
+ name: string;
35
+ }
36
+ /**
37
+ * The undefined variables `text` references outside code: fenced blocks and
38
+ * inline code spans are skipped, so a templating example never fails a
39
+ * build. Empty when the site defines no variables at all, so a page that
40
+ * shows `{{…}}` literally keeps working until the site opts in.
41
+ */
42
+ export declare const undefinedVariables: (text: string, variables?: ContentVariables) => UndefinedVariable[];
@@ -8,10 +8,12 @@ import type { BlumeProject } from "../core/project-graph.ts";
8
8
  * Written from the integration's `astro:build:done` hook — Astro's channel
9
9
  * for exactly this kind of post-build work — into the directory Astro
10
10
  * reports as the client output (`dist/`, or `dist/client` for a server
11
- * build). The Vercel adapter copies that directory into its Build Output
12
- * static tree in a later hook, so the artifacts ride along; every other
13
- * adapter serves it directly. Running inside the hook rather than after
14
- * `astro build` returns means an ejected project keeps producing them.
11
+ * build, or `dist/client/<base>/` on Cloudflare, whose `_headers` goes to
12
+ * the root the platform serves above it). The Vercel adapter copies that
13
+ * directory into its Build Output static tree in a later hook, so the
14
+ * artifacts ride along; every other adapter serves it directly. Running
15
+ * inside the hook rather than after `astro build` returns means an ejected
16
+ * project keeps producing them.
15
17
  *
16
18
  * Every file yields to one the user ships in `public/` (Astro copied it into
17
19
  * the output before this runs).
@@ -65,6 +65,11 @@ export interface VercelHeader {
65
65
  }[];
66
66
  source: string;
67
67
  }
68
+ /**
69
+ * A literal path as `path-to-regexp` source text — what a `vercel.json`
70
+ * `source` is — with each syntax character escaped, so it matches only itself.
71
+ */
72
+ export declare const escapeVercelSource: (path: string) => string;
68
73
  /**
69
74
  * The {@link headerRules} as `vercel.json` `headers` entries. Vercel reads no
70
75
  * `_headers` file, so a static deploy of `dist/` carries the same rules here —
@@ -1,4 +1,5 @@
1
1
  import type { BlumeProject } from "../core/project-graph.ts";
2
+ import type { CompiledRedirect } from "../core/redirect-patterns.ts";
2
3
  import type { ResolvedConfig } from "../core/schema.ts";
3
4
  import type { BuildLog } from "./platforms/types.ts";
4
5
  /**
@@ -34,19 +35,29 @@ export declare const nodeHeaderRules: (config: ResolvedConfig) => NodeHeaderRule
34
35
  */
35
36
  export type NodeRedirects = Record<string, [string, number]>;
36
37
  /**
37
- * The configured redirects, based the way the host matches them (see
38
+ * The configured exact redirects, based the way the host matches them (see
38
39
  * `platformRedirects`) and keyed for the wrapper's lookup, the `Location`
39
40
  * percent-encoded as Astro sends it. A redirect at a content route's own path
40
41
  * is left out: the prerendered page owns that URL, and the static handler
41
- * serves it before Astro's redirect ever could.
42
+ * serves it before Astro's redirect ever could. Patterns are compiled apart
43
+ * ({@link nodePatternRedirects}).
42
44
  */
43
45
  export declare const nodeRedirects: (project: BlumeProject) => NodeRedirects;
46
+ /**
47
+ * The configured pattern redirects (`/beta/:slug*`), based the way the host
48
+ * matches them and compiled for the wrapper, which tries them in order after
49
+ * the exact ones. None can match a page: the scan rejects a pattern that
50
+ * does (`BLUME_REDIRECT_MATCHES_PAGE`).
51
+ */
52
+ export declare const nodePatternRedirects: (project: BlumeProject) => CompiledRedirect[];
44
53
  /** What the wrapper needs beyond the header rules. */
45
54
  export interface NodeEntryOptions {
46
55
  /** `deployment.base`, normalized (`""` at the root). */
47
56
  base?: string;
48
57
  /** The configured redirects, from {@link nodeRedirects}. */
49
58
  redirects?: NodeRedirects;
59
+ /** The configured pattern redirects, from {@link nodePatternRedirects}. */
60
+ patternRedirects?: CompiledRedirect[];
50
61
  }
51
62
  /**
52
63
  * The entry that replaces Astro's: it answers a configured redirect with its
@@ -28,6 +28,11 @@ export declare const emitCloudflareDeployConfig: (context: ProjectContext) => Pr
28
28
  * built config instead, and is left alone.
29
29
  */
30
30
  export declare const nameCloudflareWorker: (project: BlumeProject, log: BuildLog) => Promise<void>;
31
+ /**
32
+ * Declare the Workers rate limiting binding `rateLimit: cloudflare()` counts
33
+ * with in the built Worker's config, which `wrangler deploy` reads.
34
+ */
35
+ export declare const bindCloudflareRateLimit: (project: BlumeProject, log: BuildLog) => Promise<void>;
31
36
  /**
32
37
  * Cloudflare Workers and Pages. A server build emits the Worker into
33
38
  * `dist/server` and serves `dist/client` through the ASSETS binding, which
@@ -26,6 +26,13 @@ export declare const NETLIFY_CONFIG_FILE: string;
26
26
  * as static files, so the prerendered endpoint's own headers never ship.
27
27
  */
28
28
  export declare const emitNetlifyHeaders: (project: BlumeProject, log: BuildLog) => Promise<void>;
29
+ /**
30
+ * Carry the pattern redirects (`/beta/:slug*`) into a server build, as
31
+ * `redirects` in the Frameworks API config: Astro's `redirects` carry only
32
+ * the exact ones, since it can't prerender a pattern's pages, so the adapter
33
+ * never writes these. Netlify appends them after any rules of the user's own.
34
+ */
35
+ export declare const emitNetlifyPatternRedirects: (project: BlumeProject) => Promise<void>;
29
36
  /**
30
37
  * Netlify. A server build runs on Netlify Functions from the Frameworks API
31
38
  * tree the adapter writes to `.netlify/v1`, relative to the Astro root —
@@ -103,6 +103,14 @@ export interface DeployPlatform {
103
103
  readsHeaderFiles: Record<DeployOutput, boolean>;
104
104
  /** The redirect files a static build writes, beside the manifest. */
105
105
  redirectFiles: RedirectFile[];
106
+ /**
107
+ * Whether the adapter moves a server build's client output under
108
+ * `deployment.base` (`dist/client/<base>/`, the directory Astro then hands
109
+ * `astro:build:done`) while the platform keeps serving `serverStaticDir`
110
+ * as the assets root. The files the platform reads there, like `_headers`,
111
+ * belong above the directory Astro reports.
112
+ */
113
+ serverClientUnderBase: boolean;
106
114
  /** Where a server build's deploy bundle lands. */
107
115
  serverOutputDir: (context: ProjectContext) => string;
108
116
  /** The directory a server build serves as static files. */
@@ -20,6 +20,12 @@ export declare const checkVercelFunctionBundles: (outputDir: string, root: strin
20
20
  * root it was shown.
21
21
  */
22
22
  export declare const emitVercelNegotiation: (project: BlumeProject, log: BuildLog) => Promise<void>;
23
+ /**
24
+ * Route the pattern redirects (`/beta/:slug*`) in the adapter's Build Output
25
+ * config: Astro's `redirects` carry only the exact ones, since it can't
26
+ * prerender a pattern's pages, so the adapter never sees these.
27
+ */
28
+ export declare const emitVercelPatternRedirects: (project: BlumeProject, log: BuildLog) => Promise<void>;
23
29
  /**
24
30
  * Vercel. A server build's Build Output tree lands at `.vercel/output` — at
25
31
  * the project root, because the adapter is handed that root up front: its
@@ -1,11 +1,17 @@
1
+ import type { RouteSet } from "../core/locale-links.ts";
2
+ import type { BlumeProject } from "../core/project-graph.ts";
1
3
  import type { ResolvedConfig } from "../core/schema.ts";
2
4
  import type { VercelHeader } from "./headers.ts";
5
+ import type { VercelRoute } from "./vercel-negotiation.ts";
3
6
  /**
4
7
  * Platform redirect files for a static build. Astro already emits redirect HTML
5
8
  * (meta-refresh) pages for static output, but that's a soft client redirect.
6
9
  * These give the host a real HTTP 3xx: Netlify/Cloudflare read `_redirects`,
7
10
  * Vercel reads `vercel.json`, and `blume-redirects.json` is a structured
8
- * manifest for anything else (Apache/nginx rules, an edge worker).
11
+ * manifest for anything else (Apache/nginx rules, an edge worker). A pattern
12
+ * redirect (`/beta/:slug*`) gets no redirect page, since Astro can't
13
+ * prerender one for paths it doesn't know; each host file carries it in that
14
+ * host's syntax (see `core/redirect-patterns.ts`).
9
15
  */
10
16
  type Redirect = ResolvedConfig["redirects"][number];
11
17
  /**
@@ -15,34 +21,44 @@ type Redirect = ResolvedConfig["redirects"][number];
15
21
  * - `from` gains only `basePath`. Astro builds the match pattern with
16
22
  * `deployment.base` already applied (`getPattern(segments, config.base)`), so
17
23
  * adding it here would serve the redirect at `{base}{base}/from`.
18
- * - `to` gains the full `{deployment.base}{basePath}` stack. Astro resolves a
19
- * destination that matches a known route by regenerating it from that route's
20
- * segments, which carry no base — and passes an unmatched destination through
21
- * verbatim. Neither path prepends `base`, so a root-relative `to` escapes the
22
- * base entirely (withastro/astro#7774, still the behavior in Astro 7).
24
+ * - `to` gains the full `{deployment.base}{basePath}` stack, or the deployment
25
+ * base alone for a public file (see {@link baseRedirectTarget}). Astro
26
+ * resolves a destination that matches a known route by regenerating it from
27
+ * that route's segments, which carry no base — and passes an unmatched
28
+ * destination through verbatim. Neither path prepends `base`, so a
29
+ * root-relative `to` escapes the base entirely (withastro/astro#7774, still
30
+ * the behavior in Astro 7).
23
31
  *
24
- * Both sides are authored as if mounted at root; external `to` URLs pass
25
- * through. Idempotent, so a hand-written base isn't doubled.
32
+ * Both sides are authored as if mounted at root; `routes` (the served page
33
+ * routes, carrying `basePath`) tell a dotted page route like `/releases/v1.2`
34
+ * from a file. Idempotent, so a hand-written base isn't doubled.
26
35
  */
27
- export declare const applyBaseToAstroRedirects: (redirects: Redirect[], basePath: string, deployBase: string) => Redirect[];
36
+ export declare const applyBaseToAstroRedirects: (redirects: Redirect[], basePath: string, deployBase: string, routes: RouteSet) => Redirect[];
28
37
  /**
29
38
  * Base a redirect for the host platform files below. Unlike Astro's config,
30
- * these are matched against the real served URL, so both sides carry the full
31
- * `{deployment.base}{basePath}` stack.
39
+ * these are matched against the real served URL, so `from` carries the full
40
+ * `{deployment.base}{basePath}` stack, and so does `to` unless it names a
41
+ * public file (see {@link baseRedirectTarget}).
32
42
  */
33
- export declare const applyBaseToPlatformRedirects: (redirects: Redirect[], basePath: string, deployBase: string) => Redirect[];
43
+ export declare const applyBaseToPlatformRedirects: (redirects: Redirect[], basePath: string, deployBase: string, routes: RouteSet) => Redirect[];
34
44
  /**
35
45
  * The configured redirects as the host platform matches them, via
36
- * {@link applyBaseToPlatformRedirects}. The one basing every consumer must
37
- * share: the emitted redirect files and the Cloudflare worker-first redirect
38
- * exemptions both compare these paths against real served URLs.
46
+ * {@link applyBaseToPlatformRedirects}, exact paths ahead of patterns: hosts
47
+ * try rules in order, and an exact redirect wins over a pattern that also
48
+ * covers its path. The one basing every consumer must share: the emitted
49
+ * redirect files and the server wrappers all compare these paths against
50
+ * real served URLs.
39
51
  */
40
- export declare const platformRedirects: (config: ResolvedConfig) => Redirect[];
52
+ export declare const platformRedirects: (project: {
53
+ config: ResolvedConfig;
54
+ manifest: Pick<BlumeProject["manifest"], "routes">;
55
+ }) => Redirect[];
41
56
  /**
42
- * `_redirects` text (Netlify + Cloudflare Pages): `from to status` per line.
43
- * `force` appends Netlify's `!` to each status (`301!`), so the rule wins over
44
- * the redirect page Astro writes at `from`; Cloudflare, which always applies
45
- * its rules first, rejects a line carrying it.
57
+ * `_redirects` text (Netlify + Cloudflare Pages): `from to status` per line,
58
+ * a pattern as `:placeholder`s and a `*` splat the destination reads as
59
+ * `:splat`. `force` appends Netlify's `!` to each status (`301!`), so the rule
60
+ * wins over the redirect page Astro writes at `from`; Cloudflare, which always
61
+ * applies its rules first, rejects a line carrying it.
46
62
  */
47
63
  export declare const buildNetlifyRedirects: (redirects: Redirect[], force?: boolean) => string;
48
64
  /**
@@ -50,9 +66,32 @@ export declare const buildNetlifyRedirects: (redirects: Redirect[], force?: bool
50
66
  * header rules are given (see `buildVercelHeaders`). Uses `statusCode` (Vercel's
51
67
  * alternative to the boolean `permanent`) so the configured code ships exactly:
52
68
  * `permanent` would silently coerce a 301 to 308 and a 302 to 307, diverging
53
- * from the `_redirects` file, which preserves exact codes.
69
+ * from the `_redirects` file, which preserves exact codes. A `source` is a
70
+ * `path-to-regexp` pattern, so each literal run of a `from` path is escaped:
71
+ * unescaped, `/c++-guide` fails the whole config and `/faq(old)` never
72
+ * matches. A pattern's captures are `path-to-regexp` params.
54
73
  */
55
74
  export declare const buildVercelConfig: (redirects: Redirect[], headers?: readonly VercelHeader[]) => string;
56
- /** Structured manifest for hosts that need manual wiring. */
75
+ /**
76
+ * The pattern redirects as `_redirects` entries, for the `redirects` of a
77
+ * Netlify server build's Frameworks API config (see
78
+ * {@link buildNetlifyRedirects} for the syntax).
79
+ */
80
+ export declare const netlifyPatternRedirects: (redirects: Redirect[]) => {
81
+ from: string;
82
+ status: number;
83
+ to: string;
84
+ }[];
85
+ /**
86
+ * The pattern redirects as Build Output API routes, for a Vercel server
87
+ * build: the adapter routes only the exact redirects Astro's config carries.
88
+ * Each matches the served path, a trailing slash optional, and fills its
89
+ * `Location` from numbered captures, as the adapter's own redirect routes do.
90
+ */
91
+ export declare const vercelPatternRoutes: (redirects: Redirect[]) => VercelRoute[];
92
+ /**
93
+ * Structured manifest for hosts that need manual wiring. A pattern stays as
94
+ * configured (`/beta/:slug*`), for the rule it becomes to be written by hand.
95
+ */
57
96
  export declare const buildRedirectManifest: (redirects: Redirect[]) => string;
58
97
  export {};
@@ -108,3 +108,12 @@ export declare const buildNegotiationRoutes: (routePaths: readonly string[], hom
108
108
  * `handle: "filesystem"` marker to anchor the splice.
109
109
  */
110
110
  export declare const injectNegotiationRoutes: (configText: string, routePaths: readonly string[], homeLinkHeader?: string | null, contentTypeOverrides?: Record<string, string>, homeTokens?: number, notFound?: NotFoundVariants, corsPaths?: readonly string[], svgAssets?: boolean) => string | null;
111
+ /**
112
+ * Splice routes for the pattern redirects (see `vercelPatternRoutes`) into a
113
+ * Build Output `config.json`, in the main phase just ahead of
114
+ * `handle: "filesystem"`: after the exact redirects the adapter puts first,
115
+ * so an exact path still wins. A second pass replaces its own routes. Returns
116
+ * the updated JSON text, or `null` when there is nowhere safe to splice: an
117
+ * unparsable config, no `routes` array, or no `handle: "filesystem"` marker.
118
+ */
119
+ export declare const injectRedirectRoutes: (configText: string, redirectRoutes: readonly VercelRoute[]) => string | null;
@@ -7,7 +7,20 @@
7
7
  * language label.
8
8
  * - the `lineNumbers` keyword (```ts file.ts lineNumbers) becomes
9
9
  * `data-line-numbers`; the theme renders a counter-driven line-number gutter.
10
+ * - the `wrap` keyword becomes `data-wrap`: this block's long lines wrap
11
+ * instead of scrolling, as `markdown.code.wrap` does for every block.
12
+ * - the `expandable` keyword becomes `data-expandable` on a block of
13
+ * {@link EXPANDABLE_MIN_LINES} lines or more: the theme shows its first
14
+ * {@link EXPANDABLE_VISIBLE_LINES} lines, and the page script adds a toggle
15
+ * that shows the rest in full. A shorter block renders as it is.
10
16
  */
17
+ /** The lines a collapsed `expandable` block shows. */
18
+ export declare const EXPANDABLE_VISIBLE_LINES = 10;
19
+ /**
20
+ * The lines a block needs before `expandable` collapses it: a few more than it
21
+ * shows, so the toggle never hides a line or two behind a click.
22
+ */
23
+ export declare const EXPANDABLE_MIN_LINES = 16;
11
24
  /** The slice of Shiki's transformer `this` context Blume reads. */
12
25
  interface CodeMetaContext {
13
26
  options: {
@@ -15,6 +28,8 @@ interface CodeMetaContext {
15
28
  __raw?: string;
16
29
  };
17
30
  };
31
+ /** The block's code, as highlighted. */
32
+ source?: string;
18
33
  }
19
34
  /** The `<pre>` hast node a Shiki `pre` hook receives. */
20
35
  interface PreNode {
@@ -27,6 +42,8 @@ export interface CodeTitleTransformer {
27
42
  }
28
43
  /** The title a fence's meta string promotes to `data-title`, if any. */
29
44
  export declare const parseCodeTitle: (raw: string | undefined) => string | undefined;
45
+ /** How many lines a block's code runs to, a trailing newline aside. */
46
+ export declare const lineCount: (source?: string) => number;
30
47
  /** Build the transformer. Runs after Shiki's built-in `data-language` hook. */
31
48
  export declare const codeTitleTransformer: () => CodeTitleTransformer;
32
49
  export {};
@@ -0,0 +1,62 @@
1
+ import type { MdastNode, MdastVisitorContext } from "./mdast.ts";
2
+ export interface DirectiveNode extends MdastNode {
3
+ attributes?: Record<string, string | null | undefined> | null;
4
+ children?: MdastNode[] | null;
5
+ name: string;
6
+ position?: {
7
+ start?: {
8
+ offset?: number;
9
+ };
10
+ end?: {
11
+ offset?: number;
12
+ };
13
+ };
14
+ }
15
+ /**
16
+ * The visitor-context slice the directive visitors use. `source` is the page
17
+ * the directive offsets index into; without it the literal fallback rebuilds
18
+ * a directive from its node instead. `parent` walks up to an enclosing
19
+ * container directive, which renders the directives inside it itself.
20
+ */
21
+ interface DirectiveVisitorContext extends MdastVisitorContext {
22
+ parent?: (node: MdastNode) => MdastNode | undefined;
23
+ source?: string;
24
+ }
25
+ /** Directive names that map directly onto a Callout type. */
26
+ export declare const CALLOUT_TYPES: ReadonlySet<string>;
27
+ /** Friendly aliases for the canonical Callout types. */
28
+ interface CalloutAliases {
29
+ [alias: string]: string;
30
+ }
31
+ export declare const CALLOUT_ALIASES: Readonly<CalloutAliases>;
32
+ /** Resolve a directive name to a Callout type, or `null` if it is not one. */
33
+ export declare const calloutTypeFor: (name: string) => string | null;
34
+ /**
35
+ * A text or leaf directive exactly as the author wrote it. The slice by
36
+ * offsets is the exact text — `[label]` and `{attrs}` included — and is
37
+ * trusted only when it opens with the directive's own marker and name;
38
+ * content an `<include>` spliced in carries no offsets into this page, so it
39
+ * is rebuilt from the node instead.
40
+ */
41
+ export declare const directiveSource: (node: DirectiveNode, marker: string, source: string) => string;
42
+ /**
43
+ * Satteri MDAST plugin for directives. Container directives (`:::note`,
44
+ * `:::warning`, `:::tip`, …) map onto Blume's `<Callout>` component, and any
45
+ * other container renders its body between its literal fence lines (see
46
+ * {@link renderContainer}).
47
+ *
48
+ * Blume handles no text (`:name`) or leaf (`::name`) directives, and prose is
49
+ * full of text that parses as one — `16:9`, `10:30am`, `og:image`,
50
+ * `pets:read` — so both render as the literal source the author wrote instead
51
+ * of vanishing.
52
+ */
53
+ export declare const directiveToCalloutPlugin: () => {
54
+ containerDirective(node: DirectiveNode, ctx: DirectiveVisitorContext): void;
55
+ leafDirective: (node: DirectiveNode, ctx: DirectiveVisitorContext) => void;
56
+ name: string;
57
+ options: {
58
+ position: boolean;
59
+ };
60
+ textDirective: (node: DirectiveNode, ctx: DirectiveVisitorContext) => void;
61
+ };
62
+ export {};
@@ -8,8 +8,9 @@ export declare const MARKDOWN_FEATURES: {
8
8
  };
9
9
  /**
10
10
  * The `.mdx` feature set: Markdown's plus `:::` directives (→ `<Callout>`) and
11
- * block-only math — `singleDollarTextMath: false` keeps a bare `$` (currency,
12
- * shell, code) as literal text and only parses `$$…$$`.
11
+ * math — `singleDollarTextMath: false` keeps a bare `$` (currency, shell,
12
+ * code) as literal text and only parses `$$…$$`, as a block on its own lines
13
+ * or inline within a sentence.
13
14
  */
14
15
  export declare const MDX_FEATURES: {
15
16
  directive: true;
@@ -19,3 +20,24 @@ export declare const MDX_FEATURES: {
19
20
  subscript: true;
20
21
  superscript: true;
21
22
  };
23
+ /**
24
+ * The feature sets for a page body, once its front matter is off. Astro reads
25
+ * a page's front matter itself and hands the renderer the body alone, and the
26
+ * search extractor strips it first too — so front matter parsing is off here:
27
+ * left on, a body that opens with a `---` rule read everything up to the next
28
+ * `---` line as front matter and dropped it from the page.
29
+ */
30
+ export declare const MARKDOWN_BODY_FEATURES: {
31
+ frontmatter: false;
32
+ subscript: true;
33
+ superscript: true;
34
+ };
35
+ export declare const MDX_BODY_FEATURES: {
36
+ frontmatter: false;
37
+ directive: true;
38
+ math: {
39
+ singleDollarTextMath: false;
40
+ };
41
+ subscript: true;
42
+ superscript: true;
43
+ };