blume 2.0.3 → 2.1.1

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 (607) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +142 -0
  3. package/README.md +1 -1
  4. package/dist/cli/{chunk-5f86nr5m.js → chunk-073rdvgb.js} +21 -48
  5. package/dist/cli/{chunk-5f86nr5m.js.map → chunk-073rdvgb.js.map} +4 -5
  6. package/dist/cli/{chunk-ga0pf4aj.js → chunk-0n9xkp3d.js} +12 -3
  7. package/dist/cli/{chunk-ga0pf4aj.js.map → chunk-0n9xkp3d.js.map} +3 -3
  8. package/dist/cli/chunk-150jk7km.js +52 -0
  9. package/dist/cli/chunk-150jk7km.js.map +10 -0
  10. package/dist/cli/{chunk-9t7a85s3.js → chunk-313vnn40.js} +30 -19
  11. package/dist/cli/chunk-313vnn40.js.map +10 -0
  12. package/dist/cli/{chunk-tkacnehg.js → chunk-3v3ffbrj.js} +2 -2
  13. package/dist/cli/{chunk-q58y5e6a.js → chunk-3x6x3pph.js} +46 -24
  14. package/dist/cli/chunk-3x6x3pph.js.map +10 -0
  15. package/dist/cli/{chunk-1d7ve1dm.js → chunk-42t4jxdx.js} +37 -5
  16. package/dist/cli/chunk-42t4jxdx.js.map +12 -0
  17. package/dist/cli/{chunk-8ktnccpt.js → chunk-54ztw1nj.js} +21 -2
  18. package/dist/cli/chunk-54ztw1nj.js.map +10 -0
  19. package/dist/cli/{chunk-hm3vjy5s.js → chunk-5vjtgs6e.js} +28 -10
  20. package/dist/cli/{chunk-hm3vjy5s.js.map → chunk-5vjtgs6e.js.map} +4 -4
  21. package/dist/cli/chunk-66w9j7p6.js +322 -0
  22. package/dist/cli/chunk-66w9j7p6.js.map +14 -0
  23. package/dist/cli/{chunk-2hsdwb9n.js → chunk-7ppf1rva.js} +34 -18
  24. package/dist/cli/chunk-7ppf1rva.js.map +10 -0
  25. package/dist/cli/{chunk-r9rcc4w7.js → chunk-8y2kmjv8.js} +7 -7
  26. package/dist/cli/{chunk-r20tn01b.js → chunk-c1y538kd.js} +8 -2
  27. package/dist/cli/{chunk-r20tn01b.js.map → chunk-c1y538kd.js.map} +3 -3
  28. package/dist/cli/{chunk-2eytanqx.js → chunk-c887fj0s.js} +2 -2
  29. package/dist/cli/{chunk-p3v96n38.js → chunk-cfyg47zg.js} +16 -6
  30. package/dist/cli/chunk-cfyg47zg.js.map +10 -0
  31. package/dist/cli/chunk-cm89scdv.js +443 -0
  32. package/dist/cli/chunk-cm89scdv.js.map +11 -0
  33. package/dist/cli/{chunk-akbpwfxc.js → chunk-dzwehpy7.js} +2 -2
  34. package/dist/cli/{chunk-wrr3j9w9.js → chunk-e6atmn4h.js} +299 -72
  35. package/dist/cli/chunk-e6atmn4h.js.map +36 -0
  36. package/dist/cli/{chunk-tzmab476.js → chunk-e8xw9qkh.js} +8 -6
  37. package/dist/cli/{chunk-tzmab476.js.map → chunk-e8xw9qkh.js.map} +3 -3
  38. package/dist/cli/{chunk-6dsbexzp.js → chunk-e9q7a2ak.js} +17 -15
  39. package/dist/cli/{chunk-6dsbexzp.js.map → chunk-e9q7a2ak.js.map} +2 -2
  40. package/dist/cli/{chunk-pv29h0wf.js → chunk-ehweg4fr.js} +5155 -1249
  41. package/dist/cli/chunk-ehweg4fr.js.map +218 -0
  42. package/dist/cli/{chunk-c8chx29p.js → chunk-ep6nd0rn.js} +390 -318
  43. package/dist/cli/chunk-ep6nd0rn.js.map +36 -0
  44. package/dist/cli/{chunk-p73c0m7w.js → chunk-fdrkhpjy.js} +18 -15
  45. package/dist/cli/{chunk-p73c0m7w.js.map → chunk-fdrkhpjy.js.map} +3 -3
  46. package/dist/cli/{chunk-2z928egk.js → chunk-ft9vfys6.js} +5 -5
  47. package/dist/cli/{chunk-5m5nmvyq.js → chunk-gb420vvz.js} +316 -79
  48. package/dist/cli/chunk-gb420vvz.js.map +17 -0
  49. package/dist/cli/{chunk-vg9r4eb9.js → chunk-hebn0tpx.js} +86 -13
  50. package/dist/cli/chunk-hebn0tpx.js.map +14 -0
  51. package/dist/cli/{chunk-35d4wj9f.js → chunk-htrwgabr.js} +41 -23
  52. package/dist/cli/chunk-htrwgabr.js.map +15 -0
  53. package/dist/cli/{chunk-g4hq16wv.js → chunk-hx3xqnk9.js} +16 -14
  54. package/dist/cli/{chunk-g4hq16wv.js.map → chunk-hx3xqnk9.js.map} +2 -2
  55. package/dist/cli/chunk-j134vrp2.js +65 -0
  56. package/dist/cli/chunk-j134vrp2.js.map +10 -0
  57. package/dist/cli/{chunk-a58773jm.js → chunk-kma9f6sf.js} +2 -2
  58. package/dist/cli/chunk-kwrg63tm.js +31 -0
  59. package/dist/cli/chunk-kwrg63tm.js.map +10 -0
  60. package/dist/cli/{chunk-ey84smr6.js → chunk-mrcccgnh.js} +6 -6
  61. package/dist/cli/{chunk-ey84smr6.js.map → chunk-mrcccgnh.js.map} +1 -1
  62. package/dist/cli/{chunk-yfyb25rh.js → chunk-n0v7m8ry.js} +24 -8
  63. package/dist/cli/chunk-n0v7m8ry.js.map +14 -0
  64. package/dist/cli/{chunk-j85vccga.js → chunk-ncj7w596.js} +576 -367
  65. package/dist/cli/chunk-ncj7w596.js.map +35 -0
  66. package/dist/cli/{chunk-5xvm6tfj.js → chunk-nq1d20w2.js} +17 -15
  67. package/dist/cli/{chunk-5xvm6tfj.js.map → chunk-nq1d20w2.js.map} +2 -2
  68. package/dist/cli/{chunk-pehfxfta.js → chunk-nrns10mj.js} +6 -98
  69. package/dist/cli/chunk-nrns10mj.js.map +10 -0
  70. package/dist/cli/{chunk-crgn1q09.js → chunk-sds923fa.js} +4 -4
  71. package/dist/cli/chunk-t2m5j4pr.js +104 -0
  72. package/dist/cli/chunk-t2m5j4pr.js.map +11 -0
  73. package/dist/cli/{chunk-acanzt5p.js → chunk-tdqhyxfz.js} +6 -6
  74. package/dist/cli/chunk-tphac74f.js +126 -0
  75. package/dist/cli/chunk-tphac74f.js.map +11 -0
  76. package/dist/cli/chunk-w1r4vase.js +18 -0
  77. package/dist/cli/chunk-w1r4vase.js.map +10 -0
  78. package/dist/cli/{chunk-3em5wd2y.js → chunk-zccbjcj0.js} +4 -3
  79. package/dist/cli/{chunk-3em5wd2y.js.map → chunk-zccbjcj0.js.map} +2 -2
  80. package/dist/cli/index.js +31 -20
  81. package/dist/cli/index.js.map +5 -5
  82. package/dist/types/ai/agent-surface.d.ts +8 -7
  83. package/dist/types/ai/ai-catalog.d.ts +7 -0
  84. package/dist/types/ai/ask-context.d.ts +26 -0
  85. package/dist/types/ai/ask.d.ts +271 -58
  86. package/dist/types/ai/component-markdown.d.ts +2 -0
  87. package/dist/types/ai/index.d.ts +2 -2
  88. package/dist/types/ai/openapi-components.d.ts +4 -1
  89. package/dist/types/ai/site-skill.d.ts +26 -0
  90. package/dist/types/ai/skills.d.ts +16 -0
  91. package/dist/types/astro/integration.d.ts +9 -0
  92. package/dist/types/astro/markdown-negotiation.d.ts +3 -0
  93. package/dist/types/astro/pages.d.ts +10 -0
  94. package/dist/types/captcha/hcaptcha.d.ts +27 -0
  95. package/dist/types/captcha/index.d.ts +28 -0
  96. package/dist/types/captcha/schema.d.ts +29 -0
  97. package/dist/types/captcha/turnstile.d.ts +28 -0
  98. package/dist/types/cli/init/scaffold.d.ts +1 -1
  99. package/dist/types/components/content/api-field.d.ts +62 -0
  100. package/dist/types/components/content/api-page.d.ts +100 -0
  101. package/dist/types/components/layout/nav-utils.d.ts +26 -0
  102. package/dist/types/components/openapi/code-samples.d.ts +29 -0
  103. package/dist/types/components/openapi/helpers.d.ts +158 -0
  104. package/dist/types/components/openapi/security.d.ts +95 -0
  105. package/dist/types/components/openapi/snippets.d.ts +60 -0
  106. package/dist/types/consent/ethyca.d.ts +48 -0
  107. package/dist/types/consent/index.d.ts +37 -0
  108. package/dist/types/consent/native.d.ts +28 -0
  109. package/dist/types/consent/osano.d.ts +42 -0
  110. package/dist/types/consent/schema.d.ts +110 -0
  111. package/dist/types/core/changelog-index.d.ts +8 -0
  112. package/dist/types/core/config-input.d.ts +217 -23
  113. package/dist/types/core/data.d.ts +53 -4
  114. package/dist/types/core/footer.d.ts +8 -0
  115. package/dist/types/core/i18n-ui.d.ts +88 -0
  116. package/dist/types/core/includes.d.ts +8 -2
  117. package/dist/types/core/links.d.ts +8 -0
  118. package/dist/types/core/localizable.d.ts +7 -0
  119. package/dist/types/core/page-modes.d.ts +29 -0
  120. package/dist/types/core/probe.d.ts +2 -0
  121. package/dist/types/core/project-graph.d.ts +6 -0
  122. package/dist/types/core/redirect-patterns.d.ts +152 -0
  123. package/dist/types/core/related.d.ts +40 -0
  124. package/dist/types/core/schema.d.ts +670 -56
  125. package/dist/types/core/sources/cache.d.ts +3 -0
  126. package/dist/types/core/sources/contentful-rich-text.d.ts +11 -2
  127. package/dist/types/core/sources/contentful.d.ts +17 -1
  128. package/dist/types/core/sources/lexical.d.ts +5 -0
  129. package/dist/types/core/sources/normalize.d.ts +20 -1
  130. package/dist/types/core/sources/read.d.ts +5 -0
  131. package/dist/types/core/sources/remote.d.ts +37 -10
  132. package/dist/types/core/sources/sanity.d.ts +1 -1
  133. package/dist/types/core/types.d.ts +18 -1
  134. package/dist/types/core/variables.d.ts +42 -0
  135. package/dist/types/deploy/adapter-output.d.ts +2 -1
  136. package/dist/types/deploy/adapters/cloudflare.d.ts +7 -5
  137. package/dist/types/deploy/adapters/node.d.ts +58 -23
  138. package/dist/types/deploy/adapters/registry.d.ts +10 -0
  139. package/dist/types/deploy/adapters/types.d.ts +3 -2
  140. package/dist/types/deploy/node-headers.d.ts +13 -2
  141. package/dist/types/deploy/platforms/cloudflare.d.ts +15 -7
  142. package/dist/types/deploy/platforms/netlify.d.ts +7 -0
  143. package/dist/types/deploy/platforms/node.d.ts +3 -1
  144. package/dist/types/deploy/platforms/types.d.ts +18 -7
  145. package/dist/types/deploy/platforms/vercel.d.ts +26 -1
  146. package/dist/types/deploy/redirects.d.ts +55 -11
  147. package/dist/types/deploy/sitemap.d.ts +2 -1
  148. package/dist/types/deploy/vercel-negotiation.d.ts +51 -21
  149. package/dist/types/markdown/code-title.d.ts +17 -0
  150. package/dist/types/markdown/features.d.ts +3 -2
  151. package/dist/types/narration/build.d.ts +70 -0
  152. package/dist/types/narration/provider.d.ts +26 -0
  153. package/dist/types/narration/script.d.ts +154 -0
  154. package/dist/types/openapi/checks.d.ts +27 -0
  155. package/dist/types/openapi/graphql.d.ts +6 -0
  156. package/dist/types/openapi/model.d.ts +27 -10
  157. package/dist/types/openapi/overlay.d.ts +54 -0
  158. package/dist/types/openapi/parse.d.ts +16 -0
  159. package/dist/types/openapi/references.d.ts +30 -4
  160. package/dist/types/ratelimit/cloudflare.d.ts +39 -0
  161. package/dist/types/ratelimit/index.d.ts +27 -0
  162. package/dist/types/ratelimit/memory.d.ts +36 -0
  163. package/dist/types/ratelimit/schema.d.ts +119 -0
  164. package/dist/types/ratelimit/upstash.d.ts +46 -0
  165. package/dist/types/ratelimit/wrangler.d.ts +23 -0
  166. package/dist/types/reference/asyncapi.d.ts +10 -10
  167. package/dist/types/reference/graphql.d.ts +89 -11
  168. package/dist/types/reference/index.d.ts +1 -1
  169. package/dist/types/reference/openapi.d.ts +33 -12
  170. package/dist/types/reference/options.d.ts +82 -6
  171. package/dist/types/reference/scalar.d.ts +13 -0
  172. package/dist/types/reference/schema.d.ts +144 -36
  173. package/dist/types/search/adapters/registry.d.ts +3 -0
  174. package/dist/types/search/adapters/typesense.d.ts +14 -4
  175. package/dist/types/search/build.d.ts +3 -1
  176. package/dist/types/search/documents.d.ts +12 -1
  177. package/dist/types/search/orama-index.d.ts +13 -9
  178. package/dist/types/search/sync/algolia.d.ts +5 -2
  179. package/dist/types/search/sync/index.d.ts +3 -1
  180. package/dist/types/search/sync/typesense.d.ts +11 -7
  181. package/dist/types/seo/metatags.d.ts +20 -0
  182. package/dist/types/sources/contentful.d.ts +16 -0
  183. package/dist/types/sources/github-releases.d.ts +8 -1
  184. package/dist/types/sources/payload.d.ts +2 -0
  185. package/dist/types/sources/registry.d.ts +54 -0
  186. package/dist/types/sources/shared.d.ts +3 -0
  187. package/dist/types/sources/strapi.d.ts +2 -0
  188. package/docs/01-quickstart.mdx +4 -2
  189. package/docs/02-deployment.mdx +71 -17
  190. package/docs/03-upgrading.mdx +4 -4
  191. package/docs/04-migrating.mdx +1 -1
  192. package/docs/advanced/changelog.mdx +13 -2
  193. package/docs/advanced/skills.mdx +15 -1
  194. package/docs/cli/audit.mdx +51 -8
  195. package/docs/cli/doctor.mdx +5 -1
  196. package/docs/cli/evals.mdx +4 -4
  197. package/docs/cli/index.mdx +1 -0
  198. package/docs/cli/translate.mdx +1 -0
  199. package/docs/cli/validate.mdx +4 -3
  200. package/docs/configuration/analytics.mdx +3 -1
  201. package/docs/configuration/assistant.mdx +194 -38
  202. package/docs/configuration/consent.mdx +100 -0
  203. package/docs/configuration/customization.mdx +8 -6
  204. package/docs/configuration/export.mdx +5 -3
  205. package/docs/configuration/index.mdx +64 -5
  206. package/docs/configuration/meta.ts +3 -0
  207. package/docs/configuration/narration.mdx +119 -0
  208. package/docs/configuration/rate-limiting.mdx +90 -0
  209. package/docs/configuration/search.mdx +63 -12
  210. package/docs/configuration/theming.mdx +3 -1
  211. package/docs/content/components.mdx +108 -2
  212. package/docs/content/frontmatter.mdx +80 -2
  213. package/docs/content/i18n.mdx +39 -4
  214. package/docs/content/includes.mdx +16 -0
  215. package/docs/content/meta.mdx +1 -0
  216. package/docs/content/meta.ts +1 -0
  217. package/docs/content/navigation.mdx +32 -10
  218. package/docs/content/sources/contentful.mdx +35 -0
  219. package/docs/content/sources/custom.mdx +43 -0
  220. package/docs/content/sources/github-releases.mdx +39 -0
  221. package/docs/content/sources/index.mdx +91 -0
  222. package/docs/content/sources/meta.ts +16 -0
  223. package/docs/content/sources/notion.mdx +32 -0
  224. package/docs/content/sources/obsidian.mdx +37 -0
  225. package/docs/content/sources/payload.mdx +31 -0
  226. package/docs/content/sources/remote-mdx.mdx +44 -0
  227. package/docs/content/sources/sanity.mdx +29 -0
  228. package/docs/content/sources/strapi.mdx +32 -0
  229. package/docs/content/syntax.mdx +69 -4
  230. package/docs/content/variables.mdx +41 -0
  231. package/docs/discoverability/agent-discovery.mdx +29 -2
  232. package/docs/discoverability/index.mdx +2 -2
  233. package/docs/discoverability/json-api.mdx +2 -0
  234. package/docs/discoverability/llms-txt.mdx +2 -2
  235. package/docs/discoverability/markdown.mdx +3 -1
  236. package/docs/discoverability/mcp.mdx +4 -0
  237. package/docs/discoverability/metadata.mdx +17 -0
  238. package/docs/discoverability/sitemap-and-robots.mdx +1 -1
  239. package/docs/references/api-pages.mdx +74 -0
  240. package/docs/references/asyncapi.mdx +4 -2
  241. package/docs/references/graphql.mdx +14 -2
  242. package/docs/references/meta.ts +1 -1
  243. package/docs/references/openapi.mdx +148 -7
  244. package/docs/references/scalar.mdx +3 -1
  245. package/package.json +43 -8
  246. package/skills/blume/SKILL.md +3 -0
  247. package/skills/blume-migrate/SKILL.md +6 -6
  248. package/skills/blume-migrate/references/docusaurus.md +7 -7
  249. package/skills/blume-migrate/references/fumadocs.md +17 -13
  250. package/skills/blume-migrate/references/mintlify.md +37 -19
  251. package/skills/blume-migrate/references/nextra.md +10 -7
  252. package/skills/blume-migrate/references/starlight.md +11 -8
  253. package/skills/blume-migrate/scripts/mintlify-codemod.mjs +60 -14
  254. package/skills/blume-write-skill/SKILL.md +82 -0
  255. package/src/ai/agent-readability.ts +2 -1
  256. package/src/ai/agent-surface.ts +9 -7
  257. package/src/ai/ai-catalog.ts +6 -3
  258. package/src/ai/ask-context.ts +103 -20
  259. package/src/ai/ask-data.ts +6 -0
  260. package/src/ai/ask-limits.ts +13 -0
  261. package/src/ai/ask-tools.ts +142 -0
  262. package/src/ai/ask.ts +354 -76
  263. package/src/ai/changelog-markdown.ts +11 -6
  264. package/src/ai/component-markdown.ts +76 -1
  265. package/src/ai/cors.ts +14 -3
  266. package/src/ai/index.ts +12 -0
  267. package/src/ai/llms.ts +6 -2
  268. package/src/ai/markdown.ts +2 -1
  269. package/src/ai/mcp/data.ts +6 -0
  270. package/src/ai/mcp/query.ts +14 -6
  271. package/src/ai/openapi-components.ts +36 -6
  272. package/src/ai/relative-links.ts +4 -38
  273. package/src/ai/site-skill.ts +274 -0
  274. package/src/ai/skills.ts +35 -2
  275. package/src/ai/write-skill.ts +97 -0
  276. package/src/astro/generate.ts +210 -66
  277. package/src/astro/index.ts +1 -0
  278. package/src/astro/integration.ts +42 -4
  279. package/src/astro/markdown-negotiation.ts +3 -0
  280. package/src/astro/module-types.ts +9 -1
  281. package/src/astro/pages.ts +23 -0
  282. package/src/astro/templates.ts +406 -108
  283. package/src/astro/variables.ts +31 -0
  284. package/src/audit/catalog.ts +38 -3
  285. package/src/audit/checks/contrast.ts +183 -0
  286. package/src/audit/checks/i18n.ts +2 -3
  287. package/src/audit/checks/indexability.ts +2 -3
  288. package/src/audit/checks/links.ts +19 -13
  289. package/src/audit/checks/network.ts +110 -6
  290. package/src/audit/checks/redirects.ts +6 -4
  291. package/src/audit/checks/robots.ts +58 -2
  292. package/src/audit/checks/sitemap.ts +2 -3
  293. package/src/audit/redirects.ts +46 -15
  294. package/src/audit/run.ts +5 -0
  295. package/src/audit/types.ts +4 -1
  296. package/src/audit/url.ts +14 -5
  297. package/src/blume-modules.d.ts +12 -1
  298. package/src/captcha/client.ts +152 -0
  299. package/src/captcha/hcaptcha.ts +36 -0
  300. package/src/captcha/index.ts +28 -0
  301. package/src/captcha/schema.ts +32 -0
  302. package/src/captcha/turnstile.ts +38 -0
  303. package/src/captcha/verify.ts +71 -0
  304. package/src/cli/args.ts +51 -0
  305. package/src/cli/build-failure.ts +23 -0
  306. package/src/cli/command-meta.ts +5 -0
  307. package/src/cli/commands/audit.ts +10 -1
  308. package/src/cli/commands/dev.ts +18 -2
  309. package/src/cli/commands/doctor.ts +67 -28
  310. package/src/cli/commands/eval.ts +36 -4
  311. package/src/cli/commands/init.ts +6 -4
  312. package/src/cli/commands/skill.ts +96 -0
  313. package/src/cli/commands/validate.ts +10 -1
  314. package/src/cli/index.ts +5 -0
  315. package/src/cli/init/scaffold.ts +3 -3
  316. package/src/cli/prepare.ts +6 -3
  317. package/src/cli/required-secrets.ts +72 -30
  318. package/src/components/BlumePage.astro +2 -0
  319. package/src/components/content/ApiEndpoint.astro +18 -0
  320. package/src/components/content/ApiField.astro +79 -0
  321. package/src/components/content/ApiPlayground.astro +66 -0
  322. package/src/components/content/ApiRail.astro +19 -0
  323. package/src/components/content/Color.astro +1 -0
  324. package/src/components/content/FileTree.astro +1 -0
  325. package/src/components/content/GithubInfo.astro +1 -0
  326. package/src/components/content/Panel.astro +1 -0
  327. package/src/components/content/ParamField.astro +25 -0
  328. package/src/components/content/RequestExample.astro +17 -0
  329. package/src/components/content/ResponseExample.astro +17 -0
  330. package/src/components/content/ResponseField.astro +32 -0
  331. package/src/components/content/Step.astro +1 -0
  332. package/src/components/content/Tile.astro +1 -0
  333. package/src/components/content/Tooltip.astro +1 -0
  334. package/src/components/content/Tree.astro +1 -0
  335. package/src/components/content/TypeTable.astro +4 -1
  336. package/src/components/content/View.astro +21 -0
  337. package/src/components/content/ViewSwitcher.astro +168 -0
  338. package/src/components/content/api-field.ts +103 -0
  339. package/src/components/content/api-page.ts +248 -0
  340. package/src/components/content/mermaid-element.ts +15 -1
  341. package/src/components/content/view-switcher.ts +71 -0
  342. package/src/components/index.ts +2 -0
  343. package/src/components/islands/Assistant.astro +10 -1
  344. package/src/components/islands/assistant.tsx +104 -14
  345. package/src/components/islands/code-question.ts +62 -0
  346. package/src/components/islands/hooks.ts +136 -21
  347. package/src/components/islands/support-link.ts +68 -0
  348. package/src/components/layout/Analytics.astro +11 -2
  349. package/src/components/layout/Banner.astro +14 -10
  350. package/src/components/layout/Breadcrumbs.astro +6 -2
  351. package/src/components/layout/ConsentBanner.astro +62 -0
  352. package/src/components/layout/ConsentHead.astro +38 -0
  353. package/src/components/layout/Directory.astro +94 -0
  354. package/src/components/layout/DrawerSwitchers.astro +51 -0
  355. package/src/components/layout/Empty.astro +2 -2
  356. package/src/components/layout/Header.astro +122 -80
  357. package/src/components/layout/LanguageSwitcher.astro +48 -15
  358. package/src/components/layout/NarrationPlayer.astro +1085 -0
  359. package/src/components/layout/NavSelector.astro +33 -7
  360. package/src/components/layout/PageActions.astro +139 -24
  361. package/src/components/layout/PageFeedback.astro +54 -49
  362. package/src/components/layout/PageLayout.astro +71 -3
  363. package/src/components/layout/ReferenceLayout.astro +17 -6
  364. package/src/components/layout/RelatedPages.astro +42 -0
  365. package/src/components/layout/RootLayout.astro +318 -47
  366. package/src/components/layout/Search.astro +47 -19
  367. package/src/components/layout/SiteFooter.astro +124 -0
  368. package/src/components/layout/SiteMetatags.astro +16 -0
  369. package/src/components/layout/TableOfContents.astro +24 -17
  370. package/src/components/layout/consent/native.ts +79 -0
  371. package/src/components/layout/consent/types.ts +37 -0
  372. package/src/components/layout/footer-links.ts +53 -0
  373. package/src/components/layout/footer-socials.ts +87 -0
  374. package/src/components/layout/head-scripts.ts +6 -1
  375. package/src/components/layout/locale-redirect.ts +107 -0
  376. package/src/components/layout/nav-utils.ts +83 -0
  377. package/src/components/layout/page-feedback.ts +96 -0
  378. package/src/components/layout/search/algolia.ts +10 -1
  379. package/src/components/layout/search/analytics.ts +126 -0
  380. package/src/components/layout/search/endpoint.ts +48 -5
  381. package/src/components/layout/search/flexsearch.ts +17 -5
  382. package/src/components/layout/search/orama-cloud.ts +26 -14
  383. package/src/components/layout/search/pagefind.ts +114 -5
  384. package/src/components/layout/search/types.ts +32 -0
  385. package/src/components/layout/search/typesense.ts +19 -3
  386. package/src/components/openapi/AsyncApiOperation.astro +14 -7
  387. package/src/components/openapi/Authorization.astro +10 -0
  388. package/src/components/openapi/GraphqlOperation.astro +5 -0
  389. package/src/components/openapi/Operation.astro +184 -13
  390. package/src/components/openapi/ParametersTable.astro +8 -4
  391. package/src/components/openapi/Playground.astro +7 -1
  392. package/src/components/openapi/RequestBody.astro +24 -5
  393. package/src/components/openapi/RequestPanel.astro +59 -7
  394. package/src/components/openapi/Responses.astro +7 -4
  395. package/src/components/openapi/SchemaTable.astro +15 -3
  396. package/src/components/openapi/async-snippets.ts +65 -9
  397. package/src/components/openapi/async.ts +123 -29
  398. package/src/components/openapi/code-samples.ts +97 -0
  399. package/src/components/openapi/graphql-helpers.ts +35 -12
  400. package/src/components/openapi/helpers.ts +36 -2
  401. package/src/components/openapi/message-model.ts +54 -11
  402. package/src/components/openapi/message.ts +14 -4
  403. package/src/components/openapi/operation-model.ts +16 -7
  404. package/src/components/openapi/playground-client.ts +24 -5
  405. package/src/components/openapi/playground-schema.ts +1 -1
  406. package/src/components/openapi/schema-tree.ts +44 -14
  407. package/src/components/openapi/security.ts +16 -3
  408. package/src/components/openapi/snippets.ts +873 -10
  409. package/src/components/openapi/validate-json.ts +4 -3
  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/builtin-tags.ts +5 -0
  421. package/src/core/changelog-index.ts +31 -1
  422. package/src/core/client-address.ts +19 -0
  423. package/src/core/component-diagnostics.ts +53 -0
  424. package/src/core/component-overrides.ts +32 -0
  425. package/src/core/config-input.ts +225 -23
  426. package/src/core/data.ts +46 -4
  427. package/src/core/diagnostics.ts +8 -2
  428. package/src/core/footer.ts +26 -0
  429. package/src/core/graph.ts +39 -36
  430. package/src/core/i18n-ui.ts +84 -2
  431. package/src/core/includes.ts +21 -4
  432. package/src/core/links.ts +63 -19
  433. package/src/core/localizable.ts +26 -0
  434. package/src/core/navigation.ts +43 -12
  435. package/src/core/page-modes.ts +56 -0
  436. package/src/core/probe.ts +26 -6
  437. package/src/core/project-graph.ts +163 -16
  438. package/src/core/redirect-patterns.ts +520 -0
  439. package/src/core/related.ts +131 -0
  440. package/src/core/schema.ts +339 -66
  441. package/src/core/sources/cache.ts +6 -0
  442. package/src/core/sources/contentful-rich-text.ts +29 -6
  443. package/src/core/sources/contentful.ts +135 -25
  444. package/src/core/sources/filesystem.ts +26 -4
  445. package/src/core/sources/github-releases.ts +12 -1
  446. package/src/core/sources/lexical.ts +15 -10
  447. package/src/core/sources/mdx-remote.ts +62 -10
  448. package/src/core/sources/normalize.ts +228 -41
  449. package/src/core/sources/notion.ts +7 -1
  450. package/src/core/sources/obsidian.ts +16 -3
  451. package/src/core/sources/payload.ts +38 -15
  452. package/src/core/sources/read.ts +8 -3
  453. package/src/core/sources/remote.ts +72 -15
  454. package/src/core/sources/resolve.ts +11 -1
  455. package/src/core/sources/sanity.ts +43 -25
  456. package/src/core/sources/strapi.ts +2 -2
  457. package/src/core/types.ts +19 -1
  458. package/src/core/ui-packs/ar.ts +44 -0
  459. package/src/core/ui-packs/bg.ts +46 -0
  460. package/src/core/ui-packs/bn.ts +44 -0
  461. package/src/core/ui-packs/ca.ts +47 -0
  462. package/src/core/ui-packs/cs.ts +45 -0
  463. package/src/core/ui-packs/da.ts +46 -0
  464. package/src/core/ui-packs/de.ts +47 -0
  465. package/src/core/ui-packs/el.ts +46 -0
  466. package/src/core/ui-packs/es.ts +47 -0
  467. package/src/core/ui-packs/fa.ts +46 -0
  468. package/src/core/ui-packs/fi.ts +46 -0
  469. package/src/core/ui-packs/fr.ts +47 -0
  470. package/src/core/ui-packs/he.ts +44 -0
  471. package/src/core/ui-packs/hi.ts +45 -0
  472. package/src/core/ui-packs/hr.ts +46 -0
  473. package/src/core/ui-packs/hu.ts +45 -0
  474. package/src/core/ui-packs/id.ts +46 -0
  475. package/src/core/ui-packs/it.ts +46 -0
  476. package/src/core/ui-packs/ja.ts +46 -0
  477. package/src/core/ui-packs/ko.ts +45 -0
  478. package/src/core/ui-packs/nl.ts +47 -0
  479. package/src/core/ui-packs/no.ts +45 -0
  480. package/src/core/ui-packs/pl.ts +46 -0
  481. package/src/core/ui-packs/pt-br.ts +47 -0
  482. package/src/core/ui-packs/pt.ts +46 -0
  483. package/src/core/ui-packs/ro.ts +46 -0
  484. package/src/core/ui-packs/ru.ts +46 -0
  485. package/src/core/ui-packs/sk.ts +45 -0
  486. package/src/core/ui-packs/sr.ts +46 -0
  487. package/src/core/ui-packs/sv.ts +45 -0
  488. package/src/core/ui-packs/th.ts +44 -0
  489. package/src/core/ui-packs/tr.ts +46 -0
  490. package/src/core/ui-packs/uk.ts +46 -0
  491. package/src/core/ui-packs/vi.ts +46 -0
  492. package/src/core/ui-packs/zh-tw.ts +44 -0
  493. package/src/core/ui-packs/zh.ts +44 -0
  494. package/src/core/variables.ts +103 -0
  495. package/src/deploy/adapter-output.ts +7 -2
  496. package/src/deploy/adapters/cloudflare.ts +7 -5
  497. package/src/deploy/adapters/node.ts +47 -9
  498. package/src/deploy/adapters/types.ts +7 -3
  499. package/src/deploy/artifacts.ts +79 -9
  500. package/src/deploy/cloudflare-negotiation.ts +35 -5
  501. package/src/deploy/headers.ts +2 -1
  502. package/src/deploy/node-headers.ts +63 -9
  503. package/src/deploy/platforms/cloudflare.ts +45 -9
  504. package/src/deploy/platforms/netlify.ts +35 -2
  505. package/src/deploy/platforms/node.ts +12 -2
  506. package/src/deploy/platforms/types.ts +21 -7
  507. package/src/deploy/platforms/vercel.ts +149 -17
  508. package/src/deploy/redirects.ts +151 -24
  509. package/src/deploy/rss.ts +3 -1
  510. package/src/deploy/sitemap.ts +39 -5
  511. package/src/deploy/vercel-negotiation.ts +326 -102
  512. package/src/eval/agents.ts +18 -1
  513. package/src/eval/prompts.ts +6 -3
  514. package/src/eval/report.ts +34 -13
  515. package/src/eval/run.ts +5 -0
  516. package/src/markdown/api-rail.ts +259 -0
  517. package/src/markdown/code-title.ts +35 -9
  518. package/src/markdown/features.ts +3 -2
  519. package/src/markdown/fence-meta.ts +2 -0
  520. package/src/markdown/include.ts +11 -1
  521. package/src/markdown/index.ts +28 -5
  522. package/src/markdown/math.ts +4 -4
  523. package/src/markdown/relative-links.ts +3 -2
  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 +7 -6
  531. package/src/openapi/checks.ts +273 -0
  532. package/src/openapi/graphql-build.ts +21 -0
  533. package/src/openapi/graphql.ts +11 -0
  534. package/src/openapi/model.ts +72 -27
  535. package/src/openapi/overlay.ts +256 -0
  536. package/src/openapi/parse.ts +182 -4
  537. package/src/openapi/references.ts +64 -8
  538. package/src/openapi/render-mdx.ts +5 -1
  539. package/src/openapi/scalar.ts +40 -6
  540. package/src/openapi/source.ts +40 -15
  541. package/src/ratelimit/cloudflare.ts +54 -0
  542. package/src/ratelimit/index.ts +30 -0
  543. package/src/ratelimit/memory.ts +45 -0
  544. package/src/ratelimit/runtime.ts +247 -0
  545. package/src/ratelimit/schema.ts +28 -0
  546. package/src/ratelimit/upstash.ts +60 -0
  547. package/src/ratelimit/wrangler.ts +70 -0
  548. package/src/reference/asyncapi.ts +2 -2
  549. package/src/reference/graphql.ts +20 -3
  550. package/src/reference/index.ts +1 -0
  551. package/src/reference/openapi.ts +21 -7
  552. package/src/reference/options.ts +80 -8
  553. package/src/reference/scalar.ts +33 -8
  554. package/src/registry/eject.ts +23 -5
  555. package/src/registry/registry.ts +7 -0
  556. package/src/search/adapters/locale-scope.ts +30 -0
  557. package/src/search/adapters/typesense.ts +14 -4
  558. package/src/search/build.ts +21 -3
  559. package/src/search/documents.ts +26 -2
  560. package/src/search/orama-index.ts +191 -34
  561. package/src/search/pagefind-ranking.ts +39 -0
  562. package/src/search/source-pages.ts +29 -0
  563. package/src/search/sync/algolia.ts +111 -10
  564. package/src/search/sync/index.ts +52 -13
  565. package/src/search/sync/orama-cloud.ts +3 -0
  566. package/src/search/sync/typesense.ts +76 -26
  567. package/src/seo/metatags.ts +67 -0
  568. package/src/sources/contentful.ts +12 -0
  569. package/src/sources/github-releases.ts +7 -1
  570. package/src/sources/shared.ts +3 -0
  571. package/src/theme/chrome-icons.ts +1 -0
  572. package/src/theme/color.ts +500 -0
  573. package/src/theme/entry.ts +85 -6
  574. package/src/theme/palette.ts +121 -45
  575. package/src/translate/prompts.ts +1 -0
  576. package/src/translate/validate.ts +31 -3
  577. package/src/upgrade/upgrade.ts +4 -171
  578. package/dist/cli/chunk-1d7ve1dm.js.map +0 -12
  579. package/dist/cli/chunk-2hsdwb9n.js.map +0 -10
  580. package/dist/cli/chunk-35d4wj9f.js.map +0 -15
  581. package/dist/cli/chunk-364znk6q.js +0 -75
  582. package/dist/cli/chunk-364znk6q.js.map +0 -11
  583. package/dist/cli/chunk-5m5nmvyq.js.map +0 -13
  584. package/dist/cli/chunk-8ktnccpt.js.map +0 -10
  585. package/dist/cli/chunk-9t7a85s3.js.map +0 -10
  586. package/dist/cli/chunk-b07cmahc.js +0 -145
  587. package/dist/cli/chunk-b07cmahc.js.map +0 -11
  588. package/dist/cli/chunk-c8chx29p.js.map +0 -36
  589. package/dist/cli/chunk-e04dxsz1.js +0 -39
  590. package/dist/cli/chunk-e04dxsz1.js.map +0 -10
  591. package/dist/cli/chunk-j85vccga.js.map +0 -36
  592. package/dist/cli/chunk-p3v96n38.js.map +0 -10
  593. package/dist/cli/chunk-pehfxfta.js.map +0 -10
  594. package/dist/cli/chunk-pv29h0wf.js.map +0 -190
  595. package/dist/cli/chunk-q58y5e6a.js.map +0 -10
  596. package/dist/cli/chunk-vg9r4eb9.js.map +0 -14
  597. package/dist/cli/chunk-wrr3j9w9.js.map +0 -35
  598. package/dist/cli/chunk-yfyb25rh.js.map +0 -14
  599. package/docs/content/sources.mdx +0 -334
  600. /package/dist/cli/{chunk-tkacnehg.js.map → chunk-3v3ffbrj.js.map} +0 -0
  601. /package/dist/cli/{chunk-r9rcc4w7.js.map → chunk-8y2kmjv8.js.map} +0 -0
  602. /package/dist/cli/{chunk-2eytanqx.js.map → chunk-c887fj0s.js.map} +0 -0
  603. /package/dist/cli/{chunk-akbpwfxc.js.map → chunk-dzwehpy7.js.map} +0 -0
  604. /package/dist/cli/{chunk-2z928egk.js.map → chunk-ft9vfys6.js.map} +0 -0
  605. /package/dist/cli/{chunk-a58773jm.js.map → chunk-kma9f6sf.js.map} +0 -0
  606. /package/dist/cli/{chunk-crgn1q09.js.map → chunk-sds923fa.js.map} +0 -0
  607. /package/dist/cli/{chunk-acanzt5p.js.map → chunk-tdqhyxfz.js.map} +0 -0
@@ -2,30 +2,32 @@
2
2
  import {
3
3
  ensureGitignore
4
4
  } from "./chunk-yzhm0j9q.js";
5
- import"./chunk-pv29h0wf.js";
5
+ import"./chunk-ehweg4fr.js";
6
6
  import {
7
7
  commandMeta,
8
8
  logger
9
9
  } from "./index.js";
10
10
  import {
11
11
  refuseIfDevRunning
12
- } from "./chunk-akbpwfxc.js";
13
- import"./chunk-3em5wd2y.js";
14
- import"./chunk-5m5nmvyq.js";
12
+ } from "./chunk-dzwehpy7.js";
13
+ import"./chunk-zccbjcj0.js";
14
+ import"./chunk-gb420vvz.js";
15
15
  import {
16
16
  refuseIfEjected
17
- } from "./chunk-ey84smr6.js";
18
- import"./chunk-c8chx29p.js";
19
- import"./chunk-yfyb25rh.js";
20
- import"./chunk-j85vccga.js";
21
- import"./chunk-8ktnccpt.js";
17
+ } from "./chunk-mrcccgnh.js";
18
+ import"./chunk-ep6nd0rn.js";
19
+ import"./chunk-n0v7m8ry.js";
20
+ import"./chunk-ncj7w596.js";
21
+ import"./chunk-66w9j7p6.js";
22
+ import"./chunk-54ztw1nj.js";
22
23
  import"./chunk-jq5n4avg.js";
23
- import"./chunk-r20tn01b.js";
24
- import"./chunk-b07cmahc.js";
24
+ import"./chunk-cm89scdv.js";
25
+ import"./chunk-c1y538kd.js";
25
26
  import {
26
27
  prepareProject
27
- } from "./chunk-tzmab476.js";
28
- import"./chunk-364znk6q.js";
28
+ } from "./chunk-e8xw9qkh.js";
29
+ import"./chunk-t2m5j4pr.js";
30
+ import"./chunk-w1r4vase.js";
29
31
 
30
32
  // src/cli/commands/check.ts
31
33
  import { existsSync } from "node:fs";
@@ -87,5 +89,5 @@ export {
87
89
  checkCommand
88
90
  };
89
91
 
90
- //# debugId=779F976E3FDFA13264756E2164756E21
91
- //# sourceMappingURL=chunk-5xvm6tfj.js.map
92
+ //# debugId=0A78EAC2005AB23B64756E2164756E21
93
+ //# sourceMappingURL=chunk-nq1d20w2.js.map
@@ -4,7 +4,7 @@
4
4
  "sourcesContent": [
5
5
  "import { existsSync } from \"node:fs\";\n\nimport { check } from \"@astrojs/check\";\nimport { sync } from \"astro\";\nimport { defineCommand } from \"citty\";\nimport { join } from \"pathe\";\n\nimport { ensureGitignore } from \"../../core/gitignore.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport { refuseIfDevRunning } from \"../dev-lock.ts\";\nimport { refuseIfEjected } from \"../eject-scripts.ts\";\nimport { logger } from \"../log.ts\";\nimport { prepareProject } from \"../prepare.ts\";\n\nexport const checkCommand = defineCommand({\n args: {\n isolated: {\n description:\n \"Type-check in an isolated .blume-verify runtime so a running dev server is untouched. For verifying changes while `blume dev` runs.\",\n type: \"boolean\",\n },\n preview: {\n description: \"Include drafts and unpublished CMS content.\",\n type: \"boolean\",\n },\n strict: {\n description: \"Fail on content diagnostics as well as type errors.\",\n type: \"boolean\",\n },\n },\n meta: commandMeta.check,\n async run({ args }) {\n const root = process.cwd();\n await refuseIfEjected(root, \"check\");\n\n // `blume check` regenerates `.blume` just like `build`, so it must refuse a\n // live dev server unless isolated. `--isolated` (or BLUME_RUNTIME_DIR)\n // relocates the runtime to `.blume-verify`, which dev never locks.\n const runtimeDir = args.isolated\n ? \".blume-verify\"\n : process.env.BLUME_RUNTIME_DIR;\n refuseIfDevRunning(root, \"checking\", { isolatedHint: true, runtimeDir });\n if (args.isolated) {\n await ensureGitignore(root, [\".blume-verify/\"]);\n }\n\n const project = await prepareProject({\n mode: \"build\",\n preview: args.preview,\n root,\n runtimeDir,\n strict: args.strict,\n strictOptIn: true,\n });\n\n const { outDir } = project.context;\n\n // Generate Astro's content/collection and font types into `.blume/.astro`\n // so `astro:*` virtual modules resolve during the check.\n await sync({ logLevel: \"warn\", root: outDir });\n\n // The project-root tsconfig is what covers the authored `pages/` and config;\n // without it astro check only sees the generated `.blume` project. Falls back\n // to the generated project's own tsconfig when the project has none.\n const tsconfig = join(root, \"tsconfig.json\");\n\n logger.start(`Type-checking ${project.graph.pages.length} page(s)`);\n const failed = await check({\n minimumFailingSeverity: \"error\",\n minimumSeverity: \"hint\",\n root: outDir,\n tsconfig: existsSync(tsconfig) ? tsconfig : undefined,\n watch: false,\n });\n\n if (failed) {\n logger.error(\"Type check failed.\");\n process.exit(1);\n }\n\n logger.success(\"No type errors.\");\n },\n});\n"
6
6
  ],
7
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AACA;AACA;AASO,IAAM,eAAe,cAAc;AAAA,EACxC,MAAM;AAAA,IACJ,UAAU;AAAA,MACR,aACE;AAAA,MACF,MAAM;AAAA,IACR;AAAA,IACA,SAAS;AAAA,MACP,aAAa;AAAA,MACb,MAAM;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACN,aAAa;AAAA,MACb,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,MAAM,YAAY;AAAA,OACZ,IAAG,GAAG,QAAQ;AAAA,IAClB,MAAM,OAAO,QAAQ,IAAI;AAAA,IACzB,MAAM,gBAAgB,MAAM,OAAO;AAAA,IAKnC,MAAM,aAAa,KAAK,WACpB,kBACA,QAAQ,IAAI;AAAA,IAChB,mBAAmB,MAAM,YAAY,EAAE,cAAc,MAAM,WAAW,CAAC;AAAA,IACvE,IAAI,KAAK,UAAU;AAAA,MACjB,MAAM,gBAAgB,MAAM,CAAC,gBAAgB,CAAC;AAAA,IAChD;AAAA,IAE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M,YAAY,EAAE,cAAc,MAAM,WAAW,CAAC;AAAA,IACvE,IAAI,KAAK,UAAU;AAAA,MACjB,MAAM,gBAAgB,MAAM,CAAC,gBAAgB,CAAC;AAAA,IAChD;AAAA,IAEA,MAAM,UAAU,MAAM,eAAe;AAAA,MACnC,MAAM;AAAA,MACN,SAAS,KAAK;AAAA,MACd;AAAA,MACA;AAAA,MACA,QAAQ,KAAK;AAAA,MACb,aAAa;AAAA,IACf,CAAC;AAAA,IAED,QAAQ,WAAW,QAAQ;AAAA,IAI3B,MAAM,KAAK,EAAE,UAAU,QAAQ,MAAM,OAAO,CAAC;AAAA,IAK7C,MAAM,WAAW,KAAK,MAAM,eAAe;AAAA,IAE3C,OAAO,MAAM,iBAAiB,QAAQ,MAAM,MAAM,gBAAgB;AAAA,IAClE,MAAM,SAAS,MAAM,MAAM;AAAA,MACzB,wBAAwB;AAAA,MACxB,iBAAiB;AAAA,MACjB,MAAM;AAAA,MACN,UAAU,WAAW,QAAQ,IAAI,WAAW;AAAA,MAC5C,OAAO;AAAA,IACT,CAAC;AAAA,IAED,IAAI,QAAQ;AAAA,MACV,OAAO,MAAM,oBAAoB;AAAA,MACjC,QAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,IAEA,OAAO,QAAQ,iBAAiB;AAAA;AAEpC,CAAC;",
8
+ "debugId": "0A78EAC2005AB23B64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,30 +1,22 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- BlumeError,
4
- locateFrontmatterKey
3
+ BlumeError
5
4
  } from "./index.js";
6
5
  import {
7
6
  ComponentOverridesError,
8
7
  analyzeComponentOverrides
9
- } from "./chunk-8ktnccpt.js";
8
+ } from "./chunk-54ztw1nj.js";
10
9
  import {
11
- frontmatter_default,
12
- DEFAULT_CONTENT_INCLUDE,
13
- DEFAULT_CONTENT_EXCLUDE,
14
- pageMetaSchema,
15
- baselineScanIgnore,
16
- createModuleLoader,
17
10
  findConfigFile,
18
11
  findComponentsFile,
19
12
  ConfigValidationError,
20
13
  loadConfig
21
- } from "./chunk-pv29h0wf.js";
14
+ } from "./chunk-ehweg4fr.js";
22
15
 
23
16
  // src/upgrade/upgrade.ts
24
17
  import { existsSync } from "node:fs";
25
18
  import { readFile, writeFile } from "node:fs/promises";
26
- import { join, relative, resolve } from "pathe";
27
- import { glob } from "tinyglobby";
19
+ import { join, relative } from "pathe";
28
20
  import { z } from "zod";
29
21
  var UPGRADE_GUIDE_URL = "https://useblume.dev/docs/upgrading";
30
22
  var UPGRADE_GUIDE_FILE = join("docs", "03-upgrading.mdx");
@@ -151,89 +143,6 @@ var scriptFindings = async (root) => {
151
143
  ];
152
144
  });
153
145
  };
154
- var globFields = {
155
- exclude: z.array(z.string()).optional(),
156
- include: z.array(z.string()).optional(),
157
- root: z.string().optional()
158
- };
159
- var rawFilesystemSourceSchema = z.union([
160
- z.looseObject({
161
- kind: z.literal("filesystem"),
162
- options: z.looseObject(globFields).default({})
163
- }).transform((source) => source.options),
164
- z.looseObject({ type: z.literal("filesystem"), ...globFields })
165
- ]);
166
- var rawContentSchema = z.looseObject({
167
- content: z.looseObject({ ...globFields, sources: z.array(z.unknown()).optional() }).optional()
168
- });
169
- var contentGlobs = ({
170
- content
171
- }) => {
172
- const sources = (content?.sources ?? []).flatMap((source) => {
173
- const filesystem = rawFilesystemSourceSchema.safeParse(source);
174
- return filesystem.success ? [filesystem.data] : [];
175
- });
176
- return (sources.length > 0 ? sources : [content ?? {}]).map((globs) => ({
177
- exclude: globs.exclude ?? DEFAULT_CONTENT_EXCLUDE,
178
- include: globs.include ?? DEFAULT_CONTENT_INCLUDE,
179
- root: globs.root ?? "docs"
180
- }));
181
- };
182
- var configContentGlobs = async (root) => {
183
- const file = findConfigFile(root);
184
- let raw = {};
185
- if (file) {
186
- try {
187
- const parsed = rawContentSchema.safeParse(await createModuleLoader()(file));
188
- raw = parsed.success ? parsed.data : {};
189
- } catch {}
190
- }
191
- return contentGlobs(raw);
192
- };
193
- var isPathKey = (segment) => typeof segment !== "symbol";
194
- var PLAIN_UNKNOWN_KEY = "Unrecognized key";
195
- var removedFieldFindings = (file, text, issues) => issues.flatMap((issue) => {
196
- if (issue.code !== "unrecognized_keys" || issue.message.startsWith(PLAIN_UNKNOWN_KEY)) {
197
- return [];
198
- }
199
- const path = issue.path.filter(isPathKey);
200
- const position = locateFrontmatterKey(text, [...path, ...issue.keys.slice(0, 1)]) ?? locateFrontmatterKey(text, path);
201
- return [
202
- {
203
- code: "BLUME_FRONTMATTER_INVALID",
204
- column: position?.column,
205
- file,
206
- line: position?.line,
207
- message: issue.message,
208
- severity: "error"
209
- }
210
- ];
211
- });
212
- var pageFindings = async (file) => {
213
- const text = await readFile(file, "utf-8");
214
- let parsed;
215
- try {
216
- parsed = pageMetaSchema.safeParse(frontmatter_default(text).data);
217
- } catch {
218
- return [];
219
- }
220
- return parsed.success ? [] : removedFieldFindings(file, text, parsed.error.issues);
221
- };
222
- var frontmatterFindings = async (root) => {
223
- const roots = await configContentGlobs(root);
224
- const matches = await Promise.all(roots.map((globs) => {
225
- const cwd = resolve(root, globs.root);
226
- return existsSync(cwd) ? glob(globs.include, {
227
- absolute: true,
228
- cwd,
229
- ignore: [...globs.exclude, ...baselineScanIgnore()],
230
- onlyFiles: true
231
- }) : [];
232
- }));
233
- const files = [...new Set(matches.flat())].toSorted();
234
- const findings = await Promise.all(files.map(pageFindings));
235
- return findings.flat();
236
- };
237
146
  var findingsOf = async (check) => {
238
147
  try {
239
148
  await check();
@@ -257,7 +166,6 @@ var collectUpgradeFindings = async (root) => {
257
166
  ...componentsFile ? await findingsOf(async () => {
258
167
  analyzeComponentOverrides(await readFile(componentsFile, "utf-8"), componentsFile);
259
168
  }) : [],
260
- ...await frontmatterFindings(root),
261
169
  ...await scriptFindings(root)
262
170
  ];
263
171
  };
@@ -290,5 +198,5 @@ When \`${options.runner} blume doctor\` reports no errors, run \`${options.runne
290
198
 
291
199
  export { UPGRADE_GUIDE_URL, UPGRADE_GUIDE_FILE, manualBumpAdvice, bumpBlumeDependency, isOutsideBlumeProject, removedBuildFlags, flagList, removedBuildFlagsAdvice, collectUpgradeFindings, upgradePrompt };
292
200
 
293
- //# debugId=220AF85AD7ADA53D64756E2164756E21
294
- //# sourceMappingURL=chunk-pehfxfta.js.map
201
+ //# debugId=1E503C224ED252A564756E2164756E21
202
+ //# sourceMappingURL=chunk-nrns10mj.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/upgrade/upgrade.ts"],
4
+ "sourcesContent": [
5
+ "import { existsSync } from \"node:fs\";\nimport { readFile, writeFile } from \"node:fs/promises\";\n\nimport { join, relative } from \"pathe\";\nimport { z } from \"zod\";\n\nimport {\n analyzeComponentOverrides,\n ComponentOverridesError,\n} from \"../core/component-overrides.ts\";\nimport { ConfigValidationError, loadConfig } from \"../core/config.ts\";\nimport { BlumeError } from \"../core/diagnostics.ts\";\nimport { findComponentsFile, findConfigFile } from \"../core/project.ts\";\nimport type { Diagnostic } from \"../core/types.ts\";\n\n/**\n * `blume upgrade`'s logic, kept out of the command module so it runs (and is\n * covered) in-process: bump the `blume` dependency to the running CLI's major,\n * then check the project against it — the config through the same loader\n * every command uses, which names each removed or renamed field and its\n * replacement, `components.ts` through the same static planner the build\n * runs, and each page's front matter for fields the schema removed. The\n * command prints the findings or hands them to a coding agent.\n */\n\n/** The upgrade guide's route on the Blume docs site. */\nexport const UPGRADE_GUIDE_URL = \"https://useblume.dev/docs/upgrading\";\n\n/** The upgrade guide's file inside the published package's bundled docs. */\nexport const UPGRADE_GUIDE_FILE = join(\"docs\", \"03-upgrading.mdx\");\n\n/** What `bumpBlumeDependency` did to `package.json`. */\nexport type DependencyBump =\n | {\n field: DependencyField;\n from: string;\n status: \"bumped\";\n to: string;\n }\n | { range: string; status: \"current\" }\n | { range: string; status: \"manual\" }\n | { status: \"missing\" };\n\ntype DependencyField = \"dependencies\" | \"devDependencies\";\n\nconst DEPENDENCY_FIELDS: DependencyField[] = [\n \"dependencies\",\n \"devDependencies\",\n];\n\n/** The slice of `package.json` the bump reads and rewrites. */\ninterface PackageJson {\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n}\n\n// Leading comparators and a `v` may precede the major (`^1.7.3`, `>=1 <2`,\n// `v1`); a protocol (`workspace:`, `file:`, `npm:`) or a tag (`latest`) names\n// no major at all, and those ranges are left to the user.\nconst RANGE_MAJOR = /^[\\s<=>^~v]*(?<major>\\d+)/u;\n\n/** The major version a dependency range pins, or null when it names none. */\nexport const rangeMajor = (range: string): number | null => {\n const major = RANGE_MAJOR.exec(range)?.groups?.major;\n return major === undefined ? null : Number(major);\n};\n\n// Ranges whose version lives somewhere the bump doesn't rewrite: a pnpm\n// catalog in pnpm-workspace.yaml, or the `range` of an `npm:name@range` alias.\nconst CATALOG_RANGE = /^catalog:(?<name>.*)$/u;\nconst NPM_ALIAS = /^npm:.+@(?<range>[^@]*)$/u;\n\n/**\n * What to change by hand for a `blume` range the bump can't rewrite (a\n * `manual` {@link DependencyBump}): the pnpm catalog entry it points at, or\n * the version inside its `npm:` alias.\n */\nexport const manualBumpAdvice = (range: string, version: string): string => {\n const catalog = CATALOG_RANGE.exec(range)?.groups?.name;\n if (catalog === undefined) {\n return `package.json installs blume through the alias \\`${range}\\`, which \\`blume upgrade\\` doesn't rewrite: set the alias's version to ^${version}, then reinstall.`;\n }\n const entry =\n catalog === \"\" || catalog === \"default\"\n ? \"`catalog`\"\n : `\\`catalogs.${catalog}\\``;\n return `package.json takes blume from the pnpm catalog (\\`${range}\\`), which \\`blume upgrade\\` can't bump: set blume to ^${version} under ${entry} in pnpm-workspace.yaml if it isn't already, then reinstall.`;\n};\n\n// The file's own indentation (two spaces, four, or a tab), so a fallback\n// rewrite doesn't reformat a package.json the user keeps differently.\nconst INDENT = /^(?<indent>[ \\t]+)\"/mu;\n\nconst REGEXP_SPECIAL = /[$()*+.?[\\\\\\]^{|}]/gu;\nconst escapeRegExp = (value: string): string =>\n value.replaceAll(REGEXP_SPECIAL, String.raw`\\$&`);\n\n/**\n * `text` with the `blume` range under `field` replaced in place, so the file\n * keeps its own formatting, key order, and inline objects; null when the entry\n * isn't written the plain way (an escaped key or value).\n */\nconst replaceRange = (\n text: string,\n field: DependencyField,\n from: string,\n to: string\n): string | null => {\n const value = JSON.stringify(from);\n const entry = new RegExp(`\"blume\"\\\\s*:\\\\s*${escapeRegExp(value)}`, \"gu\");\n entry.lastIndex = Math.max(text.indexOf(JSON.stringify(field)), 0);\n const match = entry.exec(text);\n if (!match) {\n return null;\n }\n const end = match.index + match[0].length;\n return `${text.slice(0, end - value.length)}${JSON.stringify(to)}${text.slice(end)}`;\n};\n\n/**\n * Point `package.json`'s `blume` dependency at `^version` when it pins an\n * older major. A range already on this major, or one that names no version\n * (`workspace:*`, `latest`), is reported as current and left alone; one whose\n * version lives elsewhere (`catalog:`, an `npm:` alias of an older major) is\n * `manual`, for the user to change; a project with no `package.json`, or none\n * that lists `blume`, is `missing`. Only the range changes: the rest of the\n * file is kept byte for byte.\n */\nexport const bumpBlumeDependency = async (\n root: string,\n version: string\n): Promise<DependencyBump> => {\n const path = join(root, \"package.json\");\n if (!existsSync(path)) {\n return { status: \"missing\" };\n }\n const text = await readFile(path, \"utf-8\");\n // SAFETY: package.json is a JSON object; only its dependency maps, which\n // map package names to range strings, are read.\n const pkg = JSON.parse(text) as PackageJson;\n const field = DEPENDENCY_FIELDS.find(\n (name) => pkg[name]?.blume !== undefined\n );\n const from = field ? pkg[field]?.blume : undefined;\n if (!(field && from)) {\n return { status: \"missing\" };\n }\n if (CATALOG_RANGE.test(from)) {\n return { range: from, status: \"manual\" };\n }\n const aliased = NPM_ALIAS.exec(from)?.groups?.range;\n const current = rangeMajor(aliased ?? from);\n const target = rangeMajor(version);\n if (current === null || target === null || current >= target) {\n return { range: from, status: \"current\" };\n }\n if (aliased !== undefined) {\n return { range: from, status: \"manual\" };\n }\n const to = `^${version}`;\n const indent = INDENT.exec(text)?.groups?.indent ?? \" \";\n const updated = { ...pkg, [field]: { ...pkg[field], blume: to } };\n await writeFile(\n path,\n replaceRange(text, field, from, to) ??\n `${JSON.stringify(updated, null, indent)}\\n`\n );\n return { field, from, status: \"bumped\", to };\n};\n\n/**\n * Whether `root` is no Blume project at all: no config file and no `blume`\n * dependency, so the upgrade would only check the defaults and report the\n * folder ready. A zero-config project still lists `blume`.\n */\nexport const isOutsideBlumeProject = (\n root: string,\n bump: DependencyBump\n): boolean => bump.status === \"missing\" && findConfigFile(root) === null;\n\n// ---------------------------------------------------------------------------\n// Removed `blume build` flags\n// ---------------------------------------------------------------------------\n\n/** A `blume build` flag Blume 2 removed, bare or with an `=value`. */\nconst REMOVED_BUILD_FLAG = /^--(?<flag>adapter|base|output)(?:=|$)/u;\n\n/** The removed `blume build` flags among `args`, in order, each once. */\nexport const removedBuildFlags = (args: readonly string[]): string[] => [\n ...new Set(\n args.flatMap((arg) => {\n const flag = REMOVED_BUILD_FLAG.exec(arg)?.groups?.flag;\n return flag ? [flag] : [];\n })\n ),\n];\n\n/** The flags as the reader typed them: `--adapter, --output`. */\nexport const flagList = (flags: string[]): string =>\n flags.map((flag) => `--${flag}`).join(\", \");\n\n/** What replaces each removed flag: the `deployment` config. */\nexport const removedBuildFlagsAdvice = (flags: string[]): string => {\n const advice: string[] = [];\n if (flags.includes(\"adapter\") || flags.includes(\"output\")) {\n advice.push(\n 'name the host in blume.config.ts with `deployment: vercel()` (or `netlify()`, `cloudflare()`, `node()`) from \"blume/deploy\" — a host adapter builds for the server, and `output: \"static\"` keeps it static'\n );\n }\n if (flags.includes(\"base\")) {\n advice.push(\n 'set the subpath with `deployment: { base: \"/docs\" }`, or the host adapter\\'s `base` option'\n );\n }\n return `Drop ${flagList(flags)} and ${advice.join(\"; \")}.`;\n};\n\n// A command that runs the Blume CLI: the bare bin, a versioned package\n// (`blume@2`), or a path to it (`./node_modules/.bin/blume`).\nconst BLUME_BIN = /(?:^|[/\\\\])blume(?:@\\S+)?$/u;\nconst COMMAND_SEPARATOR = /&&|\\|\\||[;|]/u;\nconst WHITESPACE = /\\s+/u;\n\n/** The arguments each `blume build` in a script passes, flattened. */\nconst buildArgs = (script: string): string[] =>\n script.split(COMMAND_SEPARATOR).flatMap((command) => {\n const words = command.trim().split(WHITESPACE);\n const at = words.findIndex(\n (word, index) => BLUME_BIN.test(word) && words[index + 1] === \"build\"\n );\n return at === -1 ? [] : words.slice(at + 2);\n });\n\n/** The slice of package.json the script check reads. */\nconst scriptsSchema = z.looseObject({\n scripts: z.record(z.string(), z.string()).default({}),\n});\n\nconst lineOf = (text: string, index: number): number =>\n text.slice(0, index).split(\"\\n\").length;\n\n/**\n * A finding for each package.json script that still passes a removed flag to\n * `blume build` — it would otherwise build a static site without a word.\n */\nconst scriptFindings = async (root: string): Promise<Diagnostic[]> => {\n const path = join(root, \"package.json\");\n if (!existsSync(path)) {\n return [];\n }\n const text = await readFile(path, \"utf-8\");\n const pkg = scriptsSchema.safeParse(JSON.parse(text));\n const scripts = pkg.success ? pkg.data.scripts : {};\n const scriptsAt = text.indexOf('\"scripts\"');\n return Object.entries(scripts).flatMap(([name, script]) => {\n const flags = removedBuildFlags(buildArgs(script));\n if (flags.length === 0) {\n return [];\n }\n const at = text.indexOf(JSON.stringify(name), scriptsAt);\n return [\n {\n code: \"BLUME_BUILD_FLAG_REMOVED\",\n file: path,\n line: at === -1 ? undefined : lineOf(text, at),\n message: `The \"${name}\" script passes ${flagList(flags)} to \\`blume build\\`, which Blume 2 removed.`,\n severity: \"error\",\n suggestion: removedBuildFlagsAdvice(flags),\n } satisfies Diagnostic,\n ];\n });\n};\n\n/**\n * Run one check, turning the {@link BlumeError} it throws into its findings:\n * each config issue or `components.ts` entry on its own, or the one diagnostic\n * any other check has.\n */\nconst findingsOf = async (\n check: () => Promise<void>\n): Promise<Diagnostic[]> => {\n try {\n await check();\n return [];\n } catch (error) {\n if (\n error instanceof ConfigValidationError ||\n error instanceof ComponentOverridesError\n ) {\n return error.issues;\n }\n if (error instanceof BlumeError) {\n return [error.diagnostic];\n }\n throw error;\n }\n};\n\n/**\n * Check a project against this version of Blume: its config through the\n * loader (every invalid field, each with its line and replacement), its\n * `components.ts` through the static override planner (each entry at its\n * line), and its package.json scripts for `blume build` flags that no longer\n * exist. Returns the failures;\n * an empty list means the project is ready.\n */\nexport const collectUpgradeFindings = async (\n root: string\n): Promise<Diagnostic[]> => {\n const componentsFile = findComponentsFile(root);\n return [\n ...(await findingsOf(async () => {\n await loadConfig(root);\n })),\n ...(componentsFile\n ? await findingsOf(async () => {\n analyzeComponentOverrides(\n await readFile(componentsFile, \"utf-8\"),\n componentsFile\n );\n })\n : []),\n ...(await scriptFindings(root)),\n ];\n};\n\n/** A finding as plain text for the agent: where, what, and the fix. */\nconst plainFinding = (finding: Diagnostic, root: string): string => {\n const where = finding.file\n ? `${relative(root, finding.file)}${finding.line === undefined ? \"\" : `:${finding.line}`}`\n : \"blume.config.ts\";\n const fix = finding.suggestion ? `\\n Fix: ${finding.suggestion}` : \"\";\n return `- ${where} (${finding.code})\\n ${finding.message.replaceAll(\"\\n\", \"\\n \")}${fix}`;\n};\n\n/**\n * The handoff prompt: the findings inline (they're few, and each already\n * names its replacement), where the guide is, and the ground rules — change\n * the config's shape, never the site's behavior, and verify with the site's\n * own checks, run through the project's package runner (`npx`, `pnpm exec`),\n * since a local install puts no `blume` on PATH.\n */\nexport const upgradePrompt = (options: {\n findings: Diagnostic[];\n guidePath: string;\n root: string;\n runner: string;\n version: string;\n}): string =>\n `Upgrade this Blume project to Blume ${options.version}. \\`blume upgrade\\` has bumped the \\`blume\\` dependency in package.json where it could; what's left is the config.\n\nThe upgrade guide is at ${options.guidePath} (online at ${UPGRADE_GUIDE_URL}). It covers every change between Blume 1 and 2 with before-and-after examples: search, deployment, content sources, API references, analytics, and the assistant's model provider become adapters imported from \\`blume/*\\` subpaths; the machine-readable settings move from \\`ai\\` to \\`agents\\`; Ask AI is renamed the assistant, so \\`ai.ask\\` becomes \\`ai.assistant\\`; and \\`components.ts\\` entries must be one of the static forms.\n\n\\`blume upgrade\\` found:\n\n${options.findings.map((finding) => plainFinding(finding, options.root)).join(\"\\n\\n\")}\n\nWork through every finding:\n1. Read the guide section for each change before editing.\n2. Rewrite the config to the Blume 2 form, adding the adapter imports it needs. Keep the site's behavior the same: the same content, routes, search backend, deployment target, analytics, and credentials (keep reading secrets from the same environment variables).\n3. The config loader reports every invalid field at once, but some changes only surface once earlier ones are fixed, so rerun \\`${options.runner} blume doctor\\` after each round of edits.\n4. Never delete content, or remove a setting only to silence an error; if something needs a human decision, leave it and say so in your summary.\n\nWhen \\`${options.runner} blume doctor\\` reports no errors, run \\`${options.runner} blume build\\` and fix anything it reports until it succeeds.`;\n"
6
+ ],
7
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AACA;AAsBO,IAAM,oBAAoB;AAG1B,IAAM,qBAAqB,KAAK,QAAQ,kBAAkB;AAgBjE,IAAM,oBAAuC;AAAA,EAC3C;AAAA,EACA;AACF;AAWA,IAAM,cAAc;AAGb,IAAM,aAAa,CAAC,UAAiC;AAAA,EAC1D,MAAM,QAAQ,YAAY,KAAK,KAAK,GAAG,QAAQ;AAAA,EAC/C,OAAO,UAAU,YAAY,OAAO,OAAO,KAAK;AAAA;AAKlD,IAAM,gBAAgB;AACtB,IAAM,YAAY;AAOX,IAAM,mBAAmB,CAAC,OAAe,YAA4B;AAAA,EAC1E,MAAM,UAAU,cAAc,KAAK,KAAK,GAAG,QAAQ;AAAA,EACnD,IAAI,YAAY,WAAW;AAAA,IACzB,OAAO,mDAAmD,iFAAiF;AAAA,EAC7I;AAAA,EACA,MAAM,QACJ,YAAY,MAAM,YAAY,YAC1B,cACA,cAAc;AAAA,EACpB,OAAO,qDAAqD,+DAA+D,iBAAiB;AAAA;AAK9I,IAAM,SAAS;AAEf,IAAM,iBAAiB;AACvB,IAAM,eAAe,CAAC,UACpB,MAAM,WAAW,gBAAgB,OAAO,QAAQ;AAOlD,IAAM,e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AAA,GAAM,IAAI;AAAA;AAUhF,IAAM,gBAAgB,CAAC,YAO5B,uCAAuC,QAAQ;AAAA;AAAA,0BAEvB,QAAQ,wBAAwB;AAAA;AAAA;AAAA;AAAA,EAIxD,QAAQ,SAAS,IAAI,CAAC,YAAY,aAAa,SAAS,QAAQ,IAAI,CAAC,EAAE,KAAK;AAAA;AAAA,CAAM;AAAA;AAAA;AAAA;AAAA;AAAA,kIAK8C,QAAQ;AAAA;AAAA;AAAA,SAGjI,QAAQ,kDAAkD,QAAQ;",
8
+ "debugId": "1E503C224ED252A564756E2164756E21",
9
+ "names": []
10
+ }
@@ -8,15 +8,15 @@ import {
8
8
  VERSION_ID,
9
9
  VERSION_LIKE,
10
10
  versionizeRoute
11
- } from "./chunk-pv29h0wf.js";
11
+ } from "./chunk-ehweg4fr.js";
12
12
  import {
13
13
  mountBasePath,
14
14
  stripBasePath
15
- } from "./chunk-3em5wd2y.js";
15
+ } from "./chunk-zccbjcj0.js";
16
16
  import {
17
17
  isWithin,
18
18
  scanProject
19
- } from "./chunk-j85vccga.js";
19
+ } from "./chunk-ncj7w596.js";
20
20
 
21
21
  // src/core/version-cut.ts
22
22
  import { existsSync } from "node:fs";
@@ -280,4 +280,4 @@ var cutVersion = async (root, id, options = {}) => {
280
280
  export { CutError, unregisteredSnapshotDiagnostics, cutVersion };
281
281
 
282
282
  //# debugId=8631919BA7BA49B664756E2164756E21
283
- //# sourceMappingURL=chunk-crgn1q09.js.map
283
+ //# sourceMappingURL=chunk-sds923fa.js.map
@@ -0,0 +1,104 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ needsPlaygroundProxy,
4
+ resolveAskBackend
5
+ } from "./chunk-ehweg4fr.js";
6
+
7
+ // src/core/server-features.ts
8
+ var serverFeatures = (config) => {
9
+ const features = [];
10
+ if (config.ai.assistant?.enabled && !config.ai.assistant.endpoint) {
11
+ features.push("Assistant");
12
+ }
13
+ if (config.agents.mcp.enabled) {
14
+ features.push("MCP server");
15
+ }
16
+ if (needsPlaygroundProxy(config)) {
17
+ features.push("API playground proxy");
18
+ }
19
+ if (config.search.provider.mode === "server") {
20
+ features.push(`Search (${config.search.provider.kind})`);
21
+ }
22
+ return features;
23
+ };
24
+
25
+ // src/cli/required-secrets.ts
26
+ var adapterSecretOwners = (config) => {
27
+ const { consent, deployment, rateLimit } = config;
28
+ const { provider } = config.search;
29
+ const owners = [
30
+ { feature: `Search (${provider.kind})`, secrets: provider.requiredSecrets },
31
+ ...config.analytics.map((adapter) => ({
32
+ feature: `Analytics (${adapter.kind})`,
33
+ secrets: adapter.requiredSecrets
34
+ })),
35
+ ...config.content.sources.map((source) => ({
36
+ feature: `Content source (${source.kind})`,
37
+ secrets: source.requiredSecrets
38
+ })),
39
+ ...config.reference.map((adapter) => ({
40
+ feature: `API reference (${adapter.kind})`,
41
+ secrets: adapter.requiredSecrets
42
+ })),
43
+ {
44
+ feature: `Deployment (${deployment.kind})`,
45
+ secrets: deployment.requiredSecrets
46
+ }
47
+ ];
48
+ if (consent) {
49
+ owners.push({
50
+ feature: `Consent (${consent.kind})`,
51
+ secrets: consent.requiredSecrets
52
+ });
53
+ }
54
+ if (rateLimit) {
55
+ owners.push({
56
+ feature: `Rate limiting (${rateLimit.kind})`,
57
+ note: "read at request time; without it the routes count in memory",
58
+ secrets: rateLimit.requiredSecrets
59
+ });
60
+ }
61
+ return owners;
62
+ };
63
+ var checkRequiredSecrets = (config) => {
64
+ const diagnostics = [];
65
+ const requireSecret = (feature, env, note) => {
66
+ if (process.env[env]) {
67
+ return;
68
+ }
69
+ const noteSuffix = note ? ` (${note})` : "";
70
+ diagnostics.push({
71
+ code: "BLUME_MISSING_SECRET",
72
+ message: `${feature} is enabled but ${env} is not set${noteSuffix}.`,
73
+ severity: "warning",
74
+ suggestion: `Set ${env} in .env.local for local dev, or in your host's environment for production.`
75
+ });
76
+ };
77
+ if (config.ai.assistant?.enabled && !config.ai.assistant.endpoint) {
78
+ const { captcha, provider } = config.ai.assistant;
79
+ const backend = resolveAskBackend(provider);
80
+ for (const env of provider.requiredSecrets) {
81
+ requireSecret(`Assistant (${backend.label})`, env, backend.secretNote);
82
+ }
83
+ for (const env of captcha?.requiredSecrets ?? []) {
84
+ requireSecret(`Assistant bot check (${captcha?.kind})`, env);
85
+ }
86
+ }
87
+ const { narration } = config;
88
+ if (narration.enabled && narration.provider) {
89
+ for (const env of narration.provider.requiredSecrets) {
90
+ requireSecret("Narration audio", env, "read at build; without it pages use browser voices");
91
+ }
92
+ }
93
+ for (const owner of adapterSecretOwners(config)) {
94
+ for (const env of owner.secrets) {
95
+ requireSecret(owner.feature, env, owner.note);
96
+ }
97
+ }
98
+ return diagnostics;
99
+ };
100
+
101
+ export { serverFeatures, checkRequiredSecrets };
102
+
103
+ //# debugId=D62D6223654FF46464756E2164756E21
104
+ //# sourceMappingURL=chunk-t2m5j4pr.js.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/core/server-features.ts", "../src/cli/required-secrets.ts"],
4
+ "sourcesContent": [
5
+ "import { needsPlaygroundProxy } from \"../openapi/references.ts\";\nimport type { ResolvedConfig } from \"./schema.ts\";\n\n/**\n * List the enabled features that require Astro server output. Static builds\n * fail clearly when any of these are enabled.\n */\nexport const serverFeatures = (config: ResolvedConfig): string[] => {\n const features: string[] = [];\n if (config.ai.assistant?.enabled && !config.ai.assistant.endpoint) {\n features.push(\"Assistant\");\n }\n // The hosted MCP server is a live JSON-RPC endpoint, so it needs a runtime.\n if (config.agents.mcp.enabled) {\n features.push(\"MCP server\");\n }\n // The built-in playground proxy (`playground.proxy: true` on an `openapi()`\n // or `graphql()` adapter) is a live fetch endpoint at `/_api-proxy`; an\n // external proxy URL (string) or a proxy-less playground stays fully static.\n if (needsPlaygroundProxy(config)) {\n features.push(\"API playground proxy\");\n }\n // A `server` adapter (Mixedbread) proxies queries through a secret server\n // endpoint, so it can't run on a static build.\n if (config.search.provider.mode === \"server\") {\n features.push(`Search (${config.search.provider.kind})`);\n }\n return features;\n};\n",
6
+ "import { resolveAskBackend } from \"../ai/ask.ts\";\nimport type { ResolvedConfig } from \"../core/schema.ts\";\nimport type { Diagnostic } from \"../core/types.ts\";\n\n/** A feature, and the secrets the adapter behind it reads. */\ninterface SecretOwner {\n feature: string;\n note?: string;\n secrets: string[];\n}\n\n/**\n * The adapters that name their own secrets. The built-ins mostly declare\n * none: analytics ships public tokens in the page, consent managers load\n * public scripts, reference adapters read public specs, and host adapters\n * read platform-injected env.\n */\nconst adapterSecretOwners = (config: ResolvedConfig): SecretOwner[] => {\n const { consent, deployment, rateLimit } = config;\n const { provider } = config.search;\n const owners: SecretOwner[] = [\n // Each search adapter declares the secrets its generated runtime reads.\n { feature: `Search (${provider.kind})`, secrets: provider.requiredSecrets },\n ...config.analytics.map((adapter) => ({\n feature: `Analytics (${adapter.kind})`,\n secrets: adapter.requiredSecrets,\n })),\n // Each content source adapter declares the env vars its fetch reads.\n ...config.content.sources.map((source) => ({\n feature: `Content source (${source.kind})`,\n secrets: source.requiredSecrets,\n })),\n ...config.reference.map((adapter) => ({\n feature: `API reference (${adapter.kind})`,\n secrets: adapter.requiredSecrets,\n })),\n {\n feature: `Deployment (${deployment.kind})`,\n secrets: deployment.requiredSecrets,\n },\n ];\n if (consent) {\n owners.push({\n feature: `Consent (${consent.kind})`,\n secrets: consent.requiredSecrets,\n });\n }\n // Upstash's endpoint and token.\n if (rateLimit) {\n owners.push({\n feature: `Rate limiting (${rateLimit.kind})`,\n note: \"read at request time; without it the routes count in memory\",\n secrets: rateLimit.requiredSecrets,\n });\n }\n return owners;\n};\n\n/**\n * Warn early when an enabled feature needs a secret env var that isn't set, so\n * the failure surfaces at `blume dev`/`build` instead of at the first request in\n * production. These are runtime secrets (the endpoint reads them on the server),\n * so this warns rather than hard-fails — the value may live only in the deploy\n * environment. Build-time secrets (search-index sync) are checked by the sync.\n */\nexport const checkRequiredSecrets = (config: ResolvedConfig): Diagnostic[] => {\n const diagnostics: Diagnostic[] = [];\n const requireSecret = (feature: string, env: string, note?: string): void => {\n if (process.env[env]) {\n return;\n }\n const noteSuffix = note ? ` (${note})` : \"\";\n diagnostics.push({\n code: \"BLUME_MISSING_SECRET\",\n message: `${feature} is enabled but ${env} is not set${noteSuffix}.`,\n severity: \"warning\",\n suggestion: `Set ${env} in .env.local for local dev, or in your host's environment for production.`,\n });\n };\n\n if (config.ai.assistant?.enabled && !config.ai.assistant.endpoint) {\n // The adapter descriptor names the env vars its route reads.\n const { captcha, provider } = config.ai.assistant;\n const backend = resolveAskBackend(provider);\n for (const env of provider.requiredSecrets) {\n requireSecret(`Assistant (${backend.label})`, env, backend.secretNote);\n }\n // The bot check's secret key, which the route verifies tokens with.\n for (const env of captcha?.requiredSecrets ?? []) {\n requireSecret(`Assistant bot check (${captcha?.kind})`, env);\n }\n }\n\n // Generated narration reads its key at build, not at runtime; without it the\n // build skips the audio and pages read with browser voices.\n const { narration } = config;\n if (narration.enabled && narration.provider) {\n for (const env of narration.provider.requiredSecrets) {\n requireSecret(\n \"Narration audio\",\n env,\n \"read at build; without it pages use browser voices\"\n );\n }\n }\n\n for (const owner of adapterSecretOwners(config)) {\n for (const env of owner.secrets) {\n requireSecret(owner.feature, env, owner.note);\n }\n }\n\n return diagnostics;\n};\n"
7
+ ],
8
+ "mappings": ";;;;;;;AAOO,IAAM,iBAAiB,CAAC,WAAqC;AAAA,EAClE,MAAM,WAAqB,CAAC;AAAA,EAC5B,IAAI,OAAO,GAAG,WAAW,WAAW,CAAC,OAAO,GAAG,UAAU,UAAU;AAAA,IACjE,SAAS,KAAK,WAAW;AAAA,EAC3B;AAAA,EAEA,IAAI,OAAO,OAAO,IAAI,SAAS;AAAA,IAC7B,SAAS,KAAK,YAAY;AAAA,EAC5B;AAAA,EAIA,IAAI,qBAAqB,MAAM,GAAG;AAAA,IAChC,SAAS,KAAK,sBAAsB;AAAA,EACtC;AAAA,EAGA,IAAI,OAAO,OAAO,SAAS,SAAS,UAAU;AAAA,IAC5C,SAAS,KAAK,W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OAAO,KAAK,UAAU;AAAA,IACzC,YAAY,KAAK;AAAA,MACf,MAAM;AAAA,MACN,SAAS,GAAG,0BAA0B,iBAAiB;AAAA,MACvD,UAAU;AAAA,MACV,YAAY,OAAO;AAAA,IACrB,CAAC;AAAA;AAAA,EAGH,IAAI,OAAO,GAAG,WAAW,WAAW,CAAC,OAAO,GAAG,UAAU,UAAU;AAAA,IAEjE,QAAQ,SAAS,aAAa,OAAO,GAAG;AAAA,IACxC,MAAM,UAAU,kBAAkB,QAAQ;AAAA,IAC1C,WAAW,OAAO,SAAS,iBAAiB;AAAA,MAC1C,cAAc,cAAc,QAAQ,UAAU,KAAK,QAAQ,UAAU;AAAA,IACvE;AAAA,IAEA,WAAW,OAAO,SAAS,mBAAmB,CAAC,GAAG;AAAA,MAChD,cAAc,wBAAwB,SAAS,SAAS,GAAG;AAAA,IAC7D;AAAA,EACF;AAAA,EAIA,QAAQ,cAAc;AAAA,EACtB,IAAI,UAAU,WAAW,UAAU,UAAU;AAAA,IAC3C,WAAW,OAAO,UAAU,SAAS,iBAAiB;AAAA,MACpD,cACE,mBACA,KACA,oDACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA,WAAW,SAAS,oBAAoB,MAAM,GAAG;AAAA,IAC/C,WAAW,OAAO,MAAM,SAAS;AAAA,MAC/B,cAAc,MAAM,SAAS,KAAK,MAAM,IAAI;AAAA,IAC9C;AAAA,EACF;AAAA,EAEA,OAAO;AAAA;",
9
+ "debugId": "D62D6223654FF46464756E2164756E21",
10
+ "names": []
11
+ }
@@ -3,8 +3,8 @@ import {
3
3
  deployPlatform,
4
4
  resolveProjectContext,
5
5
  loadConfig
6
- } from "./chunk-pv29h0wf.js";
7
- import"./chunk-3em5wd2y.js";
6
+ } from "./chunk-ehweg4fr.js";
7
+ import"./chunk-zccbjcj0.js";
8
8
  import {
9
9
  commandMeta,
10
10
  normalizeHost,
@@ -12,13 +12,13 @@ import {
12
12
  } from "./index.js";
13
13
  import {
14
14
  deployOutputDir
15
- } from "./chunk-5m5nmvyq.js";
15
+ } from "./chunk-gb420vvz.js";
16
16
  import {
17
17
  parsePort
18
- } from "./chunk-e04dxsz1.js";
18
+ } from "./chunk-j134vrp2.js";
19
19
  import {
20
20
  refuseIfEjected
21
- } from "./chunk-ey84smr6.js";
21
+ } from "./chunk-mrcccgnh.js";
22
22
 
23
23
  // src/cli/commands/preview.ts
24
24
  import { existsSync } from "node:fs";
@@ -61,4 +61,4 @@ export {
61
61
  };
62
62
 
63
63
  //# debugId=062E50A4A26E603564756E2164756E21
64
- //# sourceMappingURL=chunk-acanzt5p.js.map
64
+ //# sourceMappingURL=chunk-tdqhyxfz.js.map
@@ -0,0 +1,126 @@
1
+ #!/usr/bin/env node
2
+ import"./chunk-ehweg4fr.js";
3
+ import"./chunk-zccbjcj0.js";
4
+ import {
5
+ packageRoot,
6
+ getBlumeVersion,
7
+ commandMeta,
8
+ reportInternalError,
9
+ BlumeError,
10
+ logger,
11
+ reportDiagnostics
12
+ } from "./index.js";
13
+ import {
14
+ AGENTS,
15
+ launchInstalledAgent
16
+ } from "./chunk-42t4jxdx.js";
17
+ import {
18
+ scanProject
19
+ } from "./chunk-ncj7w596.js";
20
+ import {
21
+ siteSkillName
22
+ } from "./chunk-w1r4vase.js";
23
+
24
+ // src/cli/commands/skill.ts
25
+ import { defineCommand } from "citty";
26
+ import { join as join2 } from "pathe";
27
+
28
+ // src/ai/write-skill.ts
29
+ import { existsSync } from "node:fs";
30
+ import { join, relative, resolve } from "pathe";
31
+ var WRITE_SKILL_DIR = join("skills", "blume-write-skill");
32
+ var DEFAULT_SKILLS_DIR = "skills";
33
+ var planSkill = (project) => {
34
+ const { config, context } = project;
35
+ const name = siteSkillName(project);
36
+ const file = resolve(context.root, config.agents.skills ?? DEFAULT_SKILLS_DIR, name, "SKILL.md");
37
+ const plan = {
38
+ configFile: context.configFile ? relative(context.root, context.configFile) : "blume.config.ts",
39
+ contentRoot: relative(context.root, context.contentRoot) || ".",
40
+ exists: existsSync(file),
41
+ file: relative(context.root, file),
42
+ name,
43
+ site: config.deployment.options.site,
44
+ title: config.title
45
+ };
46
+ return config.agents.skills ? plan : { ...plan, configure: `./${DEFAULT_SKILLS_DIR}` };
47
+ };
48
+ var writeSkillPrompt = (plan, options) => {
49
+ const { skillDir, version } = options;
50
+ const lines = [
51
+ `Write the agent skill for the ${plan.title} docs, a Blume ${version} site.`,
52
+ "",
53
+ `Follow the blume-write-skill skill: read ${join(skillDir, "SKILL.md")} first and work through its workflow.`,
54
+ "",
55
+ plan.exists ? `A skill already exists at ${plan.file}. Update it against the current docs rather than starting over, and keep what's still true.` : `Write it to ${plan.file}.`,
56
+ `Its frontmatter \`name\` must be \`${plan.name}\`: that's the name of the skill Blume generates for this site, and a skill with the same name replaces it.`
57
+ ];
58
+ if (plan.configure) {
59
+ lines.push(`Then set \`agents.skills: "${plan.configure}"\` in ${plan.configFile} so the build publishes it.`);
60
+ }
61
+ lines.push("", `The docs source is in ${plan.contentRoot}.`, plan.site ? `The site is served at ${plan.site}, so link pages as ${plan.site.replace(/\/$/u, "")}<route>.md.` : `The config has no \`deployment.site\`, and the skill's links must be absolute. Ask me for the site's URL, and set it as \`deployment.site\` in ${plan.configFile}.`);
62
+ return lines.join(`
63
+ `);
64
+ };
65
+
66
+ // src/cli/commands/skill.ts
67
+ var skillCommand = defineCommand({
68
+ args: {
69
+ claude: {
70
+ description: "Write the skill with Claude Code.",
71
+ type: "boolean"
72
+ },
73
+ codex: {
74
+ description: "Write the skill with Codex.",
75
+ type: "boolean"
76
+ }
77
+ },
78
+ meta: commandMeta.skill,
79
+ async run({ args }) {
80
+ const root = process.cwd();
81
+ const agents = Object.keys(AGENTS).filter((kind) => args[kind]);
82
+ if (agents.length > 1) {
83
+ logger.error("Pass at most one of --codex or --claude.");
84
+ process.exit(1);
85
+ }
86
+ const [agent] = agents;
87
+ try {
88
+ const plan = planSkill(await scanProject(root, { mode: "build" }));
89
+ const skillDir = join2(packageRoot(), WRITE_SKILL_DIR);
90
+ process.stderr.write(` ${plan.exists ? "Updating" : "Writing"} the "${plan.name}" skill at ${plan.file}.
91
+ `);
92
+ if (!agent) {
93
+ process.stderr.write(` blume skill writes it with a coding agent: rerun with --codex or --claude.
94
+ Using another agent? Point it at ${join2(skillDir, "SKILL.md")},
95
+ or install the skill where your agent looks for skills: npx skills add haydenbleasel/blume --skill blume-write-skill
96
+ `);
97
+ return;
98
+ }
99
+ const cli = AGENTS[agent];
100
+ process.stderr.write(` Handing it to ${cli.name}…
101
+
102
+ `);
103
+ const code = await launchInstalledAgent(cli.bin, writeSkillPrompt(plan, { skillDir, version: getBlumeVersion() }));
104
+ if (code === null) {
105
+ logger.error(`${cli.name} (\`${cli.bin}\`) was not found on PATH. Install it with \`${cli.install}\`.`);
106
+ process.exit(1);
107
+ }
108
+ if (code !== 0) {
109
+ process.exit(code);
110
+ }
111
+ } catch (error) {
112
+ if (error instanceof BlumeError) {
113
+ reportDiagnostics([error.diagnostic], root);
114
+ process.exit(1);
115
+ }
116
+ reportInternalError(error);
117
+ process.exit(1);
118
+ }
119
+ }
120
+ });
121
+ export {
122
+ skillCommand
123
+ };
124
+
125
+ //# debugId=3CB1C251215B1BE964756E2164756E21
126
+ //# sourceMappingURL=chunk-tphac74f.js.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/cli/commands/skill.ts", "../src/ai/write-skill.ts"],
4
+ "sourcesContent": [
5
+ "import { defineCommand } from \"citty\";\nimport { join } from \"pathe\";\n\nimport {\n planSkill,\n WRITE_SKILL_DIR,\n writeSkillPrompt,\n} from \"../../ai/write-skill.ts\";\nimport { AGENTS, launchInstalledAgent } from \"../../audit/agent.ts\";\nimport type { AgentKind } from \"../../audit/agent.ts\";\nimport { BlumeError } from \"../../core/diagnostics.ts\";\nimport { packageRoot } from \"../../core/package-root.ts\";\nimport { scanProject } from \"../../core/project-graph.ts\";\nimport { getBlumeVersion } from \"../../core/version.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport { reportInternalError } from \"../internal-error.ts\";\nimport { logger, reportDiagnostics } from \"../log.ts\";\n\n/**\n * `blume skill` — write the docs site's agent skill with a coding agent. Every\n * build publishes a generated skill at `/skill.md` (a map of the docs); this\n * opens Claude Code or Codex on the `blume-write-skill` skill bundled in this\n * package to write the richer one, grounded in the docs, under the same name\n * so it takes the generated one's place. The judgment stays in the skill; the\n * command is the front door, like `blume migrate`. Status lines go straight to\n * stderr: consola drops info-level lines in test and CI environments.\n */\nexport const skillCommand = defineCommand({\n args: {\n claude: {\n description: \"Write the skill with Claude Code.\",\n type: \"boolean\",\n },\n codex: {\n description: \"Write the skill with Codex.\",\n type: \"boolean\",\n },\n },\n meta: commandMeta.skill,\n async run({ args }) {\n const root = process.cwd();\n // SAFETY: AGENTS is a closed record keyed by AgentKind, so its keys are\n // exactly the agent kinds.\n const agents = (Object.keys(AGENTS) as AgentKind[]).filter(\n (kind) => args[kind]\n );\n if (agents.length > 1) {\n logger.error(\"Pass at most one of --codex or --claude.\");\n process.exit(1);\n }\n const [agent] = agents;\n\n try {\n // A scan, not `prepareProject`: the agent reads the content tree and\n // the runtime isn't touched, so a running dev server is left alone.\n const plan = planSkill(await scanProject(root, { mode: \"build\" }));\n const skillDir = join(packageRoot(), WRITE_SKILL_DIR);\n process.stderr.write(\n ` ${plan.exists ? \"Updating\" : \"Writing\"} the \"${plan.name}\" skill at ${plan.file}.\\n`\n );\n\n // Without an agent flag the command is the pointer for any other agent:\n // the bundled skill's path, and the install line that puts the skill\n // where agents look for it.\n if (!agent) {\n process.stderr.write(\n ` blume skill writes it with a coding agent: rerun with --codex or --claude.\\n Using another agent? Point it at ${join(skillDir, \"SKILL.md\")},\\n or install the skill where your agent looks for skills: npx skills add haydenbleasel/blume --skill blume-write-skill\\n`\n );\n return;\n }\n\n const cli = AGENTS[agent];\n process.stderr.write(` Handing it to ${cli.name}…\\n\\n`);\n const code = await launchInstalledAgent(\n cli.bin,\n writeSkillPrompt(plan, { skillDir, version: getBlumeVersion() })\n );\n if (code === null) {\n logger.error(\n `${cli.name} (\\`${cli.bin}\\`) was not found on PATH. Install it with \\`${cli.install}\\`.`\n );\n process.exit(1);\n }\n if (code !== 0) {\n process.exit(code);\n }\n } catch (error) {\n if (error instanceof BlumeError) {\n reportDiagnostics([error.diagnostic], root);\n process.exit(1);\n }\n reportInternalError(error);\n process.exit(1);\n }\n },\n});\n",
6
+ "import { existsSync } from \"node:fs\";\n\nimport { join, relative, resolve } from \"pathe\";\n\nimport type { BlumeProject } from \"../core/project-graph.ts\";\nimport { siteSkillName } from \"./site-skill.ts\";\n\n/**\n * `blume skill`'s logic, kept out of the command module so it runs (and is\n * covered) in-process. Writing a product skill is judgment work — what the\n * product is, which tasks matter, where it bites — so it lives in the\n * `blume-write-skill` skill, shipped inside the package. This module only\n * works out where the skill goes and writes the prompt that points a coding\n * agent at the skill and the docs.\n */\n\n/** The skill's directory inside the published package. */\nexport const WRITE_SKILL_DIR = join(\"skills\", \"blume-write-skill\");\n\n/** Where `agents.skills` points when the config doesn't set it. */\nconst DEFAULT_SKILLS_DIR = \"skills\";\n\n/** Where the skill goes, and what the agent needs to know to write it. */\nexport interface SkillPlan {\n /** The `agents.skills` value to add, when the config has none. */\n configure?: string;\n /** The config file to add it to, relative to the project root. */\n configFile: string;\n /** The content root, relative to the project root. */\n contentRoot: string;\n /** Whether a skill is already there to update. */\n exists: boolean;\n /** Where to write the skill, relative to the project root. */\n file: string;\n /** The skill's name: the generated site skill's, so it replaces it. */\n name: string;\n /** The site's URL, for the skill's absolute links. */\n site?: string;\n title: string;\n}\n\n/** Plan the skill for a scanned project. */\nexport const planSkill = (project: BlumeProject): SkillPlan => {\n const { config, context } = project;\n const name = siteSkillName(project);\n const file = resolve(\n context.root,\n config.agents.skills ?? DEFAULT_SKILLS_DIR,\n name,\n \"SKILL.md\"\n );\n const plan: SkillPlan = {\n configFile: context.configFile\n ? relative(context.root, context.configFile)\n : \"blume.config.ts\",\n contentRoot: relative(context.root, context.contentRoot) || \".\",\n exists: existsSync(file),\n file: relative(context.root, file),\n name,\n site: config.deployment.options.site,\n title: config.title,\n };\n return config.agents.skills\n ? plan\n : { ...plan, configure: `./${DEFAULT_SKILLS_DIR}` };\n};\n\n/** The prompt that hands the plan to a coding agent. */\nexport const writeSkillPrompt = (\n plan: SkillPlan,\n options: { skillDir: string; version: string }\n): string => {\n const { skillDir, version } = options;\n const lines = [\n `Write the agent skill for the ${plan.title} docs, a Blume ${version} site.`,\n \"\",\n `Follow the blume-write-skill skill: read ${join(skillDir, \"SKILL.md\")} first and work through its workflow.`,\n \"\",\n plan.exists\n ? `A skill already exists at ${plan.file}. Update it against the current docs rather than starting over, and keep what's still true.`\n : `Write it to ${plan.file}.`,\n `Its frontmatter \\`name\\` must be \\`${plan.name}\\`: that's the name of the skill Blume generates for this site, and a skill with the same name replaces it.`,\n ];\n if (plan.configure) {\n lines.push(\n `Then set \\`agents.skills: \"${plan.configure}\"\\` in ${plan.configFile} so the build publishes it.`\n );\n }\n lines.push(\n \"\",\n `The docs source is in ${plan.contentRoot}.`,\n plan.site\n ? `The site is served at ${plan.site}, so link pages as ${plan.site.replace(/\\/$/u, \"\")}<route>.md.`\n : `The config has no \\`deployment.site\\`, and the skill's links must be absolute. Ask me for the site's URL, and set it as \\`deployment.site\\` in ${plan.configFile}.`\n );\n return lines.join(\"\\n\");\n};\n"
7
+ ],
8
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA,iBAAS;;;ACDT;AAEA;AAeO,IAAM,kBAAkB,KAAK,UAAU,mBAAmB;AAGjE,IAAM,qBAAqB;AAsBpB,IAAM,YAAY,CAAC,YAAqC;AAAA,EAC7D,QAAQ,QAAQ,YAAY;AAAA,EAC5B,MAAM,OAAO,cAAc,OAAO;AAAA,EAClC,MAAM,OAAO,QACX,QAAQ,MACR,OAAO,OAAO,UAAU,oBACxB,MACA,UACF;AAAA,EACA,MAAM,OAAkB;AAAA,IACtB,YAAY,QAAQ,aAChB,SA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 "names": []
11
+ }
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ asciiSlugify
4
+ } from "./chunk-ehweg4fr.js";
5
+
6
+ // src/ai/site-skill.ts
7
+ var NAME_MAX = 64;
8
+ var siteSkillName = (project) => {
9
+ const { site } = project.config.deployment.options;
10
+ const fromTitle = asciiSlugify(project.config.title);
11
+ const name = fromTitle || asciiSlugify(site ? new URL(site).hostname : "") || "docs";
12
+ return name.slice(0, NAME_MAX).replace(/-+$/u, "");
13
+ };
14
+
15
+ export { siteSkillName };
16
+
17
+ //# debugId=D5EE89A8D7931D3164756E2164756E21
18
+ //# sourceMappingURL=chunk-w1r4vase.js.map