blume 2.1.0 → 2.1.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 (450) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/dist/cli/{chunk-ga0pf4aj.js → chunk-0n9xkp3d.js} +12 -3
  3. package/dist/cli/{chunk-ga0pf4aj.js.map → chunk-0n9xkp3d.js.map} +3 -3
  4. package/dist/cli/{chunk-43zcf4gz.js → chunk-0pmb4tr4.js} +541 -368
  5. package/dist/cli/chunk-0pmb4tr4.js.map +35 -0
  6. package/dist/cli/{chunk-9geymqns.js → chunk-0w6hs479.js} +15 -15
  7. package/dist/cli/{chunk-xkz5xbtv.js → chunk-124fvmzq.js} +2802 -1422
  8. package/dist/cli/chunk-124fvmzq.js.map +220 -0
  9. package/dist/cli/chunk-150jk7km.js +52 -0
  10. package/dist/cli/chunk-150jk7km.js.map +10 -0
  11. package/dist/cli/{chunk-y4ykbark.js → chunk-1f882900.js} +2 -2
  12. package/dist/cli/{chunk-5ffywsmb.js → chunk-297ajdcv.js} +8 -6
  13. package/dist/cli/{chunk-5ffywsmb.js.map → chunk-297ajdcv.js.map} +3 -3
  14. package/dist/cli/{chunk-h2a48yhd.js → chunk-32khwcb6.js} +120 -16
  15. package/dist/cli/{chunk-h2a48yhd.js.map → chunk-32khwcb6.js.map} +10 -10
  16. package/dist/cli/{chunk-5cg2rzgf.js → chunk-36bxs9c7.js} +20 -49
  17. package/dist/cli/{chunk-5cg2rzgf.js.map → chunk-36bxs9c7.js.map} +4 -5
  18. package/dist/cli/{chunk-py62fewh.js → chunk-53jqw8z0.js} +3 -3
  19. package/dist/cli/{chunk-5wj2qwn2.js → chunk-58bt3hag.js} +4 -4
  20. package/dist/cli/{chunk-e7vvk5ya.js → chunk-5cmts6dv.js} +3 -3
  21. package/dist/cli/{chunk-y5h4r2y0.js → chunk-60hz265r.js} +15 -5
  22. package/dist/cli/chunk-60hz265r.js.map +10 -0
  23. package/dist/cli/chunk-74wfhv79.js +65 -0
  24. package/dist/cli/chunk-74wfhv79.js.map +10 -0
  25. package/dist/cli/{chunk-g2z9x01v.js → chunk-9qzgg6mj.js} +3 -3
  26. package/dist/cli/{chunk-q3wxxq39.js → chunk-a57yh0h9.js} +5 -5
  27. package/dist/cli/{chunk-713mngdq.js → chunk-ave1wcbr.js} +76 -10
  28. package/dist/cli/chunk-ave1wcbr.js.map +14 -0
  29. package/dist/cli/{chunk-2n4ps1b3.js → chunk-bqxaqn5p.js} +40 -22
  30. package/dist/cli/chunk-bqxaqn5p.js.map +15 -0
  31. package/dist/cli/{chunk-jnwj5kjj.js → chunk-bxwhtvw8.js} +20 -7
  32. package/dist/cli/{chunk-jnwj5kjj.js.map → chunk-bxwhtvw8.js.map} +3 -3
  33. package/dist/cli/chunk-ckrcm08h.js +324 -0
  34. package/dist/cli/chunk-ckrcm08h.js.map +14 -0
  35. package/dist/cli/{chunk-2f3ndkpw.js → chunk-desvm72z.js} +3 -3
  36. package/dist/cli/{chunk-gp84za0h.js → chunk-dhwtqnnd.js} +2 -2
  37. package/dist/cli/{chunk-4h8z9vv5.js → chunk-dpy8qdjf.js} +93 -47
  38. package/dist/cli/chunk-dpy8qdjf.js.map +17 -0
  39. package/dist/cli/{chunk-2f7n4qzt.js → chunk-dqhg54mr.js} +1 -1
  40. package/dist/cli/{chunk-0gz36akr.js → chunk-dv2z0rzf.js} +21 -5
  41. package/dist/cli/chunk-dv2z0rzf.js.map +12 -0
  42. package/dist/cli/{chunk-cm89scdv.js → chunk-es8h0v3j.js} +9 -11
  43. package/dist/cli/{chunk-cm89scdv.js.map → chunk-es8h0v3j.js.map} +3 -3
  44. package/dist/cli/{chunk-zhvd6adm.js → chunk-gfc5fqvf.js} +14 -14
  45. package/dist/cli/{chunk-nd1821sk.js → chunk-gxtg6ed2.js} +33 -19
  46. package/dist/cli/chunk-gxtg6ed2.js.map +10 -0
  47. package/dist/cli/{chunk-p804f3pe.js → chunk-hvcxng5f.js} +6 -6
  48. package/dist/cli/{chunk-ta27feev.js → chunk-j1x92mx9.js} +21 -2
  49. package/dist/cli/chunk-j1x92mx9.js.map +10 -0
  50. package/dist/cli/{chunk-rekqz4qg.js → chunk-k3gr1nm9.js} +19 -16
  51. package/dist/cli/chunk-k3gr1nm9.js.map +10 -0
  52. package/dist/cli/{chunk-1n228xqb.js → chunk-kdpzw38a.js} +2 -2
  53. package/dist/cli/{chunk-cy5bm0j0.js → chunk-ms9z66nz.js} +2 -2
  54. package/dist/cli/{chunk-cy5bm0j0.js.map → chunk-ms9z66nz.js.map} +2 -2
  55. package/dist/cli/{chunk-zf748avv.js → chunk-nbyvgnnm.js} +193 -286
  56. package/dist/cli/chunk-nbyvgnnm.js.map +36 -0
  57. package/dist/cli/{chunk-6bm0xpgd.js → chunk-s0bdnc7v.js} +2 -2
  58. package/dist/cli/{chunk-yxmk4pec.js → chunk-sc93apfs.js} +17 -16
  59. package/dist/cli/{chunk-yxmk4pec.js.map → chunk-sc93apfs.js.map} +3 -3
  60. package/dist/cli/{chunk-cmtcnh9f.js → chunk-tfycddbt.js} +2 -2
  61. package/dist/cli/{chunk-9xr4dgee.js → chunk-twy7psdz.js} +29 -16
  62. package/dist/cli/chunk-twy7psdz.js.map +10 -0
  63. package/dist/cli/{chunk-ntv4qrt7.js → chunk-y4msrwm9.js} +15 -15
  64. package/dist/cli/{chunk-yj17vs39.js → chunk-ydp3065p.js} +5 -5
  65. package/dist/cli/index.js +24 -19
  66. package/dist/cli/index.js.map +3 -3
  67. package/dist/types/ai/ask-context.d.ts +6 -2
  68. package/dist/types/ai/ask.d.ts +24 -5
  69. package/dist/types/ai/component-markdown.d.ts +2 -0
  70. package/dist/types/ai/openapi-components.d.ts +4 -1
  71. package/dist/types/analytics/clics.d.ts +37 -0
  72. package/dist/types/analytics/index.d.ts +2 -0
  73. package/dist/types/analytics/schema.d.ts +18 -0
  74. package/dist/types/astro/integration.d.ts +11 -4
  75. package/dist/types/astro/markdown-negotiation.d.ts +3 -0
  76. package/dist/types/astro/pages.d.ts +10 -0
  77. package/dist/types/cli/init/scaffold.d.ts +1 -1
  78. package/dist/types/components/content/api-field.d.ts +4 -1
  79. package/dist/types/components/content/api-page.d.ts +6 -1
  80. package/dist/types/components/openapi/code-samples.d.ts +29 -0
  81. package/dist/types/components/openapi/helpers.d.ts +22 -1
  82. package/dist/types/components/openapi/security.d.ts +10 -0
  83. package/dist/types/components/openapi/snippets.d.ts +60 -0
  84. package/dist/types/core/changelog-index.d.ts +8 -0
  85. package/dist/types/core/config-input.d.ts +37 -6
  86. package/dist/types/core/data.d.ts +4 -0
  87. package/dist/types/core/i18n-ui.d.ts +2 -0
  88. package/dist/types/core/links.d.ts +8 -0
  89. package/dist/types/core/powered-by.d.ts +12 -0
  90. package/dist/types/core/probe.d.ts +2 -0
  91. package/dist/types/core/project-graph.d.ts +6 -0
  92. package/dist/types/core/redirect-patterns.d.ts +11 -3
  93. package/dist/types/core/schema.d.ts +228 -3
  94. package/dist/types/core/sources/cache.d.ts +3 -0
  95. package/dist/types/core/sources/contentful-rich-text.d.ts +11 -2
  96. package/dist/types/core/sources/contentful.d.ts +17 -1
  97. package/dist/types/core/sources/lexical.d.ts +5 -0
  98. package/dist/types/core/sources/lower.d.ts +10 -2
  99. package/dist/types/core/sources/normalize.d.ts +20 -1
  100. package/dist/types/core/sources/notion.d.ts +8 -0
  101. package/dist/types/core/sources/remote.d.ts +37 -10
  102. package/dist/types/core/sources/sanity.d.ts +1 -1
  103. package/dist/types/core/types.d.ts +17 -0
  104. package/dist/types/deploy/adapter-output.d.ts +2 -1
  105. package/dist/types/deploy/adapters/cloudflare.d.ts +7 -5
  106. package/dist/types/deploy/adapters/node.d.ts +58 -23
  107. package/dist/types/deploy/adapters/registry.d.ts +10 -0
  108. package/dist/types/deploy/adapters/types.d.ts +3 -2
  109. package/dist/types/deploy/cloudflare-negotiation.d.ts +5 -2
  110. package/dist/types/deploy/node-headers.d.ts +12 -4
  111. package/dist/types/deploy/platforms/cloudflare.d.ts +10 -7
  112. package/dist/types/deploy/platforms/node.d.ts +3 -1
  113. package/dist/types/deploy/platforms/types.d.ts +18 -7
  114. package/dist/types/deploy/platforms/vercel.d.ts +21 -2
  115. package/dist/types/deploy/redirects.d.ts +17 -1
  116. package/dist/types/deploy/sitemap.d.ts +2 -1
  117. package/dist/types/deploy/vercel-negotiation.d.ts +44 -21
  118. package/dist/types/narration/build.d.ts +34 -12
  119. package/dist/types/narration/provider.d.ts +96 -8
  120. package/dist/types/openapi/checks.d.ts +27 -0
  121. package/dist/types/openapi/graphql.d.ts +6 -0
  122. package/dist/types/openapi/model.d.ts +15 -4
  123. package/dist/types/openapi/parse.d.ts +3 -0
  124. package/dist/types/openapi/references.d.ts +16 -0
  125. package/dist/types/openapi/sentence.d.ts +11 -1
  126. package/dist/types/ratelimit/index.d.ts +1 -1
  127. package/dist/types/ratelimit/schema.d.ts +8 -0
  128. package/dist/types/ratelimit/upstash.d.ts +39 -14
  129. package/dist/types/reference/graphql.d.ts +76 -1
  130. package/dist/types/reference/index.d.ts +1 -1
  131. package/dist/types/reference/openapi.d.ts +2 -2
  132. package/dist/types/reference/options.d.ts +37 -1
  133. package/dist/types/reference/schema.d.ts +84 -0
  134. package/dist/types/search/adapters/registry.d.ts +3 -0
  135. package/dist/types/search/adapters/typesense.d.ts +14 -4
  136. package/dist/types/search/build.d.ts +3 -1
  137. package/dist/types/search/orama-index.d.ts +9 -9
  138. package/dist/types/search/sync/algolia.d.ts +5 -2
  139. package/dist/types/search/sync/index.d.ts +3 -1
  140. package/dist/types/search/sync/typesense.d.ts +11 -7
  141. package/dist/types/seo/jsonld.d.ts +11 -6
  142. package/dist/types/sources/contentful.d.ts +16 -0
  143. package/dist/types/sources/github-releases.d.ts +8 -1
  144. package/dist/types/sources/notion.d.ts +8 -0
  145. package/dist/types/sources/payload.d.ts +2 -0
  146. package/dist/types/sources/registry.d.ts +63 -0
  147. package/dist/types/sources/shared.d.ts +3 -0
  148. package/dist/types/sources/strapi.d.ts +2 -0
  149. package/docs/01-quickstart.mdx +4 -2
  150. package/docs/02-deployment.mdx +59 -13
  151. package/docs/03-upgrading.mdx +2 -1
  152. package/docs/04-migrating.mdx +9 -9
  153. package/docs/08-faq.mdx +12 -12
  154. package/docs/advanced/changelog.mdx +30 -2
  155. package/docs/advanced/custom-pages.mdx +1 -1
  156. package/docs/advanced/skills.mdx +1 -1
  157. package/docs/cli/audit.mdx +30 -7
  158. package/docs/cli/doctor.mdx +6 -2
  159. package/docs/cli/evals.mdx +4 -4
  160. package/docs/cli/translate.mdx +1 -0
  161. package/docs/cli/validate.mdx +4 -3
  162. package/docs/configuration/analytics.mdx +19 -1
  163. package/docs/configuration/assistant.mdx +6 -2
  164. package/docs/configuration/customization.mdx +4 -2
  165. package/docs/configuration/export.mdx +5 -3
  166. package/docs/configuration/index.mdx +4 -2
  167. package/docs/configuration/narration.mdx +43 -6
  168. package/docs/configuration/rate-limiting.mdx +23 -2
  169. package/docs/configuration/search.mdx +37 -14
  170. package/docs/content/components.mdx +2 -2
  171. package/docs/content/frontmatter.mdx +5 -3
  172. package/docs/content/i18n.mdx +2 -2
  173. package/docs/content/includes.mdx +1 -1
  174. package/docs/content/navigation.mdx +8 -6
  175. package/docs/content/sources/contentful.mdx +9 -4
  176. package/docs/content/sources/custom.mdx +7 -3
  177. package/docs/content/sources/github-releases.mdx +12 -2
  178. package/docs/content/sources/index.mdx +3 -3
  179. package/docs/content/sources/notion.mdx +17 -2
  180. package/docs/content/sources/obsidian.mdx +3 -1
  181. package/docs/content/sources/payload.mdx +5 -2
  182. package/docs/content/sources/remote-mdx.mdx +6 -0
  183. package/docs/content/sources/sanity.mdx +4 -2
  184. package/docs/content/sources/strapi.mdx +5 -2
  185. package/docs/content/syntax.mdx +2 -2
  186. package/docs/discoverability/agent-discovery.mdx +1 -1
  187. package/docs/discoverability/index.mdx +1 -1
  188. package/docs/discoverability/json-api.mdx +2 -0
  189. package/docs/discoverability/llms-txt.mdx +1 -1
  190. package/docs/discoverability/markdown.mdx +3 -1
  191. package/docs/discoverability/mcp.mdx +6 -0
  192. package/docs/discoverability/sitemap-and-robots.mdx +1 -1
  193. package/docs/discoverability/structured-data.mdx +8 -6
  194. package/docs/references/api-pages.mdx +1 -1
  195. package/docs/references/asyncapi.mdx +5 -1
  196. package/docs/references/graphql.mdx +15 -1
  197. package/docs/references/openapi.mdx +64 -8
  198. package/package.json +9 -9
  199. package/skills/blume/SKILL.md +1 -1
  200. package/skills/blume-migrate/SKILL.md +2 -2
  201. package/skills/blume-migrate/assets/{oxfmt@0.67.0.patch → oxfmt@0.71.0.patch} +7 -7
  202. package/skills/blume-migrate/references/docusaurus.md +4 -4
  203. package/skills/blume-migrate/references/fumadocs.md +17 -13
  204. package/skills/blume-migrate/references/monorepo.md +5 -5
  205. package/skills/blume-migrate/references/nextra.md +8 -5
  206. package/skills/blume-migrate/references/starlight.md +9 -7
  207. package/src/ai/ask-context.ts +33 -3
  208. package/src/ai/ask-limits.ts +13 -0
  209. package/src/ai/ask.ts +24 -6
  210. package/src/ai/changelog-markdown.ts +11 -6
  211. package/src/ai/component-markdown.ts +1 -1
  212. package/src/ai/cors.ts +12 -3
  213. package/src/ai/mcp/query.ts +14 -6
  214. package/src/ai/openapi-components.ts +28 -4
  215. package/src/ai/relative-links.ts +4 -38
  216. package/src/analytics/clics.ts +58 -0
  217. package/src/analytics/head.ts +5 -0
  218. package/src/analytics/index.ts +2 -0
  219. package/src/analytics/schema.ts +2 -0
  220. package/src/astro/generate.ts +91 -56
  221. package/src/astro/integration.ts +72 -22
  222. package/src/astro/markdown-negotiation.ts +3 -0
  223. package/src/astro/module-types.ts +3 -1
  224. package/src/astro/pages.ts +23 -0
  225. package/src/astro/render-deps.ts +10 -5
  226. package/src/astro/runtime-deps.ts +23 -2
  227. package/src/astro/templates.ts +129 -81
  228. package/src/audit/catalog.ts +19 -3
  229. package/src/audit/checks/links.ts +14 -1
  230. package/src/audit/checks/network.ts +110 -6
  231. package/src/audit/checks/redirects.ts +6 -4
  232. package/src/audit/checks/robots.ts +58 -2
  233. package/src/audit/run.ts +3 -0
  234. package/src/audit/types.ts +2 -0
  235. package/src/audit/url.ts +14 -5
  236. package/src/blume-modules.d.ts +5 -1
  237. package/src/cli/args.ts +51 -0
  238. package/src/cli/build-failure.ts +23 -0
  239. package/src/cli/commands/audit.ts +10 -1
  240. package/src/cli/commands/dev.ts +18 -2
  241. package/src/cli/commands/doctor.ts +45 -12
  242. package/src/cli/commands/eval.ts +36 -4
  243. package/src/cli/commands/init.ts +6 -4
  244. package/src/cli/commands/validate.ts +10 -1
  245. package/src/cli/init/scaffold.ts +9 -6
  246. package/src/cli/prepare.ts +6 -3
  247. package/src/cli/required-secrets.ts +3 -2
  248. package/src/components/content/ApiPlayground.astro +6 -2
  249. package/src/components/content/api-field.ts +4 -1
  250. package/src/components/content/api-page.ts +31 -7
  251. package/src/components/content/mermaid-element.ts +15 -1
  252. package/src/components/content/view-switcher.ts +7 -4
  253. package/src/components/islands/hooks.ts +27 -1
  254. package/src/components/layout/NavTree.astro +49 -5
  255. package/src/components/layout/NavTreeScript.astro +18 -0
  256. package/src/components/layout/PageActions.astro +139 -24
  257. package/src/components/layout/PageLayout.astro +13 -3
  258. package/src/components/layout/RootLayout.astro +27 -14
  259. package/src/components/layout/Search.astro +17 -3
  260. package/src/components/layout/TableOfContents.astro +24 -17
  261. package/src/components/layout/analytics-client.ts +8 -8
  262. package/src/components/layout/head-scripts.ts +6 -1
  263. package/src/components/layout/search/algolia.ts +10 -1
  264. package/src/components/layout/search/analytics.ts +42 -14
  265. package/src/components/layout/search/endpoint.ts +48 -5
  266. package/src/components/layout/search/pagefind.ts +114 -5
  267. package/src/components/layout/search/types.ts +12 -0
  268. package/src/components/layout/search/typesense.ts +18 -6
  269. package/src/components/openapi/AsyncApiOperation.astro +14 -7
  270. package/src/components/openapi/Authorization.astro +10 -0
  271. package/src/components/openapi/GraphqlOperation.astro +5 -0
  272. package/src/components/openapi/Operation.astro +24 -1
  273. package/src/components/openapi/ParametersTable.astro +8 -4
  274. package/src/components/openapi/Playground.astro +7 -1
  275. package/src/components/openapi/RequestBody.astro +19 -2
  276. package/src/components/openapi/Responses.astro +1 -0
  277. package/src/components/openapi/SchemaTable.astro +15 -3
  278. package/src/components/openapi/async-snippets.ts +61 -5
  279. package/src/components/openapi/async.ts +123 -29
  280. package/src/components/openapi/graphql-helpers.ts +35 -12
  281. package/src/components/openapi/helpers.ts +36 -2
  282. package/src/components/openapi/message-model.ts +54 -11
  283. package/src/components/openapi/message.ts +14 -4
  284. package/src/components/openapi/operation-model.ts +16 -7
  285. package/src/components/openapi/playground-client.ts +77 -58
  286. package/src/components/openapi/playground-schema.ts +1 -1
  287. package/src/components/openapi/schema-tree.ts +44 -14
  288. package/src/components/openapi/security.ts +10 -0
  289. package/src/components/openapi/snippets.ts +5 -3
  290. package/src/components/openapi/validate-json.ts +4 -3
  291. package/src/components/powered-by-middleware.ts +33 -0
  292. package/src/core/changelog-index.ts +31 -1
  293. package/src/core/component-diagnostics.ts +53 -0
  294. package/src/core/component-overrides.ts +32 -0
  295. package/src/core/config-input.ts +42 -6
  296. package/src/core/data.ts +2 -0
  297. package/src/core/diagnostics.ts +5 -0
  298. package/src/core/i18n-ui.ts +2 -0
  299. package/src/core/includes.ts +1 -1
  300. package/src/core/links.ts +47 -17
  301. package/src/core/powered-by.ts +12 -0
  302. package/src/core/probe.ts +26 -6
  303. package/src/core/project-graph.ts +59 -18
  304. package/src/core/redirect-patterns.ts +36 -7
  305. package/src/core/schema.ts +26 -6
  306. package/src/core/sources/cache.ts +6 -0
  307. package/src/core/sources/contentful-rich-text.ts +29 -6
  308. package/src/core/sources/contentful.ts +135 -25
  309. package/src/core/sources/filesystem.ts +26 -4
  310. package/src/core/sources/github-releases.ts +12 -1
  311. package/src/core/sources/lexical.ts +15 -10
  312. package/src/core/sources/lower.ts +19 -3
  313. package/src/core/sources/mdx-remote.ts +62 -10
  314. package/src/core/sources/normalize.ts +227 -41
  315. package/src/core/sources/notion.ts +34 -10
  316. package/src/core/sources/obsidian.ts +16 -3
  317. package/src/core/sources/payload.ts +38 -15
  318. package/src/core/sources/remote.ts +72 -15
  319. package/src/core/sources/resolve.ts +11 -1
  320. package/src/core/sources/sanity.ts +43 -25
  321. package/src/core/sources/strapi.ts +2 -2
  322. package/src/core/types.ts +18 -0
  323. package/src/core/ui-packs/ar.ts +1 -0
  324. package/src/core/ui-packs/bg.ts +1 -0
  325. package/src/core/ui-packs/bn.ts +1 -0
  326. package/src/core/ui-packs/ca.ts +1 -0
  327. package/src/core/ui-packs/cs.ts +1 -0
  328. package/src/core/ui-packs/da.ts +1 -0
  329. package/src/core/ui-packs/de.ts +1 -0
  330. package/src/core/ui-packs/el.ts +1 -0
  331. package/src/core/ui-packs/es.ts +1 -0
  332. package/src/core/ui-packs/fa.ts +1 -0
  333. package/src/core/ui-packs/fi.ts +1 -0
  334. package/src/core/ui-packs/fr.ts +1 -0
  335. package/src/core/ui-packs/he.ts +1 -0
  336. package/src/core/ui-packs/hi.ts +1 -0
  337. package/src/core/ui-packs/hr.ts +1 -0
  338. package/src/core/ui-packs/hu.ts +1 -0
  339. package/src/core/ui-packs/id.ts +1 -0
  340. package/src/core/ui-packs/it.ts +1 -0
  341. package/src/core/ui-packs/ja.ts +1 -0
  342. package/src/core/ui-packs/ko.ts +1 -0
  343. package/src/core/ui-packs/nl.ts +1 -0
  344. package/src/core/ui-packs/no.ts +1 -0
  345. package/src/core/ui-packs/pl.ts +1 -0
  346. package/src/core/ui-packs/pt-br.ts +1 -0
  347. package/src/core/ui-packs/pt.ts +1 -0
  348. package/src/core/ui-packs/ro.ts +1 -0
  349. package/src/core/ui-packs/ru.ts +1 -0
  350. package/src/core/ui-packs/sk.ts +1 -0
  351. package/src/core/ui-packs/sr.ts +1 -0
  352. package/src/core/ui-packs/sv.ts +1 -0
  353. package/src/core/ui-packs/th.ts +1 -0
  354. package/src/core/ui-packs/tr.ts +1 -0
  355. package/src/core/ui-packs/uk.ts +1 -0
  356. package/src/core/ui-packs/vi.ts +1 -0
  357. package/src/core/ui-packs/zh-tw.ts +1 -0
  358. package/src/core/ui-packs/zh.ts +1 -0
  359. package/src/deploy/adapter-output.ts +7 -2
  360. package/src/deploy/adapters/cloudflare.ts +7 -5
  361. package/src/deploy/adapters/node.ts +47 -9
  362. package/src/deploy/adapters/types.ts +7 -3
  363. package/src/deploy/artifacts.ts +2 -1
  364. package/src/deploy/cloudflare-negotiation.ts +36 -7
  365. package/src/deploy/headers.ts +15 -1
  366. package/src/deploy/node-headers.ts +32 -20
  367. package/src/deploy/platforms/cloudflare.ts +14 -9
  368. package/src/deploy/platforms/netlify.ts +2 -1
  369. package/src/deploy/platforms/node.ts +12 -2
  370. package/src/deploy/platforms/types.ts +21 -7
  371. package/src/deploy/platforms/vercel.ts +115 -17
  372. package/src/deploy/redirects.ts +66 -6
  373. package/src/deploy/rss.ts +3 -1
  374. package/src/deploy/sitemap.ts +39 -5
  375. package/src/deploy/vercel-negotiation.ts +325 -103
  376. package/src/eval/agents.ts +18 -1
  377. package/src/eval/prompts.ts +6 -3
  378. package/src/eval/report.ts +34 -13
  379. package/src/eval/run.ts +5 -0
  380. package/src/markdown/base-links.ts +15 -14
  381. package/src/markdown/package-commands.ts +9 -8
  382. package/src/markdown/relative-links.ts +3 -2
  383. package/src/narration/build.ts +218 -40
  384. package/src/narration/provider.ts +89 -9
  385. package/src/openapi/checks.ts +273 -0
  386. package/src/openapi/graphql-build.ts +21 -0
  387. package/src/openapi/graphql.ts +11 -0
  388. package/src/openapi/model.ts +15 -3
  389. package/src/openapi/parse.ts +127 -2
  390. package/src/openapi/references.ts +43 -3
  391. package/src/openapi/render-mdx.ts +68 -8
  392. package/src/openapi/sentence.ts +29 -2
  393. package/src/openapi/source.ts +39 -14
  394. package/src/ratelimit/index.ts +1 -1
  395. package/src/ratelimit/runtime.ts +37 -19
  396. package/src/ratelimit/upstash.ts +40 -10
  397. package/src/reference/graphql.ts +15 -1
  398. package/src/reference/index.ts +1 -0
  399. package/src/reference/openapi.ts +2 -2
  400. package/src/reference/options.ts +29 -1
  401. package/src/registry/eject.ts +8 -2
  402. package/src/search/adapters/locale-scope.ts +30 -0
  403. package/src/search/adapters/typesense.ts +14 -4
  404. package/src/search/build.ts +21 -3
  405. package/src/search/orama-index.ts +163 -31
  406. package/src/search/source-pages.ts +29 -0
  407. package/src/search/sync/algolia.ts +99 -9
  408. package/src/search/sync/index.ts +52 -13
  409. package/src/search/sync/typesense.ts +72 -27
  410. package/src/seo/jsonld.ts +38 -20
  411. package/src/sources/contentful.ts +12 -0
  412. package/src/sources/github-releases.ts +7 -1
  413. package/src/sources/notion.ts +7 -0
  414. package/src/sources/shared.ts +3 -0
  415. package/src/theme/color.ts +9 -10
  416. package/src/theme/entry.ts +43 -6
  417. package/src/translate/validate.ts +23 -1
  418. package/dist/cli/chunk-0gz36akr.js.map +0 -12
  419. package/dist/cli/chunk-2n4ps1b3.js.map +0 -15
  420. package/dist/cli/chunk-43zcf4gz.js.map +0 -36
  421. package/dist/cli/chunk-4ejxbzee.js +0 -39
  422. package/dist/cli/chunk-4ejxbzee.js.map +0 -10
  423. package/dist/cli/chunk-4h8z9vv5.js.map +0 -16
  424. package/dist/cli/chunk-713mngdq.js.map +0 -14
  425. package/dist/cli/chunk-9xr4dgee.js.map +0 -10
  426. package/dist/cli/chunk-amrb6hgh.js +0 -145
  427. package/dist/cli/chunk-amrb6hgh.js.map +0 -11
  428. package/dist/cli/chunk-nd1821sk.js.map +0 -10
  429. package/dist/cli/chunk-rekqz4qg.js.map +0 -10
  430. package/dist/cli/chunk-ta27feev.js.map +0 -10
  431. package/dist/cli/chunk-xkz5xbtv.js.map +0 -213
  432. package/dist/cli/chunk-y5h4r2y0.js.map +0 -10
  433. package/dist/cli/chunk-zf748avv.js.map +0 -37
  434. /package/dist/cli/{chunk-9geymqns.js.map → chunk-0w6hs479.js.map} +0 -0
  435. /package/dist/cli/{chunk-y4ykbark.js.map → chunk-1f882900.js.map} +0 -0
  436. /package/dist/cli/{chunk-py62fewh.js.map → chunk-53jqw8z0.js.map} +0 -0
  437. /package/dist/cli/{chunk-5wj2qwn2.js.map → chunk-58bt3hag.js.map} +0 -0
  438. /package/dist/cli/{chunk-e7vvk5ya.js.map → chunk-5cmts6dv.js.map} +0 -0
  439. /package/dist/cli/{chunk-g2z9x01v.js.map → chunk-9qzgg6mj.js.map} +0 -0
  440. /package/dist/cli/{chunk-q3wxxq39.js.map → chunk-a57yh0h9.js.map} +0 -0
  441. /package/dist/cli/{chunk-2f3ndkpw.js.map → chunk-desvm72z.js.map} +0 -0
  442. /package/dist/cli/{chunk-gp84za0h.js.map → chunk-dhwtqnnd.js.map} +0 -0
  443. /package/dist/cli/{chunk-2f7n4qzt.js.map → chunk-dqhg54mr.js.map} +0 -0
  444. /package/dist/cli/{chunk-zhvd6adm.js.map → chunk-gfc5fqvf.js.map} +0 -0
  445. /package/dist/cli/{chunk-p804f3pe.js.map → chunk-hvcxng5f.js.map} +0 -0
  446. /package/dist/cli/{chunk-1n228xqb.js.map → chunk-kdpzw38a.js.map} +0 -0
  447. /package/dist/cli/{chunk-6bm0xpgd.js.map → chunk-s0bdnc7v.js.map} +0 -0
  448. /package/dist/cli/{chunk-cmtcnh9f.js.map → chunk-tfycddbt.js.map} +0 -0
  449. /package/dist/cli/{chunk-ntv4qrt7.js.map → chunk-y4msrwm9.js.map} +0 -0
  450. /package/dist/cli/{chunk-yj17vs39.js.map → chunk-ydp3065p.js.map} +0 -0
@@ -1,4 +1,5 @@
1
1
  import type { BlumeProject } from "../../core/project-graph.ts";
2
+ import type { ProjectContext } from "../../core/types.ts";
2
3
  import type { BuildLog, DeployPlatform, RedirectFile } from "./types.ts";
3
4
  /** `vercel.json` with a `redirects` array, for a static deploy of `dist/`. */
4
5
  export declare const VERCEL_JSON_FILE: RedirectFile;
@@ -26,6 +27,22 @@ export declare const emitVercelNegotiation: (project: BlumeProject, log: BuildLo
26
27
  * prerender a pattern's pages, so the adapter never sees these.
27
28
  */
28
29
  export declare const emitVercelPatternRedirects: (project: BlumeProject, log: BuildLog) => Promise<void>;
30
+ /**
31
+ * Move a server build's static files under `deployment.base`.
32
+ * `@astrojs/vercel` copies them to the root of the Build Output tree's
33
+ * `static/`, while the pages request `<base>/_astro/…` and link to
34
+ * `<base>/…`, so nothing the site asks for would be found. Moved to
35
+ * `static/<base>/`, they're served at the base, as the routes that
36
+ * {@link rebaseVercelRoutes} moves there expect.
37
+ */
38
+ export declare const moveStaticUnderBase: (context: ProjectContext, base: string) => Promise<void>;
39
+ /**
40
+ * Move the adapter's routing config under `deployment.base` to match the
41
+ * static files (see `rebaseAdapterRoutes`), its exact redirects rebuilt from
42
+ * the configured ones. Resolves to false when the config can't be read: the
43
+ * adapter's routes would then miss every path under the base.
44
+ */
45
+ export declare const rebaseVercelRoutes: (project: BlumeProject, log: BuildLog) => Promise<boolean>;
29
46
  /**
30
47
  * Vercel. A server build's Build Output tree lands at `.vercel/output` — at
31
48
  * the project root, because the adapter is handed that root up front: its
@@ -33,7 +50,9 @@ export declare const emitVercelPatternRedirects: (project: BlumeProject, log: Bu
33
50
  * hidden runtime silently drops the function's chunks and `node_modules`.
34
51
  * Static assets are served from the tree's `static/` half, so the deploy
35
52
  * artifacts are written there; headers (the discovery files', the sandbox on
36
- * downloaded SVGs) arrive through the routing config rather than a
37
- * `_headers` file, which Vercel never reads.
53
+ * downloaded SVGs, `X-Powered-By`) arrive through the routing config rather
54
+ * than a `_headers` file, which Vercel never reads. The adapter ignores
55
+ * `deployment.base`, so under one the build moves the static files and the
56
+ * routes beneath it.
38
57
  */
39
58
  export declare const vercelPlatform: DeployPlatform;
@@ -41,9 +41,25 @@ export declare const applyBaseToAstroRedirects: (redirects: Redirect[], basePath
41
41
  * public file (see {@link baseRedirectTarget}).
42
42
  */
43
43
  export declare const applyBaseToPlatformRedirects: (redirects: Redirect[], basePath: string, deployBase: string, routes: RouteSet) => Redirect[];
44
+ /**
45
+ * Based `redirects`, each exact one that moves a page followed by the same
46
+ * redirect for the page's Markdown copies: from a path no page is served at
47
+ * to one a page is, `/old.md` goes to `/new.md` (and `.mdx` alike), where it
48
+ * would otherwise 404 for an agent still reading the old URL. A pattern gets
49
+ * none; one that carries its capture over (`/beta/:slug*` → `/v2/:slug*`)
50
+ * already moves `/beta/guide.md` along. `pages` are the served page routes
51
+ * (carrying `basePath`, not `deployment.base`), and `bases` the deployment
52
+ * base each end carries: Astro's config leaves it off `from` (see
53
+ * {@link applyBaseToAstroRedirects}).
54
+ */
55
+ export declare const withMirrorRedirects: (redirects: Redirect[], pages: RouteSet, bases: {
56
+ from: string;
57
+ to: string;
58
+ }) => Redirect[];
44
59
  /**
45
60
  * The configured redirects as the host platform matches them, via
46
- * {@link applyBaseToPlatformRedirects}, exact paths ahead of patterns: hosts
61
+ * {@link applyBaseToPlatformRedirects} plus the Markdown copies of each moved
62
+ * page ({@link withMirrorRedirects}), exact paths ahead of patterns: hosts
47
63
  * try rules in order, and an exact redirect wins over a pattern that also
48
64
  * covers its path. The one basing every consumer must share: the emitted
49
65
  * redirect files and the server wrappers all compare these paths against
@@ -11,7 +11,8 @@ export declare const describeSitemapFiles: (files: readonly SitemapFile[]) => st
11
11
  * can't see: custom `.astro` pages (most importantly a custom landing `/`) and
12
12
  * the generated `/changelog` index. Returns null when the sitemap is disabled
13
13
  * or no `site` is configured (absolute URLs are required for a valid sitemap).
14
- * Drafts, hidden, and `noindex` pages are excluded.
14
+ * Drafts, hidden, and `noindex` pages are excluded, and so is a page whose
15
+ * `seo.canonical` points elsewhere.
15
16
  *
16
17
  * Sites within the per-file URL cap get the single classic `sitemap.xml`;
17
18
  * larger sites get `sitemap.xml` as a sitemap index over numbered
@@ -14,25 +14,31 @@
14
14
  * prerendered Markdown 404 body with the 404 status, instead of the HTML
15
15
  * shell, and one that prefers JSON (or asks for a `.json` URL) gets the
16
16
  * prerendered problem-details 404.
17
+ *
18
+ * Under `deployment.base` every route here matches the served URL, base
19
+ * included, and names the files where Blume moves them (`static/<base>/`, see
20
+ * {@link rebaseAdapterRoutes}); `base` is the normalized base, `""` for none.
17
21
  */
18
- /**
19
- * Regex for the `accept` header condition. Written to hold under both matching
20
- * semantics a router may apply — full-string and substring — by anchoring the
21
- * end and letting `(.*,)?` absorb any earlier list entries: it requires a
22
- * `text/markdown` or `text/x-markdown` entry terminated by `;`, `,`, or the end
23
- * of the header. Kept lookaround-free so it stays valid in RE2, and lowercase
24
- * only — real agents send lowercase media types, and q-values are not compared
25
- * (a client sending `text/markdown` at `q=0` is pathological). Browsers never
26
- * send `text/markdown`, so ordinary page requests are unaffected.
27
- */
28
- export declare const ACCEPT_MARKDOWN_HEADER_VALUE = "(.*,)?\\s*text/(x-)?markdown(\\s*[;,].*)?$";
22
+ /** One header condition on a Build Output route. */
23
+ export interface VercelCondition {
24
+ key?: string;
25
+ type: string;
26
+ value?: string;
27
+ }
28
+ /** The conditions of one route: all of `has`, none of `missing`. */
29
+ export interface AcceptConditions {
30
+ has: VercelCondition[];
31
+ missing?: VercelCondition[];
32
+ }
33
+ /** When a client prefers `text/markdown` (or `text/x-markdown`) over HTML. */
34
+ export declare const ACCEPT_MARKDOWN_CONDITIONS: AcceptConditions[];
29
35
  /**
30
36
  * The JSON counterpart, for the problem-details 404: `application/json` or
31
37
  * `application/problem+json`. Browsers never send either on a navigation
32
38
  * (the catch-all wildcard does not match), so ordinary page requests are
33
39
  * unaffected.
34
40
  */
35
- export declare const ACCEPT_JSON_HEADER_VALUE = "(.*,)?\\s*application/(problem\\+)?json(\\s*[;,].*)?$";
41
+ export declare const ACCEPT_JSON_CONDITIONS: AcceptConditions[];
36
42
  /**
37
43
  * A Build Output API route — the subset these helpers read and write. Parsed
38
44
  * routes keep whatever other fields they carry at runtime; only these are
@@ -42,12 +48,9 @@ export interface VercelRoute {
42
48
  continue?: boolean;
43
49
  dest?: string;
44
50
  handle?: string;
45
- has?: {
46
- key?: string;
47
- type: string;
48
- value?: string;
49
- }[];
51
+ has?: VercelCondition[];
50
52
  headers?: Record<string, string>;
53
+ missing?: VercelCondition[];
51
54
  src?: string;
52
55
  status?: number;
53
56
  }
@@ -82,9 +85,10 @@ export interface NegotiationRoutes {
82
85
  * rewrite also stamps `x-markdown-tokens` — the estimated token count of the
83
86
  * homepage mirror (Cloudflare's Markdown for Agents convention). Only the home
84
87
  * route can carry it: the other rewrites are chunked alternations spanning
85
- * many pages, and a count is per-page.
88
+ * many pages, and a count is per-page. Under a `base`, each path is matched
89
+ * and rewritten where it's served (`/docs` → `/docs/index.md`).
86
90
  */
87
- export declare const buildNegotiationRoutes: (routePaths: readonly string[], homeTokens?: number) => NegotiationRoutes;
91
+ export declare const buildNegotiationRoutes: (routePaths: readonly string[], homeTokens?: number, base?: string) => NegotiationRoutes;
88
92
  /**
89
93
  * Splice the negotiation routes into a Build Output `config.json`, plus — when
90
94
  * given — a homepage `Link` header route for agent discovery (see
@@ -102,12 +106,16 @@ export declare const buildNegotiationRoutes: (routePaths: readonly string[], hom
102
106
  * phase right before the adapter's `/404.html` fallback — and nowhere when
103
107
  * that fallback is absent, since a `dest` with no file behind it would serve
104
108
  * nothing. With `svgAssets`, a main-phase route also sandboxes the SVGs a
105
- * content source downloaded (see {@link svgAssetRoute}). Returns the updated JSON
109
+ * content source downloaded (see {@link svgAssetRoute}). With `poweredBy`, a
110
+ * route at the head of the config, ahead of the adapter's redirects, names
111
+ * Blume on every response (see {@link poweredByRoute}). Under a `base`, every
112
+ * route matches and names paths beneath it, and the fallback anchor is the
113
+ * one {@link rebaseAdapterRoutes} moved there. Returns the updated JSON
106
114
  * text (tab-indented, like the adapter's own output), or `null` when there is
107
115
  * nowhere safe to splice: an unparsable config, no `routes` array, or no
108
116
  * `handle: "filesystem"` marker to anchor the splice.
109
117
  */
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;
118
+ 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, base?: string, poweredBy?: boolean) => string | null;
111
119
  /**
112
120
  * Splice routes for the pattern redirects (see `vercelPatternRoutes`) into a
113
121
  * Build Output `config.json`, in the main phase just ahead of
@@ -117,3 +125,18 @@ export declare const injectNegotiationRoutes: (configText: string, routePaths: r
117
125
  * unparsable config, no `routes` array, or no `handle: "filesystem"` marker.
118
126
  */
119
127
  export declare const injectRedirectRoutes: (configText: string, redirectRoutes: readonly VercelRoute[]) => string | null;
128
+ /**
129
+ * Move the adapter's routes under `deployment.base`, to match the static files
130
+ * Blume moves to `static/<base>/`. `@astrojs/vercel` routes a server build as
131
+ * if it were served from the root: its route patterns (the `_astro/` cache
132
+ * header, every server route) match base-less paths, its 404 fallback names
133
+ * `/404.html`, and it joins the base onto each redirect with no slash on the
134
+ * `from` side and a second time on the `to` side, which Astro hands it
135
+ * already based (`^/docsold$` → `/docs/docs/new`). Each pattern is
136
+ * re-anchored under the base and the fallback names the base's `404.html`;
137
+ * the adapter's redirects make way for `redirectRoutes`, the exact redirects
138
+ * as the host matches them. Returns the updated JSON text, or `null` when
139
+ * there is nowhere safe to splice: an unparsable config, no `routes` array,
140
+ * or no `handle: "filesystem"` marker.
141
+ */
142
+ export declare const rebaseAdapterRoutes: (configText: string, base: string, redirectRoutes: readonly VercelRoute[]) => string | null;
@@ -2,17 +2,18 @@ import { HTMLElement } from "node-html-parser";
2
2
  import type { Node } from "node-html-parser";
3
3
  import type { BlumeProject } from "../core/project-graph.ts";
4
4
  import type { ProjectContext } from "../core/types.ts";
5
- import type { NarrationProvider } from "./provider.ts";
5
+ import type { GatewayNarrationProvider, NarrationProvider, OpenAINarrationProvider } from "./provider.ts";
6
6
  import type { NarrationCues, NarrationTree } from "./script.ts";
7
7
  /**
8
8
  * Generated narration: after Astro writes the HTML, read every page that
9
9
  * carries the player exactly as the browser will (same walker, same blocks),
10
10
  * split it into sentences, and give each sentence a clip from the configured
11
11
  * speech model. Clips are cached by what decides their sound (text, language,
12
- * model, voice, instructions, provider options), so a rebuild only pays for
13
- * sentences that changed, and one sentence shared by many pages is generated
14
- * once. Each page gets a manifest listing its clips; the player plays them in
15
- * order and falls back to browser voices wherever a manifest is missing.
12
+ * model, voice, instructions, provider options, endpoint), so a rebuild only
13
+ * pays for sentences that changed, and one sentence shared by many pages is
14
+ * generated once. Each page gets a manifest listing its clips; the player
15
+ * plays them in order and falls back to browser voices wherever a manifest is
16
+ * missing.
16
17
  */
17
18
  /** How the build logs: the integration's Astro logger. */
18
19
  export interface NarrationLogger {
@@ -23,7 +24,10 @@ export interface NarrationLogger {
23
24
  export type Speak = (text: string, lang: string) => Promise<Uint8Array>;
24
25
  /** What a narration build did, for the log line and tests. */
25
26
  export interface NarrationBuildResult {
26
- /** Clips that failed to generate; their pages get no manifest. */
27
+ /**
28
+ * Clips that failed to generate, or that a missing key left ungenerated;
29
+ * their pages get no manifest.
30
+ */
27
31
  failed: number;
28
32
  /** Clips generated by the speech model on this build. */
29
33
  generated: number;
@@ -55,16 +59,34 @@ export declare const readPlayerPage: (html: string) => PlayerPage | null;
55
59
  /**
56
60
  * A clip's cache key: a digest of everything that decides how it sounds. The
57
61
  * Blume version is deliberately left out, unlike the OG card's: an upgrade
58
- * shouldn't pay to regenerate audio that would sound the same.
62
+ * shouldn't pay to regenerate audio that would sound the same. A build
63
+ * resolves `endpoint` once and passes it in, rather than reading the
64
+ * environment for every sentence.
59
65
  */
60
- export declare const clipKey: (provider: NarrationProvider, lang: string, text: string) => string;
66
+ export declare const clipKey: (provider: NarrationProvider, lang: string, text: string, endpoint?: string | undefined) => string;
61
67
  /** Speak through the Vercel AI Gateway with the provider's model and voice. */
62
- export declare const gatewaySpeaker: (provider: NarrationProvider) => Speak;
68
+ export declare const gatewaySpeaker: (provider: GatewayNarrationProvider) => Speak;
69
+ /**
70
+ * Speak through OpenAI's speech API, or with `baseUrl` through any server
71
+ * that serves it (`POST /audio/speech`): Kokoro-FastAPI, Speaches, LiteLLM.
72
+ * That API takes no language, so none is sent and the model or voice
73
+ * decides it. Without a key, no bearer token is sent (an `Authorization` in
74
+ * `headers` still is). A build resolves `baseURL` once and passes it in.
75
+ */
76
+ export declare const openaiSpeaker: (provider: OpenAINarrationProvider, baseURL?: string) => Speak;
77
+ /**
78
+ * The env var a build needs to generate with `provider` and doesn't have, or
79
+ * `null` when it can go ahead: the key is set, Vercel's OIDC token stands in
80
+ * for the gateway's, or the provider names no key (`openai()` with a
81
+ * `baseUrl` and no `apiKeyEnv`).
82
+ */
83
+ export declare const missingKey: (provider: NarrationProvider) => string | null;
63
84
  /**
64
85
  * Generate the narration for a built site in `distDir`: a clip per sentence
65
- * and a manifest per page. Does nothing unless `narration.provider` is set,
66
- * and warns instead of generating when the provider's key is missing (the
67
- * pages then read with browser voices). `speak` replaces the gateway call.
86
+ * and a manifest per page. Does nothing unless `narration.provider` is set.
87
+ * When new clips are needed and the provider's key is missing, it warns and
88
+ * generates nothing, so only pages whose clips are all cached get audio (the
89
+ * rest read with browser voices). `speak` replaces the provider call.
68
90
  */
69
91
  export declare const buildNarration: (project: BlumeProject, distDir: string, logger: NarrationLogger, speak?: Speak) => Promise<NarrationBuildResult | null>;
70
92
  export {};
@@ -1,19 +1,36 @@
1
1
  import { z } from "zod";
2
2
  /** The speech model narration uses when `gateway()` names none. */
3
3
  export declare const DEFAULT_NARRATION_MODEL = "openai/tts-1-hd";
4
- /** The voice narration uses when `gateway()` names none. */
4
+ /** The voice narration uses when the provider names none. */
5
5
  export declare const DEFAULT_NARRATION_VOICE = "alloy";
6
6
  /**
7
- * `narration.provider`: the `gateway()` descriptor from `blume/ai`, read with
8
- * speech defaults. `reasoning` is an assistant option and is rejected here;
9
- * `voice` and `instructions` are narration options and are rejected by the
10
- * assistant.
7
+ * The AI SDK provider `openai()` narration speaks through, with or without a
8
+ * `baseUrl`: `@ai-sdk/openai-compatible` has no speech models.
11
9
  */
12
- export declare const narrationProviderSchema: z.ZodObject<{
10
+ export declare const OPENAI_SPEECH_DEP = "@ai-sdk/openai";
11
+ /**
12
+ * Whether `url` carries a username or password, which `fetch` refuses to
13
+ * send and whose error message would print them. A URL that doesn't parse
14
+ * has none.
15
+ */
16
+ export declare const hasCredentials: (url: string) => boolean;
17
+ /**
18
+ * `narration.provider`: the `gateway()` or `openai()` descriptor from
19
+ * `blume/ai`, read with speech defaults. `reasoning` (and `openai()`'s
20
+ * `name`, which speech models don't read) are assistant options and are
21
+ * rejected here; `voice` and `instructions` are narration options and are
22
+ * rejected by the assistant.
23
+ *
24
+ * `openai()` is read for what narration needs, not what the assistant does:
25
+ * it speaks through `@ai-sdk/openai` whatever the `baseUrl`, and a custom
26
+ * endpoint gets only the key `apiKeyEnv` names, never `OPENAI_API_KEY` by
27
+ * default, so it may take none at all. A key that is named is required.
28
+ */
29
+ export declare const narrationProviderSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
13
30
  kind: z.ZodLiteral<"gateway">;
14
31
  options: z.ZodObject<{
15
- instructions: z.ZodOptional<z.ZodString>;
16
32
  model: z.ZodDefault<z.ZodString>;
33
+ instructions: z.ZodOptional<z.ZodString>;
17
34
  voice: z.ZodDefault<z.ZodString>;
18
35
  apiKeyEnv: z.ZodDefault<z.ZodString>;
19
36
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -21,6 +38,77 @@ export declare const narrationProviderSchema: z.ZodObject<{
21
38
  }, z.core.$strict>;
22
39
  requiredSecrets: z.ZodArray<z.ZodString>;
23
40
  runtimeDeps: z.ZodArray<z.ZodString>;
24
- }, z.core.$strict>;
41
+ }, z.core.$strict>, z.ZodObject<{
42
+ kind: z.ZodLiteral<"openai">;
43
+ options: z.ZodObject<{
44
+ apiKeyEnv: z.ZodOptional<z.ZodString>;
45
+ baseUrl: z.ZodOptional<z.ZodURL>;
46
+ model: z.ZodString;
47
+ instructions: z.ZodOptional<z.ZodString>;
48
+ voice: z.ZodDefault<z.ZodString>;
49
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
50
+ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodJSONSchema>>>;
51
+ }, z.core.$strict>;
52
+ requiredSecrets: z.ZodArray<z.ZodString>;
53
+ runtimeDeps: z.ZodArray<z.ZodString>;
54
+ }, z.core.$strict>], "kind">, z.ZodTransform<{
55
+ kind: "gateway";
56
+ options: {
57
+ model: string;
58
+ voice: string;
59
+ apiKeyEnv: string;
60
+ instructions?: string | undefined;
61
+ headers?: Record<string, string> | undefined;
62
+ providerOptions?: Record<string, Record<string, z.core.util.JSONType>> | undefined;
63
+ };
64
+ requiredSecrets: string[];
65
+ runtimeDeps: string[];
66
+ } | {
67
+ options: {
68
+ model: string;
69
+ voice: string;
70
+ apiKeyEnv?: string | undefined;
71
+ baseUrl?: string | undefined;
72
+ instructions?: string | undefined;
73
+ headers?: Record<string, string> | undefined;
74
+ providerOptions?: Record<string, Record<string, z.core.util.JSONType>> | undefined;
75
+ };
76
+ requiredSecrets: string[];
77
+ runtimeDeps: string[];
78
+ kind: "openai";
79
+ }, {
80
+ kind: "gateway";
81
+ options: {
82
+ model: string;
83
+ voice: string;
84
+ apiKeyEnv: string;
85
+ instructions?: string | undefined;
86
+ headers?: Record<string, string> | undefined;
87
+ providerOptions?: Record<string, Record<string, z.core.util.JSONType>> | undefined;
88
+ };
89
+ requiredSecrets: string[];
90
+ runtimeDeps: string[];
91
+ } | {
92
+ kind: "openai";
93
+ options: {
94
+ model: string;
95
+ voice: string;
96
+ apiKeyEnv?: string | undefined;
97
+ baseUrl?: string | undefined;
98
+ instructions?: string | undefined;
99
+ headers?: Record<string, string> | undefined;
100
+ providerOptions?: Record<string, Record<string, z.core.util.JSONType>> | undefined;
101
+ };
102
+ requiredSecrets: string[];
103
+ runtimeDeps: string[];
104
+ }>>;
25
105
  /** A validated narration provider, defaults filled in. */
26
106
  export type NarrationProvider = z.output<typeof narrationProviderSchema>;
107
+ /** A validated `gateway()` narration provider. */
108
+ export type GatewayNarrationProvider = Extract<NarrationProvider, {
109
+ kind: "gateway";
110
+ }>;
111
+ /** A validated `openai()` narration provider. */
112
+ export type OpenAINarrationProvider = Extract<NarrationProvider, {
113
+ kind: "openai";
114
+ }>;
@@ -0,0 +1,27 @@
1
+ import type { ApiDocument } from "./model.ts";
2
+ /**
3
+ * Targeted checks for spec mistakes that would otherwise render silently
4
+ * wrong. This is not a validator — a linter such as Spectral or oasdiff owns
5
+ * that — and a spec that fails one of these still renders. Each check names
6
+ * one mistake whose symptom on the page is quiet: a path placeholder sent
7
+ * as literal text, a Try it input whose value goes nowhere, an Authorization
8
+ * section with no scheme to describe. Each reports a warning with its own
9
+ * code, so a build says what's wrong instead of shipping it.
10
+ */
11
+ /** One mistake a check found, before the source names the spec it's in. */
12
+ export interface SpecIssue {
13
+ code: string;
14
+ message: string;
15
+ suggestion: string;
16
+ }
17
+ /**
18
+ * How a warning names an operation: `GET /pets`, or a webhook by its name
19
+ * (`Webhook "newPet" (POST)`), since a webhook has no path.
20
+ */
21
+ export declare const operationLabel: (name: string, method: string, webhook: boolean) => string;
22
+ /**
23
+ * Check a parsed document for the mistakes above, and for the OpenAPI 3.2
24
+ * features Blume doesn't render yet. `$ref` path items are skipped: the
25
+ * extractor already reports them as missing from the reference.
26
+ */
27
+ export declare const specIssues: (document: ApiDocument) => SpecIssue[];
@@ -37,6 +37,10 @@ export interface GraphqlTypeRef {
37
37
  display: string;
38
38
  name: string;
39
39
  }
40
+ /** A GraphQL input value as JSON carries it in `variables` (enums by name). */
41
+ export type GraphqlJsonValue = string | number | boolean | null | GraphqlJsonValue[] | {
42
+ [key: string]: GraphqlJsonValue;
43
+ };
40
44
  /** An argument or input-object field. */
41
45
  export interface GraphqlInputValue {
42
46
  name: string;
@@ -44,6 +48,8 @@ export interface GraphqlInputValue {
44
48
  type: GraphqlTypeRef;
45
49
  /** Default value printed as a GraphQL literal (`10`, `"asc"`, `[1, 2]`). */
46
50
  default?: string;
51
+ /** The same default as JSON, for the example variables. */
52
+ defaultValue?: GraphqlJsonValue;
47
53
  deprecationReason?: string;
48
54
  }
49
55
  /** An output field of an object or interface type (root fields included). */
@@ -1,4 +1,5 @@
1
- import type { Document, OperationObject } from "@scalar/openapi-types/3.1";
1
+ import type { Document, OperationObject } from "@scalar/openapi-types/3.2";
2
+ import type { GraphqlAuthOptions } from "../reference/options.ts";
2
3
  import type { AsyncApiAction, AsyncApiDocument, AsyncApiSpecValue } from "./asyncapi.ts";
3
4
  import type { GraphqlDocument, GraphqlMember } from "./graphql.ts";
4
5
  import type { ReferenceKind } from "./references.ts";
@@ -12,10 +13,18 @@ export { slugify } from "./references.ts";
12
13
  * Each operation is flattened into an {@link ApiOperationRef} with a real,
13
14
  * per-operation route so it becomes a first-class Blume page.
14
15
  */
15
- /** A normalized OpenAPI 3.1 document, internal `$ref`s intact. */
16
+ /**
17
+ * A normalized OpenAPI document, internal `$ref`s intact. Typed as 3.2, which
18
+ * is backward compatible with 3.1, so one type covers both the upgraded 3.1
19
+ * documents and the 3.2 ones read as written.
20
+ */
16
21
  export type ApiDocument = Document;
17
- /** The HTTP methods an OpenAPI path item may declare, in spec order. */
18
- export declare const HTTP_METHODS: readonly ["get", "put", "post", "delete", "options", "head", "patch", "trace"];
22
+ /**
23
+ * The HTTP methods an OpenAPI path item may declare, in spec order. `query`
24
+ * is OpenAPI 3.2's (the QUERY method: a safe request that carries a body); a
25
+ * 3.1 path item can't declare it, so listing it changes nothing there.
26
+ */
27
+ export declare const HTTP_METHODS: readonly ["get", "put", "post", "delete", "options", "head", "patch", "trace", "query"];
19
28
  export type HttpMethod = (typeof HTTP_METHODS)[number];
20
29
  /** A stable, URL-safe key for an operation: its `operationId`, else method+path. */
21
30
  export declare const operationKey: (method: string, path: string, operationId?: string) => string;
@@ -79,6 +88,8 @@ export interface ApiSpecData {
79
88
  * (GraphQL only; OpenAPI documents carry their servers in the document).
80
89
  */
81
90
  endpoint?: string;
91
+ /** How the GraphQL endpoint authenticates (GraphQL only). */
92
+ auth?: GraphqlAuthOptions;
82
93
  /** Operations keyed by {@link ApiOperationRef.key}. */
83
94
  operations: Record<string, ApiOperationRef>;
84
95
  tags: ApiTagRef[];
@@ -1,8 +1,11 @@
1
1
  import type { AsyncApiDocument } from "./asyncapi.ts";
2
+ import type { SpecIssue } from "./checks.ts";
2
3
  import type { GraphqlDocument } from "./graphql.ts";
3
4
  import type { ApiDocument } from "./model.ts";
4
5
  export interface ParsedSpec {
5
6
  document: ApiDocument;
7
+ /** `x-codeSamples` entries whose `$ref` couldn't be inlined. */
8
+ issues: SpecIssue[];
6
9
  warnings: string[];
7
10
  }
8
11
  /**
@@ -1,4 +1,5 @@
1
1
  import type { ResolvedConfig } from "../core/schema.ts";
2
+ import type { GraphqlAuthOptions } from "../reference/options.ts";
2
3
  import type { ScalarOptions } from "../reference/scalar.ts";
3
4
  import type { ResolvedReferenceAdapter } from "../reference/schema.ts";
4
5
  export { normalizeRoute } from "../core/base-path.ts";
@@ -47,6 +48,12 @@ export interface ReferenceSource {
47
48
  */
48
49
  basePath: string;
49
50
  label: string;
51
+ /**
52
+ * The source's own `label`, when it sets one: it names the sidebar group
53
+ * of the source's route. An unlabeled source's group keeps the name its
54
+ * route gives it.
55
+ */
56
+ groupLabel?: string;
50
57
  /** Whether generated pages are included in llms.txt/llms-full.txt. */
51
58
  includeInLlms: boolean;
52
59
  /** Whether generated pages are included in site search. */
@@ -70,6 +77,8 @@ export interface ReferenceSource {
70
77
  * (GraphQL only — a schema, unlike an OpenAPI document, names no server).
71
78
  */
72
79
  endpoint?: string;
80
+ /** How the GraphQL endpoint authenticates (GraphQL only). */
81
+ auth?: GraphqlAuthOptions;
73
82
  /**
74
83
  * The `scalar()` adapter's own options (`scalar` kind only): `theme` plus
75
84
  * any Scalar config forwarded verbatim to `<ScalarComponent>`, which takes
@@ -112,6 +121,13 @@ export declare const resolveReferences: (config: ResolvedConfig) => ReferenceSou
112
121
  export declare const referenceRoutes: (config: ResolvedConfig) => string[];
113
122
  /** Blume-rendered references (every kind but Scalar), deduped by route (first wins). */
114
123
  export declare const blumeReferences: (config: ResolvedConfig) => BlumeReferenceSource[];
124
+ /**
125
+ * The local files every reference reads, as absolute paths: each spec and
126
+ * overlay that isn't an `http(s)` URL, resolved from the project root the way
127
+ * the parser resolves them. `blume dev` watches these, so an edit to a spec
128
+ * regenerates its reference like an edit to a page does.
129
+ */
130
+ export declare const referenceSpecFiles: (config: ResolvedConfig, root: string) => string[];
115
131
  /** Whether any reference is Scalar-rendered (gates the Scalar pages). */
116
132
  export declare const hasScalarReferences: (config: ResolvedConfig) => boolean;
117
133
  /**
@@ -1,7 +1,17 @@
1
+ /** Whether `text` ends in a colon that leads in to what follows it. */
2
+ export declare const endsInLeadIn: (text: string) => boolean;
3
+ /**
4
+ * Close prose with a period unless it already ends a sentence. A colon at the
5
+ * end is kept and gains the period: use this when the caller has already told
6
+ * a lead-in apart from a literal (`tenant:` in inline code). Empty text stays
7
+ * empty.
8
+ */
9
+ export declare const closeSentence: (text: string) => string;
1
10
  /**
2
11
  * Close a fragment of spec prose as a sentence. OpenAPI `summary` values are
3
12
  * usually title-like ("Get a flag", no period), so prose that runs straight
4
13
  * into the next generated sentence ("Get a flag Reference for …") needs one.
5
- * Empty text stays empty.
14
+ * A lead-in colon becomes the period rather than gaining one after it, and
15
+ * prose that already ended before it ("e.g.:") keeps its own mark.
6
16
  */
7
17
  export declare const asSentence: (text: string) => string;
@@ -24,4 +24,4 @@ export { memory } from "./memory.ts";
24
24
  export type { MemoryAdapter, RateLimitOptions } from "./memory.ts";
25
25
  export type { RateLimitAdapter } from "./schema.ts";
26
26
  export { upstash } from "./upstash.ts";
27
- export type { UpstashAdapter } from "./upstash.ts";
27
+ export type { UpstashAdapter, UpstashOptions } from "./upstash.ts";
@@ -22,6 +22,8 @@ export declare const rateLimitAdapterSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
22
22
  options: z.ZodObject<{
23
23
  requests: z.ZodOptional<z.ZodNumber>;
24
24
  window: z.ZodOptional<z.ZodNumber>;
25
+ tokenEnv: z.ZodOptional<z.ZodString>;
26
+ urlEnv: z.ZodOptional<z.ZodString>;
25
27
  }, z.core.$strict>;
26
28
  requiredSecrets: z.ZodArray<z.ZodString>;
27
29
  runtimeDeps: z.ZodArray<z.ZodString>;
@@ -55,6 +57,8 @@ export declare const rateLimitConfigSchema: z.ZodPipe<z.ZodOptional<z.ZodUnion<r
55
57
  options: z.ZodObject<{
56
58
  requests: z.ZodOptional<z.ZodNumber>;
57
59
  window: z.ZodOptional<z.ZodNumber>;
60
+ tokenEnv: z.ZodOptional<z.ZodString>;
61
+ urlEnv: z.ZodOptional<z.ZodString>;
58
62
  }, z.core.$strict>;
59
63
  requiredSecrets: z.ZodArray<z.ZodString>;
60
64
  runtimeDeps: z.ZodArray<z.ZodString>;
@@ -80,6 +84,8 @@ export declare const rateLimitConfigSchema: z.ZodPipe<z.ZodOptional<z.ZodUnion<r
80
84
  options: {
81
85
  requests?: number | undefined;
82
86
  window?: number | undefined;
87
+ tokenEnv?: string | undefined;
88
+ urlEnv?: string | undefined;
83
89
  };
84
90
  requiredSecrets: string[];
85
91
  runtimeDeps: string[];
@@ -105,6 +111,8 @@ export declare const rateLimitConfigSchema: z.ZodPipe<z.ZodOptional<z.ZodUnion<r
105
111
  options: {
106
112
  requests?: number | undefined;
107
113
  window?: number | undefined;
114
+ tokenEnv?: string | undefined;
115
+ urlEnv?: string | undefined;
108
116
  };
109
117
  requiredSecrets: string[];
110
118
  runtimeDeps: string[];