blume 1.7.3 → 2.0.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 (690) hide show
  1. package/AGENTS.md +19 -0
  2. package/CHANGELOG.md +245 -0
  3. package/README.md +34 -21
  4. package/dist/cli/{chunk-vacwm2hv.js → chunk-27g6wdth.js} +2 -2
  5. package/dist/cli/{chunk-ps4m1xh4.js → chunk-2hn4b8z7.js} +513 -550
  6. package/dist/cli/chunk-2hn4b8z7.js.map +12 -0
  7. package/dist/cli/chunk-5shv93fd.js +39 -0
  8. package/dist/cli/chunk-5shv93fd.js.map +10 -0
  9. package/dist/cli/chunk-6crbhc3x.js +361 -0
  10. package/dist/cli/chunk-6crbhc3x.js.map +14 -0
  11. package/dist/cli/{chunk-8cjtbafj.js → chunk-6hsn950k.js} +109 -383
  12. package/dist/cli/chunk-6hsn950k.js.map +10 -0
  13. package/dist/cli/chunk-6vm74dry.js +148 -0
  14. package/dist/cli/chunk-6vm74dry.js.map +10 -0
  15. package/dist/cli/{chunk-yg63d42r.js → chunk-79jhk4py.js} +87 -58
  16. package/dist/cli/chunk-79jhk4py.js.map +35 -0
  17. package/dist/cli/chunk-82bbrxdn.js +51 -0
  18. package/dist/cli/chunk-82bbrxdn.js.map +10 -0
  19. package/dist/cli/chunk-abh8yjkn.js +31 -0
  20. package/dist/cli/chunk-abh8yjkn.js.map +10 -0
  21. package/dist/cli/chunk-ah61y8py.js +75 -0
  22. package/dist/cli/chunk-ah61y8py.js.map +11 -0
  23. package/dist/cli/{chunk-dwgcp5sm.js → chunk-ce574jw2.js} +1 -1
  24. package/dist/cli/chunk-ch6g3ar0.js +102 -0
  25. package/dist/cli/chunk-ch6g3ar0.js.map +10 -0
  26. package/dist/cli/chunk-dh8cwk36.js +279 -0
  27. package/dist/cli/chunk-dh8cwk36.js.map +10 -0
  28. package/dist/cli/{chunk-rqy0s5wh.js → chunk-epjnccmv.js} +17 -16
  29. package/dist/cli/{chunk-rqy0s5wh.js.map → chunk-epjnccmv.js.map} +3 -3
  30. package/dist/cli/chunk-f2z5v128.js +97 -0
  31. package/dist/cli/chunk-f2z5v128.js.map +10 -0
  32. package/dist/cli/{chunk-2z47ypj8.js → chunk-fa25z98p.js} +16 -3
  33. package/dist/cli/chunk-fa25z98p.js.map +11 -0
  34. package/dist/cli/{chunk-1jefwnfs.js → chunk-fs23ddbb.js} +1076 -2592
  35. package/dist/cli/chunk-fs23ddbb.js.map +35 -0
  36. package/dist/cli/{chunk-e7f42gdj.js → chunk-fxypxtvm.js} +2 -2
  37. package/dist/cli/{chunk-bvwwhd84.js → chunk-fz5wtpmh.js} +15 -15
  38. package/dist/cli/{chunk-bvwwhd84.js.map → chunk-fz5wtpmh.js.map} +1 -1
  39. package/dist/cli/chunk-hdpx1tax.js +91 -0
  40. package/dist/cli/chunk-hdpx1tax.js.map +10 -0
  41. package/dist/cli/{chunk-ct47dqpx.js → chunk-jts8mvcz.js} +67 -7
  42. package/dist/cli/{chunk-2mzebbbz.js.map → chunk-jts8mvcz.js.map} +6 -4
  43. package/dist/cli/{chunk-ahnw3kxw.js → chunk-jwyddg7y.js} +27 -22
  44. package/dist/cli/chunk-jwyddg7y.js.map +15 -0
  45. package/dist/cli/{chunk-cjtn640a.js → chunk-kdp5q7ke.js} +43 -20
  46. package/dist/cli/chunk-kdp5q7ke.js.map +10 -0
  47. package/dist/cli/{chunk-5g0w1e2c.js → chunk-kpf8rrjc.js} +28 -16
  48. package/dist/cli/{chunk-5g0w1e2c.js.map → chunk-kpf8rrjc.js.map} +4 -4
  49. package/dist/cli/chunk-m3vmjgmq.js +133 -0
  50. package/dist/cli/chunk-m3vmjgmq.js.map +10 -0
  51. package/dist/cli/{chunk-b27xqwn9.js → chunk-mb2919y2.js} +9 -5
  52. package/dist/cli/chunk-mb2919y2.js.map +10 -0
  53. package/dist/cli/{chunk-5qk08vmp.js → chunk-q5163e60.js} +133 -54
  54. package/dist/cli/chunk-q5163e60.js.map +11 -0
  55. package/dist/cli/chunk-qkqwkpte.js +12437 -0
  56. package/dist/cli/chunk-qkqwkpte.js.map +182 -0
  57. package/dist/cli/{chunk-4x36ddpw.js → chunk-qs4q5p4e.js} +81 -87
  58. package/dist/cli/chunk-qs4q5p4e.js.map +10 -0
  59. package/dist/cli/{chunk-0xjyb285.js → chunk-qwsrynx5.js} +15 -5
  60. package/dist/cli/{chunk-0xjyb285.js.map → chunk-qwsrynx5.js.map} +4 -4
  61. package/dist/cli/chunk-s1p84fyh.js +261 -0
  62. package/dist/cli/chunk-s1p84fyh.js.map +10 -0
  63. package/dist/cli/chunk-s6jhgk0q.js +176 -0
  64. package/dist/cli/chunk-s6jhgk0q.js.map +11 -0
  65. package/dist/cli/chunk-vtk4a6dg.js +374 -0
  66. package/dist/cli/chunk-vtk4a6dg.js.map +10 -0
  67. package/dist/cli/{chunk-k79xp7av.js → chunk-wgm7m9qk.js} +230 -700
  68. package/dist/cli/chunk-wgm7m9qk.js.map +36 -0
  69. package/dist/cli/chunk-wm7js3j9.js +145 -0
  70. package/dist/cli/chunk-wm7js3j9.js.map +11 -0
  71. package/dist/cli/chunk-yt5n7ppj.js +79 -0
  72. package/dist/cli/chunk-yt5n7ppj.js.map +10 -0
  73. package/dist/cli/{chunk-3r45185y.js → chunk-yw7dm696.js} +9 -11
  74. package/dist/cli/{chunk-3r45185y.js.map → chunk-yw7dm696.js.map} +3 -3
  75. package/dist/cli/{chunk-nn13znc2.js → chunk-zxcczpyx.js} +1 -1
  76. package/dist/cli/chunk-zxh4d9vy.js +122 -0
  77. package/dist/cli/chunk-zxh4d9vy.js.map +11 -0
  78. package/dist/cli/index.js +214 -57
  79. package/dist/cli/index.js.map +8 -7
  80. package/dist/types/ai/agent-readability.d.ts +52 -0
  81. package/dist/types/ai/ai-catalog.d.ts +42 -0
  82. package/dist/types/ai/api/paths.d.ts +17 -0
  83. package/dist/types/ai/api-catalog.d.ts +18 -0
  84. package/dist/types/ai/ask-context.d.ts +7 -7
  85. package/dist/types/ai/ask.d.ts +368 -0
  86. package/dist/types/ai/changelog-markdown.d.ts +2 -0
  87. package/dist/types/ai/component-markdown.d.ts +2 -2
  88. package/dist/types/ai/index.d.ts +24 -0
  89. package/dist/types/ai/link-headers.d.ts +24 -0
  90. package/dist/types/ai/llms.d.ts +25 -0
  91. package/dist/types/ai/markdown.d.ts +45 -0
  92. package/dist/types/ai/mcp/discovery.d.ts +68 -0
  93. package/dist/types/ai/mcp/tools.d.ts +16 -0
  94. package/dist/types/ai/openapi-components.d.ts +43 -0
  95. package/dist/types/ai/relative-links.d.ts +26 -0
  96. package/dist/types/ai/serializers.d.ts +15 -0
  97. package/dist/types/ai/skills.d.ts +42 -0
  98. package/dist/types/ai/tar.d.ts +25 -0
  99. package/dist/types/ai/visibility.d.ts +17 -0
  100. package/dist/types/ai/web-bot-auth.d.ts +16 -0
  101. package/dist/types/analytics/adobe.d.ts +35 -0
  102. package/dist/types/analytics/amplitude.d.ts +50 -0
  103. package/dist/types/analytics/clarity.d.ts +31 -0
  104. package/dist/types/analytics/clearbit.d.ts +29 -0
  105. package/dist/types/analytics/cloudflare.d.ts +41 -0
  106. package/dist/types/analytics/fathom.d.ts +41 -0
  107. package/dist/types/analytics/google-analytics.d.ts +44 -0
  108. package/dist/types/analytics/google-tag-manager.d.ts +40 -0
  109. package/dist/types/analytics/head.d.ts +30 -0
  110. package/dist/types/analytics/heap.d.ts +40 -0
  111. package/dist/types/analytics/hightouch.d.ts +44 -0
  112. package/dist/types/analytics/hotjar.d.ts +33 -0
  113. package/dist/types/analytics/index.d.ts +61 -0
  114. package/dist/types/analytics/inline.d.ts +17 -0
  115. package/dist/types/analytics/logrocket.d.ts +44 -0
  116. package/dist/types/analytics/mixpanel.d.ts +67 -0
  117. package/dist/types/analytics/pirsch.d.ts +42 -0
  118. package/dist/types/analytics/plausible.d.ts +56 -0
  119. package/dist/types/analytics/posthog.d.ts +45 -0
  120. package/dist/types/analytics/schema.d.ts +320 -0
  121. package/dist/types/analytics/script.d.ts +46 -0
  122. package/dist/types/analytics/segment.d.ts +50 -0
  123. package/dist/types/analytics/vercel.d.ts +48 -0
  124. package/dist/types/astro/integration.d.ts +76 -0
  125. package/dist/types/astro/markdown-negotiation.d.ts +23 -0
  126. package/dist/types/astro/module-types.d.ts +14 -0
  127. package/dist/types/astro/pages.d.ts +44 -0
  128. package/dist/types/cli/env.d.ts +12 -0
  129. package/dist/types/cli/init/scaffold.d.ts +154 -0
  130. package/dist/types/components/layout/nav-utils.d.ts +11 -0
  131. package/dist/types/core/adapter.d.ts +47 -0
  132. package/dist/types/core/api-name.d.ts +7 -0
  133. package/dist/types/core/changelog-index.d.ts +13 -0
  134. package/dist/types/core/config-input.d.ts +197 -526
  135. package/dist/types/core/config.d.ts +61 -35
  136. package/dist/types/core/content-assets.d.ts +76 -0
  137. package/dist/types/core/custom-pages.d.ts +33 -0
  138. package/dist/types/core/data.d.ts +30 -15
  139. package/dist/types/core/define-components.d.ts +12 -9
  140. package/dist/types/core/deployment-env.d.ts +6 -11
  141. package/dist/types/core/frontmatter.d.ts +10 -0
  142. package/dist/types/core/graph.d.ts +18 -0
  143. package/dist/types/core/heading-markers.d.ts +54 -0
  144. package/dist/types/core/i18n-ui.d.ts +12 -10
  145. package/dist/types/core/i18n.d.ts +87 -0
  146. package/dist/types/core/includes.d.ts +138 -0
  147. package/dist/types/core/last-modified.d.ts +47 -0
  148. package/dist/types/core/links.d.ts +95 -0
  149. package/dist/types/core/locale-links.d.ts +60 -0
  150. package/dist/types/core/manifest.d.ts +17 -0
  151. package/dist/types/core/meta.d.ts +38 -0
  152. package/dist/types/core/nav-diagnostics.d.ts +26 -0
  153. package/dist/types/core/navigation.d.ts +6 -0
  154. package/dist/types/core/node-require.d.ts +19 -0
  155. package/dist/types/core/package-json.d.ts +13 -0
  156. package/dist/types/core/probe.d.ts +42 -0
  157. package/dist/types/core/project-graph.d.ts +51 -0
  158. package/dist/types/core/project.d.ts +2 -0
  159. package/dist/types/core/safe-href.d.ts +2 -0
  160. package/dist/types/core/safe-links.d.ts +26 -0
  161. package/dist/types/core/schema.d.ts +2284 -454
  162. package/dist/types/core/site-url.d.ts +16 -0
  163. package/dist/types/core/sources/assets.d.ts +36 -0
  164. package/dist/types/core/sources/cache.d.ts +37 -0
  165. package/dist/types/core/sources/collection.d.ts +28 -0
  166. package/dist/types/core/sources/contentful-rich-text.d.ts +31 -0
  167. package/dist/types/core/sources/contentful.d.ts +40 -0
  168. package/dist/types/core/sources/filesystem.d.ts +24 -0
  169. package/dist/types/core/sources/github-releases.d.ts +31 -0
  170. package/dist/types/core/sources/json.d.ts +30 -0
  171. package/dist/types/core/sources/lexical.d.ts +19 -0
  172. package/dist/types/core/sources/lower.d.ts +75 -0
  173. package/dist/types/core/sources/mdx-remote.d.ts +28 -0
  174. package/dist/types/core/sources/normalize.d.ts +147 -0
  175. package/dist/types/core/sources/notion.d.ts +131 -0
  176. package/dist/types/core/sources/obsidian.d.ts +46 -0
  177. package/dist/types/core/sources/payload.d.ts +39 -0
  178. package/dist/types/core/sources/portable-text.d.ts +42 -0
  179. package/dist/types/core/sources/read.d.ts +23 -0
  180. package/dist/types/core/sources/remote.d.ts +74 -0
  181. package/dist/types/core/sources/resolve.d.ts +19 -0
  182. package/dist/types/core/sources/sanity.d.ts +43 -0
  183. package/dist/types/core/sources/strapi-blocks.d.ts +12 -0
  184. package/dist/types/core/sources/strapi.d.ts +33 -0
  185. package/dist/types/core/sources/types.d.ts +7 -0
  186. package/dist/types/core/sources/watch.d.ts +45 -0
  187. package/dist/types/core/text-width.d.ts +11 -0
  188. package/dist/types/core/types.d.ts +15 -1
  189. package/dist/types/core/unrecognized-keys.d.ts +7 -0
  190. package/dist/types/core/versions.d.ts +72 -0
  191. package/dist/types/core/yaml.d.ts +9 -0
  192. package/dist/types/deploy/adapter-output.d.ts +45 -0
  193. package/dist/types/deploy/adapters/cloudflare.d.ts +40 -0
  194. package/dist/types/deploy/adapters/index.d.ts +29 -0
  195. package/dist/types/deploy/adapters/netlify.d.ts +37 -0
  196. package/dist/types/deploy/adapters/node.d.ts +37 -0
  197. package/dist/types/deploy/adapters/registry.d.ts +133 -0
  198. package/dist/types/deploy/adapters/types.d.ts +71 -0
  199. package/dist/types/deploy/adapters/vercel.d.ts +38 -0
  200. package/dist/types/deploy/artifacts.d.ts +65 -0
  201. package/dist/types/deploy/cloudflare-negotiation.d.ts +196 -0
  202. package/dist/types/deploy/function-bundle.d.ts +80 -0
  203. package/dist/types/deploy/headers.d.ts +50 -0
  204. package/dist/types/deploy/node-headers.d.ts +42 -0
  205. package/dist/types/deploy/platforms/cloudflare.d.ts +40 -0
  206. package/dist/types/deploy/platforms/index.d.ts +18 -0
  207. package/dist/types/deploy/platforms/netlify.d.ts +13 -0
  208. package/dist/types/deploy/platforms/node.d.ts +11 -0
  209. package/dist/types/deploy/platforms/paths.d.ts +27 -0
  210. package/dist/types/deploy/platforms/static.d.ts +10 -0
  211. package/dist/types/deploy/platforms/types.d.ts +104 -0
  212. package/dist/types/deploy/platforms/vercel.d.ts +32 -0
  213. package/dist/types/deploy/redirects.d.ts +53 -0
  214. package/dist/types/deploy/robots.d.ts +8 -0
  215. package/dist/types/deploy/rss.d.ts +31 -0
  216. package/dist/types/deploy/sitemap.d.ts +21 -0
  217. package/dist/types/deploy/vercel-negotiation.d.ts +109 -0
  218. package/dist/types/markdown/code-title.d.ts +32 -0
  219. package/dist/types/markdown/fence-meta.d.ts +23 -0
  220. package/dist/types/markdown/themes.d.ts +3 -3
  221. package/dist/types/openapi/asyncapi.d.ts +129 -0
  222. package/dist/types/openapi/graphql-build.d.ts +8 -0
  223. package/dist/types/openapi/graphql.d.ts +122 -0
  224. package/dist/types/openapi/model.d.ts +158 -0
  225. package/dist/types/openapi/parse.d.ts +57 -0
  226. package/dist/types/openapi/references.d.ts +37 -25
  227. package/dist/types/openapi/render-mdx.d.ts +33 -0
  228. package/dist/types/openapi/sentence.d.ts +7 -0
  229. package/dist/types/openapi/signature.d.ts +10 -0
  230. package/dist/types/openapi/source.d.ts +22 -0
  231. package/dist/types/openapi/spec-dependency-error.d.ts +10 -0
  232. package/dist/types/reference/asyncapi.d.ts +166 -0
  233. package/dist/types/reference/graphql.d.ts +181 -0
  234. package/dist/types/reference/index.d.ts +32 -0
  235. package/dist/types/reference/openapi.d.ts +165 -0
  236. package/dist/types/reference/options.d.ts +157 -0
  237. package/dist/types/reference/scalar.d.ts +136 -0
  238. package/dist/types/reference/schema.d.ts +630 -0
  239. package/dist/types/search/adapters/algolia.d.ts +32 -0
  240. package/dist/types/search/adapters/flexsearch.d.ts +12 -0
  241. package/dist/types/search/adapters/index.d.ts +31 -0
  242. package/dist/types/search/adapters/mixedbread.d.ts +22 -0
  243. package/dist/types/search/adapters/orama-cloud.d.ts +33 -0
  244. package/dist/types/search/adapters/orama.d.ts +13 -0
  245. package/dist/types/search/adapters/pagefind.d.ts +12 -0
  246. package/dist/types/search/adapters/registry.d.ts +228 -0
  247. package/dist/types/search/adapters/types.d.ts +34 -0
  248. package/dist/types/search/adapters/typesense.d.ts +42 -0
  249. package/dist/types/search/build.d.ts +23 -0
  250. package/dist/types/search/documents.d.ts +90 -0
  251. package/dist/types/search/facets.d.ts +3 -0
  252. package/dist/types/search/orama-index.d.ts +1 -1
  253. package/dist/types/search/sync/algolia.d.ts +14 -0
  254. package/dist/types/search/sync/index.d.ts +14 -0
  255. package/dist/types/search/sync/orama-cloud.d.ts +10 -0
  256. package/dist/types/search/sync/typesense.d.ts +14 -0
  257. package/dist/types/sources/contentful.d.ts +68 -0
  258. package/dist/types/sources/custom.d.ts +20 -0
  259. package/dist/types/sources/filesystem.d.ts +42 -0
  260. package/dist/types/sources/github-releases.d.ts +46 -0
  261. package/dist/types/sources/index.d.ts +48 -0
  262. package/dist/types/sources/mdx-remote.d.ts +63 -0
  263. package/dist/types/sources/notion.d.ts +65 -0
  264. package/dist/types/sources/obsidian.d.ts +34 -0
  265. package/dist/types/sources/payload.d.ts +68 -0
  266. package/dist/types/sources/registry.d.ts +1414 -0
  267. package/dist/types/sources/sanity.d.ts +69 -0
  268. package/dist/types/sources/shared.d.ts +46 -0
  269. package/dist/types/sources/strapi.d.ts +66 -0
  270. package/dist/types/theme/icon-kind.d.ts +11 -0
  271. package/dist/types/theme/icons.d.ts +20 -0
  272. package/docs/01-quickstart.mdx +18 -18
  273. package/docs/02-deployment.mdx +52 -28
  274. package/docs/03-upgrading.mdx +364 -0
  275. package/docs/04-migrating.mdx +58 -0
  276. package/docs/08-faq.mdx +5 -5
  277. package/docs/advanced/blog.mdx +13 -6
  278. package/docs/advanced/changelog.mdx +23 -35
  279. package/docs/advanced/custom-pages.mdx +22 -10
  280. package/docs/advanced/meta.ts +1 -8
  281. package/docs/advanced/skills.mdx +8 -0
  282. package/docs/cli/audit.mdx +646 -0
  283. package/docs/cli/doctor.mdx +29 -0
  284. package/docs/{reference/eval.mdx → cli/evals.mdx} +12 -11
  285. package/docs/cli/index.mdx +105 -0
  286. package/docs/cli/meta.ts +7 -0
  287. package/docs/{reference → cli}/translate.mdx +9 -9
  288. package/docs/cli/validate.mdx +41 -0
  289. package/docs/cli/version.mdx +40 -0
  290. package/docs/configuration/analytics.mdx +350 -59
  291. package/docs/configuration/assistant.mdx +357 -0
  292. package/docs/configuration/customization.mdx +16 -10
  293. package/docs/configuration/index.mdx +50 -31
  294. package/docs/configuration/meta.ts +1 -1
  295. package/docs/configuration/search.mdx +76 -55
  296. package/docs/configuration/theming.mdx +24 -15
  297. package/docs/content/components.mdx +21 -5
  298. package/docs/{reference → content}/frontmatter.mdx +35 -1
  299. package/docs/content/i18n.mdx +9 -7
  300. package/docs/content/includes.mdx +2 -4
  301. package/docs/content/index.mdx +1 -1
  302. package/docs/content/islands.mdx +11 -6
  303. package/docs/content/meta.mdx +1 -1
  304. package/docs/content/meta.ts +1 -0
  305. package/docs/content/navigation.mdx +9 -7
  306. package/docs/content/sources.mdx +145 -50
  307. package/docs/content/syntax.mdx +16 -12
  308. package/docs/content/versioning.mdx +3 -3
  309. package/docs/discoverability/agent-discovery.mdx +12 -12
  310. package/docs/discoverability/index.mdx +4 -4
  311. package/docs/discoverability/json-api.mdx +4 -4
  312. package/docs/discoverability/llms-txt.mdx +6 -6
  313. package/docs/discoverability/markdown.mdx +4 -4
  314. package/docs/discoverability/mcp.mdx +11 -11
  315. package/docs/discoverability/sitemap-and-robots.mdx +3 -3
  316. package/docs/index.mdx +4 -4
  317. package/docs/references/asyncapi.mdx +59 -0
  318. package/docs/{advanced → references}/graphql.mdx +45 -32
  319. package/docs/{reference → references}/meta.ts +2 -2
  320. package/docs/references/openapi.mdx +171 -0
  321. package/docs/references/scalar.mdx +64 -0
  322. package/package.json +42 -8
  323. package/skills/blume/SKILL.md +23 -10
  324. package/skills/blume-migrate/SKILL.md +22 -21
  325. package/skills/blume-migrate/assets/oxfmt@0.67.0.patch +49 -0
  326. package/skills/blume-migrate/references/docusaurus.md +5 -4
  327. package/skills/blume-migrate/references/fumadocs.md +4 -4
  328. package/skills/blume-migrate/references/mintlify.md +23 -8
  329. package/skills/blume-migrate/references/monorepo.md +6 -6
  330. package/skills/blume-migrate/references/starlight.md +4 -4
  331. package/src/ai/agent-readability.ts +25 -26
  332. package/src/ai/ai-catalog.ts +50 -32
  333. package/src/ai/api/handlers.ts +46 -11
  334. package/src/ai/api/paths.ts +1 -1
  335. package/src/ai/api-catalog.ts +8 -8
  336. package/src/ai/ask-context.ts +7 -7
  337. package/src/ai/ask-data.ts +3 -3
  338. package/src/ai/ask.ts +637 -100
  339. package/src/ai/changelog-markdown.ts +91 -0
  340. package/src/ai/component-markdown.ts +328 -12
  341. package/src/ai/cors.ts +3 -3
  342. package/src/ai/index.ts +45 -0
  343. package/src/ai/link-headers.ts +7 -6
  344. package/src/ai/llms.ts +20 -15
  345. package/src/ai/markdown.ts +35 -5
  346. package/src/ai/mcp/data.ts +9 -5
  347. package/src/ai/openapi-components.ts +5 -2
  348. package/src/ai/relative-links.ts +170 -0
  349. package/src/ai/serializers.ts +3 -3
  350. package/src/ai/skills.ts +1 -1
  351. package/src/ai/visibility.ts +1 -1
  352. package/src/ai/web-bot-auth.ts +2 -2
  353. package/src/analytics/adobe.ts +46 -0
  354. package/src/analytics/amplitude.ts +79 -0
  355. package/src/analytics/clarity.ts +46 -0
  356. package/src/analytics/clearbit.ts +47 -0
  357. package/src/analytics/cloudflare.ts +67 -0
  358. package/src/analytics/fathom.ts +64 -0
  359. package/src/analytics/google-analytics.ts +84 -0
  360. package/src/analytics/google-tag-manager.ts +61 -0
  361. package/src/analytics/head.ts +130 -0
  362. package/src/analytics/heap.ts +65 -0
  363. package/src/analytics/hightouch.ts +77 -0
  364. package/src/analytics/hotjar.ts +47 -0
  365. package/src/analytics/index.ts +71 -0
  366. package/src/analytics/inline.ts +21 -0
  367. package/src/analytics/logrocket.ts +71 -0
  368. package/src/analytics/mixpanel.ts +92 -0
  369. package/src/analytics/pirsch.ts +66 -0
  370. package/src/analytics/plausible.ts +83 -0
  371. package/src/analytics/posthog.ts +78 -0
  372. package/src/analytics/schema.ts +60 -0
  373. package/src/analytics/script.ts +60 -0
  374. package/src/analytics/segment.ts +85 -0
  375. package/src/analytics/vercel.ts +50 -0
  376. package/src/astro/adapter-root.ts +7 -9
  377. package/src/astro/component-slots.ts +131 -91
  378. package/src/astro/generate.ts +129 -361
  379. package/src/astro/integration.ts +2 -6
  380. package/src/astro/module-types.ts +1 -1
  381. package/src/astro/pages.ts +13 -101
  382. package/src/astro/render-deps.ts +379 -0
  383. package/src/astro/runtime-deps.ts +201 -0
  384. package/src/astro/templates.ts +575 -562
  385. package/src/audit/agent.ts +24 -0
  386. package/src/audit/catalog.ts +2 -2
  387. package/src/audit/checks/assets.ts +2 -2
  388. package/src/audit/checks/dns-aid.ts +1 -1
  389. package/src/audit/checks/duplicates.ts +3 -1
  390. package/src/audit/checks/i18n.ts +1 -1
  391. package/src/audit/checks/indexability.ts +7 -7
  392. package/src/audit/checks/links.ts +2 -2
  393. package/src/audit/checks/llms.ts +6 -6
  394. package/src/audit/checks/network.ts +3 -3
  395. package/src/audit/checks/og-image.ts +2 -2
  396. package/src/audit/checks/robots.ts +1 -1
  397. package/src/audit/checks/sitemap.ts +2 -2
  398. package/src/audit/checks/social.ts +1 -1
  399. package/src/audit/run.ts +4 -3
  400. package/src/audit/terms.ts +31 -0
  401. package/src/audit/url.ts +13 -13
  402. package/src/blume-modules.d.ts +2 -2
  403. package/src/cli/command-meta.ts +10 -0
  404. package/src/cli/commands/audit.ts +40 -21
  405. package/src/cli/commands/build.ts +71 -316
  406. package/src/cli/commands/check.ts +1 -0
  407. package/src/cli/commands/dev.ts +40 -1
  408. package/src/cli/commands/doctor.ts +92 -14
  409. package/src/cli/commands/eject.ts +44 -7
  410. package/src/cli/commands/eval.ts +5 -5
  411. package/src/cli/commands/init.ts +161 -41
  412. package/src/cli/commands/migrate.ts +121 -0
  413. package/src/cli/commands/preview.ts +7 -1
  414. package/src/cli/commands/translate.ts +5 -5
  415. package/src/cli/commands/upgrade.ts +141 -0
  416. package/src/cli/commands/version.ts +57 -44
  417. package/src/cli/eject-scripts.ts +121 -6
  418. package/src/cli/index.ts +11 -1
  419. package/src/cli/init/install.ts +70 -0
  420. package/src/cli/init/questions.ts +7 -0
  421. package/src/cli/init/scaffold.ts +459 -75
  422. package/src/cli/lazy-command.ts +37 -1
  423. package/src/cli/prepare.ts +40 -6
  424. package/src/cli/required-secrets.ts +39 -12
  425. package/src/cli/unknown-flags.ts +266 -0
  426. package/src/cli/yarn-pnp.ts +52 -0
  427. package/src/components/content/AccordionItem.astro +7 -1
  428. package/src/components/content/Card.astro +4 -3
  429. package/src/components/content/ColorItem.astro +22 -4
  430. package/src/components/content/GithubInfo.astro +2 -2
  431. package/src/components/content/Prompt.astro +25 -25
  432. package/src/components/content/Tabs.astro +3 -1
  433. package/src/components/content/Tile.astro +2 -3
  434. package/src/components/content/Tooltip.astro +57 -9
  435. package/src/components/content/content-strings.ts +34 -0
  436. package/src/components/content/diff.ts +1 -1
  437. package/src/components/content/mermaid-element.ts +13 -2
  438. package/src/components/content/prompt-markdown.ts +292 -0
  439. package/src/components/content/tooltip-id.ts +41 -0
  440. package/src/components/copy-feedback.ts +1 -1
  441. package/src/components/islands/{AskAI.astro → Assistant.astro} +10 -10
  442. package/src/components/islands/{ask-ai.tsx → assistant.tsx} +23 -23
  443. package/src/components/islands/hooks.ts +36 -11
  444. package/src/components/layout/Analytics.astro +21 -79
  445. package/src/components/layout/Banner.astro +3 -1
  446. package/src/components/layout/DiscoveryLinks.astro +69 -0
  447. package/src/components/layout/Header.astro +93 -30
  448. package/src/components/layout/LanguageSwitcher.astro +4 -1
  449. package/src/components/layout/Logo.astro +23 -2
  450. package/src/components/layout/NavSelector.astro +13 -2
  451. package/src/components/layout/NavTree.astro +12 -3
  452. package/src/components/layout/NavTreeScript.astro +17 -3
  453. package/src/components/layout/PageActions.astro +3 -3
  454. package/src/components/layout/PageFeedback.astro +11 -1
  455. package/src/components/layout/PageLayout.astro +58 -11
  456. package/src/components/layout/Pagination.astro +7 -7
  457. package/src/components/layout/ReferenceLayout.astro +22 -13
  458. package/src/components/layout/RootLayout.astro +75 -72
  459. package/src/components/layout/Search.astro +43 -19
  460. package/src/components/layout/WebMcp.astro +1 -1
  461. package/src/components/layout/analytics-client.ts +73 -16
  462. package/src/components/layout/drawer-inert.ts +113 -15
  463. package/src/components/layout/dropdown-clamp.ts +105 -0
  464. package/src/components/layout/head-scripts.ts +15 -6
  465. package/src/components/layout/nav-utils.ts +17 -0
  466. package/src/components/layout/search/algolia.ts +8 -8
  467. package/src/components/layout/search/orama-cloud.ts +9 -7
  468. package/src/components/layout/search/typesense.ts +11 -17
  469. package/src/components/openapi/MessageComposer.astro +2 -2
  470. package/src/components/openapi/Playground.astro +2 -2
  471. package/src/components/openapi/description.ts +2 -2
  472. package/src/components/openapi/playground-client.ts +79 -10
  473. package/src/core/changelog-index.ts +24 -0
  474. package/src/core/code-fences.ts +1 -1
  475. package/src/core/component-overrides.ts +399 -154
  476. package/src/core/config-input.ts +201 -566
  477. package/src/core/config.ts +131 -42
  478. package/src/core/custom-pages.ts +105 -0
  479. package/src/core/data.ts +34 -15
  480. package/src/core/define-components.ts +12 -9
  481. package/src/core/deployment-env.ts +18 -74
  482. package/src/core/diagnostics.ts +14 -7
  483. package/src/core/graph.ts +69 -25
  484. package/src/core/i18n-ui.ts +41 -11
  485. package/src/core/i18n.ts +17 -0
  486. package/src/core/includes.ts +156 -38
  487. package/src/core/last-modified.ts +6 -11
  488. package/src/core/links.ts +166 -2
  489. package/src/core/manifest.ts +10 -3
  490. package/src/core/navigation.ts +115 -16
  491. package/src/core/new-tab.ts +35 -0
  492. package/src/core/node-require.ts +21 -0
  493. package/src/core/project-graph.ts +42 -26
  494. package/src/core/project.ts +9 -4
  495. package/src/core/request-body.ts +61 -0
  496. package/src/core/safe-href.ts +28 -0
  497. package/src/core/safe-links.ts +68 -0
  498. package/src/core/schema.ts +528 -745
  499. package/src/core/server-features.ts +10 -11
  500. package/src/core/sources/assets.ts +47 -11
  501. package/src/core/sources/collection.ts +67 -0
  502. package/src/core/sources/contentful-rich-text.ts +285 -0
  503. package/src/core/sources/contentful.ts +173 -0
  504. package/src/core/sources/github-releases.ts +51 -1
  505. package/src/core/sources/json.ts +71 -0
  506. package/src/core/sources/lexical.ts +195 -0
  507. package/src/core/sources/lower.ts +226 -0
  508. package/src/core/sources/normalize.ts +52 -2
  509. package/src/core/sources/notion.ts +39 -28
  510. package/src/core/sources/payload.ts +135 -0
  511. package/src/core/sources/portable-text.ts +11 -16
  512. package/src/core/sources/remote.ts +226 -0
  513. package/src/core/sources/resolve.ts +104 -166
  514. package/src/core/sources/sanity.ts +16 -49
  515. package/src/core/sources/strapi-blocks.ts +124 -0
  516. package/src/core/sources/strapi.ts +191 -0
  517. package/src/core/sources/types.ts +12 -1
  518. package/src/core/types.ts +15 -1
  519. package/src/core/ui-packs/ar.ts +10 -7
  520. package/src/core/ui-packs/bg.ts +10 -7
  521. package/src/core/ui-packs/bn.ts +10 -7
  522. package/src/core/ui-packs/ca.ts +7 -6
  523. package/src/core/ui-packs/cs.ts +10 -7
  524. package/src/core/ui-packs/da.ts +10 -7
  525. package/src/core/ui-packs/de.ts +10 -7
  526. package/src/core/ui-packs/el.ts +7 -6
  527. package/src/core/ui-packs/es.ts +7 -6
  528. package/src/core/ui-packs/fa.ts +10 -7
  529. package/src/core/ui-packs/fi.ts +10 -7
  530. package/src/core/ui-packs/fr.ts +7 -6
  531. package/src/core/ui-packs/he.ts +10 -7
  532. package/src/core/ui-packs/hi.ts +10 -7
  533. package/src/core/ui-packs/hr.ts +10 -7
  534. package/src/core/ui-packs/hu.ts +10 -7
  535. package/src/core/ui-packs/id.ts +10 -7
  536. package/src/core/ui-packs/it.ts +7 -6
  537. package/src/core/ui-packs/ja.ts +7 -6
  538. package/src/core/ui-packs/ko.ts +7 -6
  539. package/src/core/ui-packs/nl.ts +10 -7
  540. package/src/core/ui-packs/no.ts +10 -7
  541. package/src/core/ui-packs/pl.ts +10 -7
  542. package/src/core/ui-packs/pt-br.ts +7 -6
  543. package/src/core/ui-packs/pt.ts +7 -6
  544. package/src/core/ui-packs/ro.ts +10 -7
  545. package/src/core/ui-packs/ru.ts +10 -7
  546. package/src/core/ui-packs/sk.ts +10 -7
  547. package/src/core/ui-packs/sr.ts +10 -7
  548. package/src/core/ui-packs/sv.ts +10 -7
  549. package/src/core/ui-packs/th.ts +7 -6
  550. package/src/core/ui-packs/tr.ts +10 -7
  551. package/src/core/ui-packs/uk.ts +10 -7
  552. package/src/core/ui-packs/vi.ts +7 -6
  553. package/src/core/ui-packs/zh-tw.ts +7 -6
  554. package/src/core/ui-packs/zh.ts +7 -6
  555. package/src/core/unrecognized-keys.ts +10 -0
  556. package/src/core/version-cut.ts +116 -8
  557. package/src/deploy/adapter-output.ts +57 -97
  558. package/src/deploy/adapters/cloudflare.ts +39 -0
  559. package/src/deploy/adapters/index.ts +41 -0
  560. package/src/deploy/adapters/netlify.ts +34 -0
  561. package/src/deploy/adapters/node.ts +34 -0
  562. package/src/deploy/adapters/registry.ts +127 -0
  563. package/src/deploy/adapters/types.ts +92 -0
  564. package/src/deploy/adapters/vercel.ts +35 -0
  565. package/src/deploy/artifacts.ts +55 -27
  566. package/src/deploy/cloudflare-negotiation.ts +179 -100
  567. package/src/deploy/function-bundle.ts +18 -3
  568. package/src/deploy/headers.ts +124 -23
  569. package/src/deploy/node-headers.ts +198 -0
  570. package/src/deploy/platforms/cloudflare.ts +312 -0
  571. package/src/deploy/platforms/index.ts +67 -0
  572. package/src/deploy/platforms/netlify.ts +52 -0
  573. package/src/deploy/platforms/node.ts +40 -0
  574. package/src/deploy/platforms/paths.ts +42 -0
  575. package/src/deploy/platforms/static.ts +29 -0
  576. package/src/deploy/platforms/types.ts +112 -0
  577. package/src/deploy/platforms/vercel.ts +193 -0
  578. package/src/deploy/redirects.ts +30 -18
  579. package/src/deploy/robots.ts +3 -3
  580. package/src/deploy/rss.ts +2 -2
  581. package/src/deploy/sitemap.ts +2 -2
  582. package/src/deploy/vercel-negotiation.ts +2 -2
  583. package/src/eval/agents.ts +32 -1
  584. package/src/eval/findings.ts +19 -11
  585. package/src/eval/report.ts +10 -2
  586. package/src/markdown/external-links.ts +65 -0
  587. package/src/markdown/include.ts +45 -27
  588. package/src/markdown/index.ts +34 -9
  589. package/src/markdown/inline-code.ts +12 -6
  590. package/src/markdown/relative-links.ts +324 -0
  591. package/src/markdown/themes.ts +3 -3
  592. package/src/migrate/migrate.ts +149 -0
  593. package/src/openapi/parse.ts +64 -16
  594. package/src/openapi/proxy.ts +62 -10
  595. package/src/openapi/references.ts +147 -147
  596. package/src/openapi/render-mdx.ts +32 -10
  597. package/src/openapi/scalar.ts +15 -13
  598. package/src/openapi/sentence.ts +14 -0
  599. package/src/openapi/source.ts +37 -21
  600. package/src/openapi/spec-dependency-error.ts +15 -0
  601. package/src/reference/asyncapi.ts +83 -0
  602. package/src/reference/graphql.ts +89 -0
  603. package/src/reference/index.ts +40 -0
  604. package/src/reference/openapi.ts +83 -0
  605. package/src/reference/options.ts +201 -0
  606. package/src/reference/scalar.ts +136 -0
  607. package/src/reference/schema.ts +88 -0
  608. package/src/registry/eject.ts +109 -53
  609. package/src/search/adapters/algolia.ts +46 -0
  610. package/src/search/adapters/flexsearch.ts +29 -0
  611. package/src/search/adapters/index.ts +39 -0
  612. package/src/search/adapters/mixedbread.ts +39 -0
  613. package/src/search/adapters/orama-cloud.ts +51 -0
  614. package/src/search/adapters/orama.ts +24 -0
  615. package/src/search/adapters/pagefind.ts +27 -0
  616. package/src/search/adapters/registry.ts +131 -0
  617. package/src/search/adapters/types.ts +46 -0
  618. package/src/search/adapters/typesense.ts +57 -0
  619. package/src/search/build.ts +8 -4
  620. package/src/search/documents.ts +8 -2
  621. package/src/search/orama-index.ts +1 -1
  622. package/src/search/sync/algolia.ts +12 -11
  623. package/src/search/sync/index.ts +35 -20
  624. package/src/search/sync/orama-cloud.ts +12 -9
  625. package/src/search/sync/typesense.ts +15 -13
  626. package/src/sources/contentful.ts +63 -0
  627. package/src/sources/custom.ts +38 -0
  628. package/src/sources/filesystem.ts +51 -0
  629. package/src/sources/github-releases.ts +52 -0
  630. package/src/sources/index.ts +60 -0
  631. package/src/sources/mdx-remote.ts +76 -0
  632. package/src/sources/notion.ts +63 -0
  633. package/src/sources/obsidian.ts +38 -0
  634. package/src/sources/payload.ts +60 -0
  635. package/src/sources/registry.ts +182 -0
  636. package/src/sources/sanity.ts +66 -0
  637. package/src/sources/shared.ts +52 -0
  638. package/src/sources/strapi.ts +58 -0
  639. package/src/theme/entry.ts +24 -2
  640. package/src/translate/report.ts +40 -7
  641. package/src/upgrade/upgrade.ts +499 -0
  642. package/dist/cli/chunk-0qymqwzz.js +0 -164
  643. package/dist/cli/chunk-0qymqwzz.js.map +0 -15
  644. package/dist/cli/chunk-1jefwnfs.js.map +0 -48
  645. package/dist/cli/chunk-2mzebbbz.js +0 -69
  646. package/dist/cli/chunk-2z47ypj8.js.map +0 -11
  647. package/dist/cli/chunk-4x36ddpw.js.map +0 -11
  648. package/dist/cli/chunk-5093q3n7.js +0 -68
  649. package/dist/cli/chunk-5093q3n7.js.map +0 -10
  650. package/dist/cli/chunk-5qk08vmp.js.map +0 -11
  651. package/dist/cli/chunk-7s8hm3b6.js +0 -5347
  652. package/dist/cli/chunk-7s8hm3b6.js.map +0 -58
  653. package/dist/cli/chunk-8cjtbafj.js.map +0 -13
  654. package/dist/cli/chunk-97r59kpr.js +0 -381
  655. package/dist/cli/chunk-97r59kpr.js.map +0 -12
  656. package/dist/cli/chunk-ahnw3kxw.js.map +0 -15
  657. package/dist/cli/chunk-b27xqwn9.js.map +0 -10
  658. package/dist/cli/chunk-bf6bt1xt.js +0 -185
  659. package/dist/cli/chunk-bf6bt1xt.js.map +0 -11
  660. package/dist/cli/chunk-cjtn640a.js.map +0 -10
  661. package/dist/cli/chunk-ct47dqpx.js.map +0 -11
  662. package/dist/cli/chunk-esphfr8p.js +0 -107
  663. package/dist/cli/chunk-esphfr8p.js.map +0 -11
  664. package/dist/cli/chunk-ex56aa81.js +0 -1016
  665. package/dist/cli/chunk-ex56aa81.js.map +0 -13
  666. package/dist/cli/chunk-garjf5z9.js +0 -30
  667. package/dist/cli/chunk-garjf5z9.js.map +0 -10
  668. package/dist/cli/chunk-js7saxwm.js +0 -1045
  669. package/dist/cli/chunk-js7saxwm.js.map +0 -22
  670. package/dist/cli/chunk-k79xp7av.js.map +0 -39
  671. package/dist/cli/chunk-ps4m1xh4.js.map +0 -15
  672. package/dist/cli/chunk-q4rae3bg.js +0 -60
  673. package/dist/cli/chunk-q4rae3bg.js.map +0 -10
  674. package/dist/cli/chunk-rz9jmfhz.js +0 -108
  675. package/dist/cli/chunk-rz9jmfhz.js.map +0 -10
  676. package/dist/cli/chunk-vh9w1sgp.js +0 -73
  677. package/dist/cli/chunk-vh9w1sgp.js.map +0 -10
  678. package/dist/cli/chunk-vrfp10qk.js +0 -81
  679. package/dist/cli/chunk-vrfp10qk.js.map +0 -10
  680. package/dist/cli/chunk-yg63d42r.js.map +0 -34
  681. package/docs/advanced/api-reference.mdx +0 -240
  682. package/docs/configuration/ask-ai.mdx +0 -256
  683. package/docs/reference/cli.mdx +0 -197
  684. package/skills/blume-migrate/assets/oxfmt@0.55.0.patch +0 -20
  685. package/src/components/content/changelog-element.ts +0 -69
  686. package/src/search/providers.ts +0 -91
  687. /package/dist/cli/{chunk-vacwm2hv.js.map → chunk-27g6wdth.js.map} +0 -0
  688. /package/dist/cli/{chunk-dwgcp5sm.js.map → chunk-ce574jw2.js.map} +0 -0
  689. /package/dist/cli/{chunk-e7f42gdj.js.map → chunk-fxypxtvm.js.map} +0 -0
  690. /package/dist/cli/{chunk-nn13znc2.js.map → chunk-zxcczpyx.js.map} +0 -0
@@ -7,7 +7,7 @@ import {
7
7
  packageSrc,
8
8
  registry,
9
9
  findItem
10
- } from "./chunk-nn13znc2.js";
10
+ } from "./chunk-zxcczpyx.js";
11
11
 
12
12
  // src/cli/commands/add.ts
13
13
  import { existsSync } from "node:fs";
@@ -96,4 +96,4 @@ export {
96
96
  };
97
97
 
98
98
  //# debugId=B640E77C94BA0A0364756E2164756E21
99
- //# sourceMappingURL=chunk-e7f42gdj.js.map
99
+ //# sourceMappingURL=chunk-fxypxtvm.js.map
@@ -3,28 +3,28 @@ import {
3
3
  resolveRuntimeDir,
4
4
  resolveProjectContext,
5
5
  loadConfig
6
- } from "./chunk-7s8hm3b6.js";
6
+ } from "./chunk-qkqwkpte.js";
7
+ import"./chunk-jts8mvcz.js";
7
8
  import {
8
9
  commandMeta,
9
10
  logger
10
11
  } from "./index.js";
11
12
  import {
12
13
  readDevLock
13
- } from "./chunk-vacwm2hv.js";
14
- import"./chunk-ct47dqpx.js";
15
- import"./chunk-0qymqwzz.js";
16
- import"./chunk-1jefwnfs.js";
17
- import"./chunk-k79xp7av.js";
18
- import"./chunk-js7saxwm.js";
19
- import"./chunk-bf6bt1xt.js";
14
+ } from "./chunk-27g6wdth.js";
15
+ import"./chunk-wgm7m9qk.js";
16
+ import"./chunk-6crbhc3x.js";
17
+ import"./chunk-fs23ddbb.js";
18
+ import"./chunk-vtk4a6dg.js";
20
19
  import"./chunk-jq5n4avg.js";
21
- import"./chunk-ps4m1xh4.js";
22
- import"./chunk-nn13znc2.js";
23
- import"./chunk-vrfp10qk.js";
20
+ import"./chunk-2hn4b8z7.js";
21
+ import"./chunk-zxcczpyx.js";
22
+ import"./chunk-wm7js3j9.js";
23
+ import"./chunk-82bbrxdn.js";
24
24
  import {
25
25
  prepareProject
26
- } from "./chunk-esphfr8p.js";
27
- import"./chunk-garjf5z9.js";
26
+ } from "./chunk-zxh4d9vy.js";
27
+ import"./chunk-ah61y8py.js";
28
28
 
29
29
  // src/cli/commands/sync.ts
30
30
  import { rm } from "node:fs/promises";
@@ -68,5 +68,5 @@ export {
68
68
  syncCommand
69
69
  };
70
70
 
71
- //# debugId=7B94E31DD936C06C64756E2164756E21
72
- //# sourceMappingURL=chunk-bvwwhd84.js.map
71
+ //# debugId=A65A4348F141B1A664756E2164756E21
72
+ //# sourceMappingURL=chunk-fz5wtpmh.js.map
@@ -5,6 +5,6 @@
5
5
  "import { rm } from \"node:fs/promises\";\n\nimport { defineCommand } from \"citty\";\nimport { join } from \"pathe\";\n\nimport { loadConfig } from \"../../core/config.ts\";\nimport {\n resolveProjectContext,\n resolveRuntimeDir,\n} from \"../../core/project.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport { readDevLock } from \"../dev-lock.ts\";\nimport { logger } from \"../log.ts\";\nimport { prepareProject } from \"../prepare.ts\";\n\nexport const syncCommand = defineCommand({\n args: {\n force: {\n description: \"Clear the source cache before refetching.\",\n type: \"boolean\",\n },\n preview: {\n description: \"Include drafts and unpublished CMS content.\",\n type: \"boolean\",\n },\n strict: { description: \"Fail on diagnostics.\", type: \"boolean\" },\n },\n meta: commandMeta.sync,\n async run({ args }) {\n const root = process.cwd();\n\n // `--force` drops the snapshots so a stale or corrupt cache can't be served;\n // scoped to `.blume/cache`, so a running dev server's runtime is untouched.\n if (args.force) {\n const { config } = await loadConfig(root);\n const context = resolveProjectContext(root, config);\n await rm(join(context.outDir, \"cache\"), { force: true, recursive: true });\n logger.info(\"Cleared source cache.\");\n }\n\n // Dev mode keeps drafts and skips the static-build gate; `refresh` forces\n // remote sources to re-fetch rather than serve their cached snapshot. A\n // running dev server hot-reloads from the regenerated runtime — so when one\n // is live, regenerate with the same site fallback (its URL) it used, else\n // its astro.config loses `site` (dropping OG and canonicals) and Astro\n // restarts cold.\n const lock = readDevLock(resolveRuntimeDir(root));\n const devServerUrl = lock?.port\n ? `http://localhost:${lock.port}`\n : undefined;\n await prepareProject({\n devServerUrl,\n mode: \"dev\",\n preview: args.preview,\n refresh: true,\n root,\n strict: args.strict,\n });\n\n logger.success(\"Synced content sources.\");\n },\n});\n"
6
6
  ],
7
7
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AAYO,IAAM,cAAc,cAAc;AAAA,EACvC,MAAM;AAAA,IACJ,OAAO;AAAA,MACL,aAAa;AAAA,MACb,MAAM;AAAA,IACR;AAAA,IACA,SAAS;AAAA,MACP,aAAa;AAAA,MACb,MAAM;AAAA,IACR;AAAA,IACA,QAAQ,EAAE,aAAa,wBAAwB,MAAM,UAAU;AAAA,EACjE;AAAA,EACA,MAAM,YAAY;AAAA,OACZ,IAAG,GAAG,QAAQ;AAAA,IAClB,MAAM,OAAO,QAAQ,IAAI;AAAA,IAIzB,IAAI,KAAK,OAAO;AAAA,MACd,QAAQ,WAAW,MAAM,WAAW,IAAI;AAAA,MACxC,MAAM,UAAU,sBAAsB,MAAM,MAAM;AAAA,MAClD,MAAM,GAAG,KAAK,QAAQ,QAAQ,OAAO,GAAG,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAAA,MACxE,OAAO,KAAK,uBAAuB;AAAA,IACrC;AAAA,IAQA,MAAM,OAAO,YAAY,kBAAkB,IAAI,CAAC;AAAA,IAChD,MAAM,eAAe,MAAM,OACvB,oBAAoB,KAAK,SACzB;AAAA,IACJ,MAAM,eAAe;AAAA,MACnB;AAAA,MACA,MAAM;AAAA,MACN,SAAS,KAAK;AAAA,MACd,SAAS;AAAA,MACT;AAAA,MACA,QAAQ,KAAK;AAAA,IACf,CAAC;AAAA,IAED,OAAO,QAAQ,yBAAyB;AAAA;AAE5C,CAAC;",
8
- "debugId": "7B94E31DD936C06C64756E2164756E21",
8
+ "debugId": "A65A4348F141B1A664756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -0,0 +1,91 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ loadConfig
4
+ } from "./chunk-qkqwkpte.js";
5
+ import"./chunk-jts8mvcz.js";
6
+ import {
7
+ commandMeta,
8
+ reportInternalError,
9
+ BlumeError,
10
+ logger,
11
+ reportDiagnostics
12
+ } from "./index.js";
13
+ import"./chunk-jq5n4avg.js";
14
+ import"./chunk-fs23ddbb.js";
15
+ import {
16
+ CutError,
17
+ cutVersion
18
+ } from "./chunk-qs4q5p4e.js";
19
+
20
+ // src/cli/commands/version.ts
21
+ import { defineCommand } from "citty";
22
+ var listVersions = async (root) => {
23
+ const { config } = await loadConfig(root);
24
+ if (!config.versions) {
25
+ logger.info("Versioning is not configured. Cut the first version with `blume version <id>` (e.g. `blume version v1.0`).");
26
+ return;
27
+ }
28
+ const { current, archived } = config.versions;
29
+ process.stdout.write(` ${current.label} (current)${current.badge ? ` — ${current.badge}` : ""}
30
+ `);
31
+ for (const version of archived) {
32
+ process.stdout.write(` ${version.label ?? version.id} — ${version.id}/
33
+ `);
34
+ }
35
+ };
36
+ var reportCut = (id, result) => {
37
+ logger.success(`Snapshot ${result.dir} (${result.copied} file(s) copied)`);
38
+ const totalRewrites = result.rewritten.reduce((sum, entry) => sum + entry.count, 0);
39
+ if (totalRewrites > 0) {
40
+ logger.info(`Rewrote root-absolute links in ${result.rewritten.length} page(s) (${totalRewrites} line(s)).`);
41
+ }
42
+ if (result.versionsAdded) {
43
+ logger.success(`Turned on versioning in blume.config.ts with "${id}" archived; the live docs are labeled "Latest" in the switcher until you rename versions.current.label.`);
44
+ } else if (result.configUpdated) {
45
+ logger.success(`Added "${id}" to versions.archived in blume.config.ts`);
46
+ } else if (result.configSnippet) {
47
+ logger.warn(`blume.config.ts couldn't be updated automatically, so "${id}" isn't registered yet and its pages build as ordinary content until it is. ${result.configSnippet}`);
48
+ }
49
+ logger.info("Archived versions are frozen — future edits belong in the live tree. Restart `blume dev` to pick up the snapshot.");
50
+ };
51
+ var versionCommand = defineCommand({
52
+ args: {
53
+ force: {
54
+ description: "Overwrite an existing snapshot directory.",
55
+ type: "boolean"
56
+ },
57
+ id: {
58
+ description: 'Version id to cut (e.g. "v1.0").',
59
+ required: false,
60
+ type: "positional"
61
+ }
62
+ },
63
+ meta: commandMeta.version,
64
+ async run({ args }) {
65
+ const root = process.cwd();
66
+ try {
67
+ if (args.id) {
68
+ reportCut(args.id, await cutVersion(root, args.id, { force: args.force }));
69
+ } else {
70
+ await listVersions(root);
71
+ }
72
+ } catch (error) {
73
+ if (error instanceof CutError) {
74
+ logger.error(error.message);
75
+ process.exit(1);
76
+ }
77
+ if (error instanceof BlumeError) {
78
+ reportDiagnostics([error.diagnostic], root);
79
+ process.exit(1);
80
+ }
81
+ reportInternalError(error);
82
+ process.exit(1);
83
+ }
84
+ }
85
+ });
86
+ export {
87
+ versionCommand
88
+ };
89
+
90
+ //# debugId=86F69482E9E3E55264756E2164756E21
91
+ //# sourceMappingURL=chunk-hdpx1tax.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/cli/commands/version.ts"],
4
+ "sourcesContent": [
5
+ "import { defineCommand } from \"citty\";\n\nimport { loadConfig } from \"../../core/config.ts\";\nimport { BlumeError } from \"../../core/diagnostics.ts\";\nimport { CutError, cutVersion } from \"../../core/version-cut.ts\";\nimport type { CutResult } from \"../../core/version-cut.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport { reportInternalError } from \"../internal-error.ts\";\nimport { logger, reportDiagnostics } from \"../log.ts\";\n\n/** `blume version` with no id: list the configured versions. */\nconst listVersions = async (root: string): Promise<void> => {\n const { config } = await loadConfig(root);\n if (!config.versions) {\n logger.info(\n \"Versioning is not configured. Cut the first version with `blume version <id>` (e.g. `blume version v1.0`).\"\n );\n return;\n }\n const { current, archived } = config.versions;\n process.stdout.write(\n ` ${current.label} (current)${current.badge ? ` — ${current.badge}` : \"\"}\\n`\n );\n for (const version of archived) {\n process.stdout.write(` ${version.label ?? version.id} — ${version.id}/\\n`);\n }\n};\n\n/** Report what a cut did, including how its id reached the config (or didn't). */\nconst reportCut = (id: string, result: CutResult): void => {\n logger.success(`Snapshot ${result.dir} (${result.copied} file(s) copied)`);\n const totalRewrites = result.rewritten.reduce(\n (sum, entry) => sum + entry.count,\n 0\n );\n if (totalRewrites > 0) {\n logger.info(\n `Rewrote root-absolute links in ${result.rewritten.length} page(s) (${totalRewrites} line(s)).`\n );\n }\n if (result.versionsAdded) {\n logger.success(\n `Turned on versioning in blume.config.ts with \"${id}\" archived; the live docs are labeled \"Latest\" in the switcher until you rename versions.current.label.`\n );\n } else if (result.configUpdated) {\n logger.success(`Added \"${id}\" to versions.archived in blume.config.ts`);\n } else if (result.configSnippet) {\n // A warning, not info: until it's pasted, the snapshot builds as ordinary\n // content — every page twice — and consola drops info lines under CI.\n logger.warn(\n `blume.config.ts couldn't be updated automatically, so \"${id}\" isn't registered yet and its pages build as ordinary content until it is. ${result.configSnippet}`\n );\n }\n logger.info(\n \"Archived versions are frozen — future edits belong in the live tree. Restart `blume dev` to pick up the snapshot.\"\n );\n};\n\nexport const versionCommand = defineCommand({\n args: {\n force: {\n description: \"Overwrite an existing snapshot directory.\",\n type: \"boolean\",\n },\n id: {\n description: 'Version id to cut (e.g. \"v1.0\").',\n required: false,\n type: \"positional\",\n },\n },\n meta: commandMeta.version,\n async run({ args }) {\n const root = process.cwd();\n try {\n if (args.id) {\n reportCut(\n args.id,\n await cutVersion(root, args.id, { force: args.force })\n );\n } else {\n await listVersions(root);\n }\n } catch (error) {\n if (error instanceof CutError) {\n logger.error(error.message);\n process.exit(1);\n }\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
+ ],
7
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAWA,IAAM,eAAe,OAAO,SAAgC;AAAA,EAC1D,QAAQ,WAAW,MAAM,WAAW,IAAI;AAAA,EACxC,IAAI,CAAC,OAAO,UAAU;AAAA,IACpB,OAAO,KACL,4GACF;AAAA,IACA;AAAA,EACF;AAAA,EACA,QAAQ,SAAS,aAAa,OAAO;AAAA,EACrC,QAAQ,OAAO,MACb,KAAK,QAAQ,kBAAkB,QAAQ,QAAQ,MAAM,QAAQ,UAAU;AAAA,CACzE;AAAA,EACA,WAAW,WAAW,UAAU;AAAA,IAC9B,QAAQ,OAAO,MAAM,KAAK,QAAQ,SAAS,QAAQ,QAAQ,QAAQ;AAAA,CAAO;AAAA,EAC5E;AAAA;AAIF,IAAM,YAAY,CAAC,IAAY,WAA4B;AAAA,EACzD,OAAO,QAAQ,YAAY,OAAO,QAAQ,OAAO,wBAAwB;AAAA,EACzE,MAAM,gBAAgB,OAAO,UAAU,OACrC,CAAC,KAAK,UAAU,MAAM,MAAM,OAC5B,CACF;AAAA,EACA,IAAI,gBAAgB,GAAG;AAAA,IACrB,OAAO,KACL,kCAAkC,OAAO,UAAU,mBAAmB,yBACxE;AAAA,EACF;AAAA,EACA,IAAI,OAAO,eAAe;AAAA,IACxB,OAAO,QACL,iDAAiD,2GACnD;AAAA,EACF,EAAO,SAAI,OAAO,eAAe;AAAA,IAC/B,OAAO,QAAQ,UAAU,6CAA6C;AAAA,EACxE,EAAO,SAAI,OAAO,eAAe;AAAA,IAG/B,OAAO,KACL,0DAA0D,iFAAiF,OAAO,eACpJ;AAAA,EACF;AAAA,EACA,OAAO,KACL,mHACF;AAAA;AAGK,IAAM,iBAAiB,cAAc;AAAA,EAC1C,MAAM;AAAA,IACJ,OAAO;AAAA,MACL,aAAa;AAAA,MACb,MAAM;AAAA,IACR;AAAA,IACA,IAAI;AAAA,MACF,aAAa;AAAA,MACb,UAAU;AAAA,MACV,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,MAAM,YAAY;AAAA,OACZ,IAAG,GAAG,QAAQ;AAAA,IAClB,MAAM,OAAO,QAAQ,IAAI;AAAA,IACzB,IAAI;AAAA,MACF,IAAI,KAAK,IAAI;AAAA,QACX,UACE,KAAK,IACL,MAAM,WAAW,MAAM,KAAK,IAAI,EAAE,OAAO,KAAK,MAAM,CAAC,CACvD;AAAA,MACF,EAAO;AAAA,QACL,MAAM,aAAa,IAAI;AAAA;AAAA,MAEzB,OAAO,OAAO;AAAA,MACd,IAAI,iBAAiB,UAAU;AAAA,QAC7B,OAAO,MAAM,MAAM,OAAO;AAAA,QAC1B,QAAQ,KAAK,CAAC;AAAA,MAChB;AAAA,MACA,IAAI,iBAAiB,YAAY;AAAA,QAC/B,kBAAkB,CAAC,MAAM,UAAU,GAAG,IAAI;AAAA,QAC1C,QAAQ,KAAK,CAAC;AAAA,MAChB;AAAA,MACA,oBAAoB,KAAK;AAAA,MACzB,QAAQ,KAAK,CAAC;AAAA;AAAA;AAGpB,CAAC;",
8
+ "debugId": "86F69482E9E3E55264756E2164756E21",
9
+ "names": []
10
+ }
@@ -1,12 +1,72 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- trimEnd
4
- } from "./chunk-2mzebbbz.js";
2
+
3
+ // src/core/trim.ts
4
+ var trimStart = (text, char) => {
5
+ let start = 0;
6
+ while (start < text.length && text[start] === char) {
7
+ start += 1;
8
+ }
9
+ return text.slice(start);
10
+ };
11
+ var trimEnd = (text, char) => {
12
+ let end = text.length;
13
+ while (end > 0 && text[end - 1] === char) {
14
+ end -= 1;
15
+ }
16
+ return text.slice(0, end);
17
+ };
18
+ var trimChar = (text, char) => trimEnd(trimStart(text, char), char);
19
+
20
+ // src/core/base-path.ts
21
+ var normalizeBasePath = (input) => {
22
+ if (!input) {
23
+ return "";
24
+ }
25
+ const trimmed = input.trim().split("/").filter(Boolean).join("/");
26
+ return trimmed === "" ? "" : `/${trimmed}`;
27
+ };
28
+ var normalizePath = (path) => {
29
+ const trimmed = trimEnd(path, "/");
30
+ return trimmed === "" ? "/" : trimmed;
31
+ };
32
+ var normalizeRoute = (input) => {
33
+ const trimmed = trimEnd(input.trim(), "/");
34
+ if (trimmed === "") {
35
+ return "/";
36
+ }
37
+ return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
38
+ };
39
+ var isInternalPath = (target) => target.startsWith("/") && !target.startsWith("//");
40
+ var withBasePath = (basePath, route) => {
41
+ if (!basePath || !isInternalPath(route)) {
42
+ return route;
43
+ }
44
+ if (route === basePath || route.startsWith(`${basePath}/`)) {
45
+ return route;
46
+ }
47
+ return route === "/" ? basePath : `${basePath}${route}`;
48
+ };
49
+ var withComposedBasePath = (deployBase, basePath, route) => {
50
+ const composed = `${deployBase}${basePath}`;
51
+ if (composed && isInternalPath(route) && (route === composed || route.startsWith(`${composed}/`))) {
52
+ return route;
53
+ }
54
+ return withBasePath(deployBase, withBasePath(basePath, route));
55
+ };
56
+ var stripBasePath = (basePath, route) => {
57
+ if (!basePath) {
58
+ return route;
59
+ }
60
+ if (route === basePath) {
61
+ return "/";
62
+ }
63
+ return route.startsWith(`${basePath}/`) ? route.slice(basePath.length) : route;
64
+ };
5
65
 
6
66
  // src/core/site-url.ts
7
67
  import { joinURL } from "ufo";
8
68
  var siteRoot = (site) => trimEnd(site, "/");
9
- var absoluteUrl = (site, path) => {
69
+ var absoluteUrl2 = (site, path) => {
10
70
  const root = siteRoot(site);
11
71
  return path === "/" ? `${root}/` : joinURL(root, path);
12
72
  };
@@ -40,7 +100,7 @@ var MCP_TOOLS = [
40
100
  }
41
101
  ];
42
102
 
43
- export { siteRoot, absoluteUrl, MCP_TOOLS };
103
+ export { trimEnd, trimChar, normalizeBasePath, normalizePath, normalizeRoute, isInternalPath, withBasePath, withComposedBasePath, stripBasePath, siteRoot, absoluteUrl2, MCP_TOOLS };
44
104
 
45
- //# debugId=3DB06DF8543389A264756E2164756E21
46
- //# sourceMappingURL=chunk-ct47dqpx.js.map
105
+ //# debugId=616D9609DF76EF8664756E2164756E21
106
+ //# sourceMappingURL=chunk-jts8mvcz.js.map
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/core/trim.ts", "../src/core/base-path.ts"],
3
+ "sources": ["../src/core/trim.ts", "../src/core/base-path.ts", "../src/core/site-url.ts", "../src/ai/mcp/tools.ts"],
4
4
  "sourcesContent": [
5
5
  "/**\n * Single-character trimming, done without regular expressions.\n *\n * The obvious spellings — `/^\\/+/`, `/\\/+$/`, `/^\\/+|\\/+$/g` — take quadratic\n * time on a run of the trimmed character, because a failed match at one start\n * position tells the engine nothing about the next one. Every caller here trims\n * a value that comes from outside Blume (a configured route, a spec URL, a site\n * origin), so the slow path is reachable from user input rather than only from\n * our own literals. These loops are linear and allocation-free.\n */\n\n/** Drop every leading `char` (`\"///a\"` -> `\"a\"` for `\"/\"`). */\nexport const trimStart = (text: string, char: string): string => {\n let start = 0;\n while (start < text.length && text[start] === char) {\n start += 1;\n }\n return text.slice(start);\n};\n\n/** Drop every trailing `char` (`\"a///\"` -> `\"a\"` for `\"/\"`). */\nexport const trimEnd = (text: string, char: string): string => {\n let end = text.length;\n while (end > 0 && text[end - 1] === char) {\n end -= 1;\n }\n return text.slice(0, end);\n};\n\n/** Drop every leading *and* trailing `char` (`\"///a///\"` -> `\"a\"`). */\nexport const trimChar = (text: string, char: string): string =>\n trimEnd(trimStart(text, char), char);\n",
6
- "/**\n * The site-wide `basePath` — a mount point that prepends a segment to every\n * generated route (`/docs/getting-started`) while staying invisible to the\n * navigation tree (see `core/navigation.ts`, which builds groups from a page's\n * base-less `navPath` and takes URLs from its based `route`). This is distinct\n * from a per-source `prefix` (a namespace that *does* create a sidebar group)\n * and from `deployment.base` (Astro's host-subdirectory base); the two compose,\n * stacking as `{deployment.base}/{basePath}/page`.\n *\n * These helpers run server-side (config, route construction, the link checker,\n * redirects, the markdown link plugin). The client-side counterpart lives in\n * `components/islands/base-path.ts` and serves `deployment.base` via `BASE_URL`.\n */\n\nimport { trimEnd } from \"./trim.ts\";\n\n/**\n * Canonicalize a configured base path to either `\"\"` (none) or `/seg[/seg…]`\n * (leading slash, no trailing slash, collapsed inner slashes). A blank value or\n * bare `/` normalizes to `\"\"`, so an unset/`\"/\"` base is a clean no-op.\n */\nexport const normalizeBasePath = (input?: string): string => {\n if (!input) {\n return \"\";\n }\n // Splitting on \"/\" and dropping the empty parts trims the edges and collapses\n // inner runs in one linear pass; the regex spellings of both are quadratic on\n // a long run of slashes (see `core/trim.ts`).\n const trimmed = input.trim().split(\"/\").filter(Boolean).join(\"/\");\n return trimmed === \"\" ? \"\" : `/${trimmed}`;\n};\n\n/**\n * Normalize a served path for comparison: drop the trailing slash (Astro serves\n * `/docs` and `/docs/` as the same page) and collapse an empty path to `/`.\n */\nexport const normalizePath = (path: string): string => {\n const trimmed = trimEnd(path, \"/\");\n return trimmed === \"\" ? \"/\" : trimmed;\n};\n\n/**\n * Canonicalize a route-ish string (a configured route, a page path, an agent-\n * supplied route) to `/` or `/seg[/seg…]`: trimmed, exactly one leading slash,\n * no trailing slash. The shared spelling of what openapi/references,\n * ai/ask-context, and ai/mcp/server each hand-rolled with slightly different\n * regexes.\n */\nexport const normalizeRoute = (input: string): string => {\n const trimmed = trimEnd(input.trim(), \"/\");\n if (trimmed === \"\") {\n return \"/\";\n }\n return trimmed.startsWith(\"/\") ? trimmed : `/${trimmed}`;\n};\n\n/**\n * Whether a link target is a root-relative internal path (`/x`) — the only\n * shape a base path applies to. Protocol-relative (`//host`), absolute URLs,\n * other schemes (`mailto:`), fragments (`#x`), and relative paths are excluded.\n */\nexport const isInternalPath = (target: string): boolean =>\n target.startsWith(\"/\") && !target.startsWith(\"//\");\n\n/**\n * Whether a rendered link should open in a new tab: an absolute http(s) URL or\n * a protocol-relative one (`//host/path`). Other schemes (`mailto:`, `tel:`)\n * also leave the site but hand off to another application, where a `_blank`\n * target only opens an empty tab beside it. The one predicate behind every\n * chrome link, so a header action and a sidebar featured link treat the same\n * href alike.\n */\nexport const isExternalUrl = (target: string): boolean =>\n /^https?:\\/\\//iu.test(target) || target.startsWith(\"//\");\n\n/**\n * Idempotently prepend `basePath` to a root-relative route. A route already\n * equal to or nested under the base is returned unchanged, so authors who write\n * the base by hand (`/docs/x`) aren't double-prefixed to `/docs/docs/x`.\n */\nexport const withBasePath = (basePath: string, route: string): string => {\n if (!basePath || !isInternalPath(route)) {\n return route;\n }\n if (route === basePath || route.startsWith(`${basePath}/`)) {\n return route;\n }\n return route === \"/\" ? basePath : `${basePath}${route}`;\n};\n\n/**\n * {@link withBasePath} for the composed `deployment.base` + `basePath` stack\n * (`/base` + `/docs` serves pages at `/base/docs/x`). The hand-written-base\n * promise applies per layer: authors write `basePath` by hand (see\n * `markdown/base-links.ts`), so a `/docs/x` link gains only the deployment base\n * (`/base/docs/x`) rather than being double-prefixed to `/base/docs/docs/x`,\n * and a route already under the full composite is returned unchanged.\n */\nexport const withComposedBasePath = (\n deployBase: string,\n basePath: string,\n route: string\n): string => {\n const composed = `${deployBase}${basePath}`;\n if (\n composed &&\n isInternalPath(route) &&\n (route === composed || route.startsWith(`${composed}/`))\n ) {\n return route;\n }\n return withBasePath(deployBase, withBasePath(basePath, route));\n};\n\n/**\n * Remove `basePath` from the front of a route (`/docs/guide` -> `/guide`,\n * `/docs` -> `/`). A route not under the base is returned unchanged. Inverse of\n * {@link withBasePath}; used to resolve public assets, which live at the site\n * root regardless of the base.\n */\nexport const stripBasePath = (basePath: string, route: string): string => {\n if (!basePath) {\n return route;\n }\n if (route === basePath) {\n return \"/\";\n }\n return route.startsWith(`${basePath}/`)\n ? route.slice(basePath.length)\n : route;\n};\n"
6
+ "/**\n * The site-wide `basePath` — a mount point that prepends a segment to every\n * generated route (`/docs/getting-started`) while staying invisible to the\n * navigation tree (see `core/navigation.ts`, which builds groups from a page's\n * base-less `navPath` and takes URLs from its based `route`). This is distinct\n * from a per-source `prefix` (a namespace that *does* create a sidebar group)\n * and from `deployment.base` (Astro's host-subdirectory base); the two compose,\n * stacking as `{deployment.base}/{basePath}/page`.\n *\n * These helpers run server-side (config, route construction, the link checker,\n * redirects, the markdown link plugin). The client-side counterpart lives in\n * `components/islands/base-path.ts` and serves `deployment.base` via `BASE_URL`.\n */\n\nimport { trimEnd } from \"./trim.ts\";\n\n/**\n * Canonicalize a configured base path to either `\"\"` (none) or `/seg[/seg…]`\n * (leading slash, no trailing slash, collapsed inner slashes). A blank value or\n * bare `/` normalizes to `\"\"`, so an unset/`\"/\"` base is a clean no-op.\n */\nexport const normalizeBasePath = (input?: string): string => {\n if (!input) {\n return \"\";\n }\n // Splitting on \"/\" and dropping the empty parts trims the edges and collapses\n // inner runs in one linear pass; the regex spellings of both are quadratic on\n // a long run of slashes (see `core/trim.ts`).\n const trimmed = input.trim().split(\"/\").filter(Boolean).join(\"/\");\n return trimmed === \"\" ? \"\" : `/${trimmed}`;\n};\n\n/**\n * Normalize a served path for comparison: drop the trailing slash (Astro serves\n * `/docs` and `/docs/` as the same page) and collapse an empty path to `/`.\n */\nexport const normalizePath = (path: string): string => {\n const trimmed = trimEnd(path, \"/\");\n return trimmed === \"\" ? \"/\" : trimmed;\n};\n\n/**\n * Canonicalize a route-ish string (a configured route, a page path, an agent-\n * supplied route) to `/` or `/seg[/seg…]`: trimmed, exactly one leading slash,\n * no trailing slash. The shared spelling of what openapi/references,\n * ai/ask-context, and ai/mcp/server each hand-rolled with slightly different\n * regexes.\n */\nexport const normalizeRoute = (input: string): string => {\n const trimmed = trimEnd(input.trim(), \"/\");\n if (trimmed === \"\") {\n return \"/\";\n }\n return trimmed.startsWith(\"/\") ? trimmed : `/${trimmed}`;\n};\n\n/**\n * Whether a link target is a root-relative internal path (`/x`) — the only\n * shape a base path applies to. Protocol-relative (`//host`), absolute URLs,\n * other schemes (`mailto:`), fragments (`#x`), and relative paths are excluded.\n */\nexport const isInternalPath = (target: string): boolean =>\n target.startsWith(\"/\") && !target.startsWith(\"//\");\n\n/**\n * Whether a rendered link should open in a new tab: an absolute http(s) URL or\n * a protocol-relative one (`//host/path`). Other schemes (`mailto:`, `tel:`)\n * also leave the site but hand off to another application, where a `_blank`\n * target only opens an empty tab beside it. The one predicate behind every\n * chrome link, so a header action and a sidebar featured link treat the same\n * href alike.\n */\nexport const isExternalUrl = (target: string): boolean =>\n /^https?:\\/\\//iu.test(target) || target.startsWith(\"//\");\n\n/**\n * Idempotently prepend `basePath` to a root-relative route. A route already\n * equal to or nested under the base is returned unchanged, so authors who write\n * the base by hand (`/docs/x`) aren't double-prefixed to `/docs/docs/x`.\n */\nexport const withBasePath = (basePath: string, route: string): string => {\n if (!basePath || !isInternalPath(route)) {\n return route;\n }\n if (route === basePath || route.startsWith(`${basePath}/`)) {\n return route;\n }\n return route === \"/\" ? basePath : `${basePath}${route}`;\n};\n\n/**\n * {@link withBasePath} for the composed `deployment.base` + `basePath` stack\n * (`/base` + `/docs` serves pages at `/base/docs/x`). The hand-written-base\n * promise applies per layer: authors write `basePath` by hand (see\n * `markdown/base-links.ts`), so a `/docs/x` link gains only the deployment base\n * (`/base/docs/x`) rather than being double-prefixed to `/base/docs/docs/x`,\n * and a route already under the full composite is returned unchanged.\n */\nexport const withComposedBasePath = (\n deployBase: string,\n basePath: string,\n route: string\n): string => {\n const composed = `${deployBase}${basePath}`;\n if (\n composed &&\n isInternalPath(route) &&\n (route === composed || route.startsWith(`${composed}/`))\n ) {\n return route;\n }\n return withBasePath(deployBase, withBasePath(basePath, route));\n};\n\n/**\n * Remove `basePath` from the front of a route (`/docs/guide` -> `/guide`,\n * `/docs` -> `/`). A route not under the base is returned unchanged. Inverse of\n * {@link withBasePath}; used to resolve public assets, which live at the site\n * root regardless of the base.\n */\nexport const stripBasePath = (basePath: string, route: string): string => {\n if (!basePath) {\n return route;\n }\n if (route === basePath) {\n return \"/\";\n }\n return route.startsWith(`${basePath}/`)\n ? route.slice(basePath.length)\n : route;\n};\n",
7
+ "import { joinURL } from \"ufo\";\n\nimport { trimEnd } from \"./trim.ts\";\n\n/**\n * Absolute-URL building for the configured `deployment.site`, shared by every\n * emitter that prints site URLs (sitemap, RSS, robots, llms.txt, the MCP and\n * agent-discovery documents). One implementation replaces eight per-file\n * copies that had drifted across three different trailing-slash treatments.\n *\n * Deliberately not `new URL(path, site)`: a root-absolute path would drop the\n * base path of a subpath deployment (`acme.com/docs`). ufo's `joinURL` joins\n * without that footgun; the site is first trimmed with the ReDoS-safe\n * `trimEnd` loop so even a malformed `site` with piled-up trailing slashes\n * joins cleanly.\n */\n\n/** The configured site with any trailing slashes dropped. */\nexport const siteRoot = (site: string): string => trimEnd(site, \"/\");\n\n/** `site` + root-absolute `path` (already carrying any deployment base). */\nexport const absoluteUrl = (site: string, path: string): string => {\n const root = siteRoot(site);\n // joinURL folds a lone \"/\" away entirely; the homepage keeps its slash\n // (`https://example.com/`), matching what every emitter always printed.\n return path === \"/\" ? `${root}/` : joinURL(root, path);\n};\n",
8
+ "/**\n * Static metadata for the MCP tools Blume exposes. Shared by the server (which\n * pairs each entry with a Zod input schema and handler) and the `.well-known`\n * discovery documents, so tool names and descriptions never drift between the\n * live server and its advertised capabilities.\n */\n\n/** A read-only, non-mutating tool hint set (every Blume tool is read-only). */\nconst READ_ONLY = { openWorldHint: false, readOnlyHint: true } as const;\n\nexport interface McpToolMeta {\n annotations: { openWorldHint: boolean; readOnlyHint: boolean };\n description: string;\n name: string;\n title: string;\n}\n\nexport const MCP_TOOLS: McpToolMeta[] = [\n {\n annotations: READ_ONLY,\n description:\n 'Full-text search across the documentation. Returns matching pages with their title, route, content type, and a short excerpt; pass `contentTypes` to search only pages of certain types (e.g. `rfc`, `changelog`), `filters` to require facet values the site declares per type (e.g. `{\"status\": \"enforced\"}`), and `locale` to search one language. On a versioned site results default to the current docs — pass `version` to search an archived version (e.g. `\"v1.0\"`) or `\"all\"` for every version. Use this first to discover relevant pages, then `get_page` to read one in full.',\n name: \"search_docs\",\n title: \"Search documentation\",\n },\n {\n annotations: READ_ONLY,\n description:\n \"Fetch a single documentation page as agent-optimized Markdown (frontmatter included, components downleveled to plain Markdown). Pass a route from `search_docs` or `list_pages`, e.g. `/guides/install`.\",\n name: \"get_page\",\n title: \"Get page Markdown\",\n },\n {\n annotations: READ_ONLY,\n description:\n 'List every documentation page with its route, title, description, content type, and any declared facet values; pass `contentTypes`, `filters`, and/or `locale` to narrow the list. On a versioned site the list defaults to the current docs — pass `version` for an archived version or `\"all\"`. Useful for enumerating the docs, discovering the types and facets in use, or finding a page when search is too narrow.',\n name: \"list_pages\",\n title: \"List pages\",\n },\n {\n annotations: READ_ONLY,\n description:\n \"Return the documentation navigation tree (header tabs and the sidebar hierarchy), reflecting how the docs are organized for readers. Pass `locale` for a language's tree and, on a versioned site, `version` for an archived snapshot's tree.\",\n name: \"get_navigation\",\n title: \"Get navigation\",\n },\n];\n"
7
9
  ],
8
- "mappings": ";;;AAYO,IAAM,YAAY,CAAC,MAAc,SAAyB;AAAA,EAC/D,IAAI,QAAQ;AAAA,EACZ,OAAO,QAAQ,KAAK,UAAU,KAAK,WAAW,MAAM;AAAA,IAClD,SAAS;AAAA,EACX;AAAA,EACA,OAAO,KAAK,MAAM,KAAK;AAAA;AAIlB,IAAM,UAAU,CAAC,MAAc,SAAyB;AAAA,EAC7D,IAAI,MAAM,KAAK;AAAA,EACf,OAAO,MAAM,KAAK,KAAK,MAAM,OAAO,MAAM;AAAA,IACxC,OAAO;AAAA,EACT;AAAA,EACA,OAAO,KAAK,MAAM,GAAG,GAAG;AAAA;AAInB,IAAM,WAAW,CAAC,MAAc,SACrC,QAAQ,UAAU,MAAM,IAAI,GAAG,IAAI;;;ACV9B,IAAM,oBAAoB,CAAC,UAA2B;AAAA,EAC3D,IAAI,CA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AO;AAAA,EACT;AAAA,EACA;AAAA,IACE,aAAa;AAAA,IACb,aACE;AAAA,IACF,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,aAAa;AAAA,IACb,aACE;AAAA,IACF,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AACF;",
11
+ "debugId": "616D9609DF76EF8664756E2164756E21",
10
12
  "names": []
11
13
  }
@@ -5,23 +5,23 @@ import {
5
5
  BlumeError,
6
6
  countBySeverity,
7
7
  logger,
8
- flushStdout
8
+ flushStdout,
9
+ reportDiagnostics
9
10
  } from "./index.js";
10
11
  import {
11
12
  AGENTS,
12
13
  launchAgent
13
- } from "./chunk-0xjyb285.js";
14
- import"./chunk-7s8hm3b6.js";
14
+ } from "./chunk-qwsrynx5.js";
15
+ import {
16
+ YAML_SCHEMA
17
+ } from "./chunk-qkqwkpte.js";
18
+ import"./chunk-jts8mvcz.js";
15
19
  import {
16
- YAML_SCHEMA,
17
20
  scanProject
18
- } from "./chunk-1jefwnfs.js";
21
+ } from "./chunk-fs23ddbb.js";
19
22
  import {
20
23
  buildMcpData
21
- } from "./chunk-js7saxwm.js";
22
- import"./chunk-bf6bt1xt.js";
23
- import"./chunk-ct47dqpx.js";
24
- import"./chunk-0qymqwzz.js";
24
+ } from "./chunk-6crbhc3x.js";
25
25
  import {
26
26
  seconds,
27
27
  money,
@@ -31,7 +31,7 @@ import {
31
31
  agentArgs,
32
32
  readAgentOutput,
33
33
  parseVerdict
34
- } from "./chunk-2z47ypj8.js";
34
+ } from "./chunk-fa25z98p.js";
35
35
 
36
36
  // src/cli/commands/eval.ts
37
37
  import { existsSync } from "node:fs";
@@ -169,7 +169,8 @@ var headerLine = (total, agent) => `${colors.bold("blume eval")} ${total} quest
169
169
  var startLine = (id, index, total) => ` ${colors.dim(`▸ ${id} (${index + 1}/${total})`)}`;
170
170
  var fixLines = (result, root) => result.diagnostics.filter((diagnostic) => diagnostic.code !== "BLUME_EVAL_ROUTE_UNKNOWN").map((finding) => {
171
171
  const site = finding.file ? `${relative(root, finding.file)}${finding.line ? `:${finding.line}` : ""}` : "";
172
- return ` ${colors.cyan("fix:")} ${site} ${colors.dim(finding.message)}`;
172
+ const label = finding.code === "BLUME_EVAL_QUESTION_ERROR" ? colors.red("run failed:") : colors.cyan("fix:");
173
+ return ` ${label} ${site} ${colors.dim(finding.message)}`;
173
174
  });
174
175
  var warningLines = (result, root) => result.diagnostics.filter((diagnostic) => diagnostic.code === "BLUME_EVAL_ROUTE_UNKNOWN").map((finding) => {
175
176
  const site = finding.file ? ` ${relative(root, finding.file)}${finding.line ? `:${finding.line}` : ""}` : "";
@@ -280,7 +281,7 @@ var locateQuestion = (raw, id) => {
280
281
  };
281
282
 
282
283
  // src/eval/findings.ts
283
- var DOCS_URL = "https://useblume.dev/docs/reference/eval";
284
+ var DOCS_URL = "https://useblume.dev/docs/cli/evals";
284
285
  var hintedRoute = (question, project) => {
285
286
  for (const hint of question.routes) {
286
287
  const route = project.manifest.routes.find((candidate) => candidate.path === hint);
@@ -302,18 +303,22 @@ var routeFindings = (question, project, anchor) => {
302
303
  }));
303
304
  };
304
305
  var questionFinding = (question, outcome, project, anchor) => {
305
- const route = hintedRoute(question, project);
306
- const site = route ? { file: route.sourcePath, url: route.path } : { file: anchor.path, line: locateQuestion(anchor.raw, question.id) };
306
+ const questionSite = {
307
+ file: anchor.path,
308
+ line: locateQuestion(anchor.raw, question.id)
309
+ };
307
310
  if (outcome.status === "error") {
308
311
  return {
309
312
  code: "BLUME_EVAL_QUESTION_ERROR",
310
313
  docsUrl: DOCS_URL,
311
- message: `Eval run failed for "${question.question}"${outcome.detail ? ` — ${outcome.detail}` : ""}.`,
314
+ message: `The agent run failed for "${question.question}"${outcome.detail ? ` — ${outcome.detail}` : ""}, so the docs weren't graded.`,
312
315
  severity: question.severity,
313
316
  suggestion: "Rerun `blume eval`; if it persists, check the agent CLI installation and the failure detail.",
314
- ...site
317
+ ...questionSite
315
318
  };
316
319
  }
320
+ const route = hintedRoute(question, project);
321
+ const site = route ? { file: route.sourcePath, url: route.path } : questionSite;
317
322
  const missing = outcome.missing.length > 0 ? ` — missing: ${outcome.missing.join("; ")}` : "";
318
323
  return {
319
324
  code: "BLUME_EVAL_QUESTION_FAILED",
@@ -495,7 +500,7 @@ var passFraction = (result) => {
495
500
  };
496
501
  var parseFlags = (args) => {
497
502
  if (!isAgentKind(args.agent)) {
498
- logger.error(`Invalid --agent "${args.agent}" (use claude | codex).`);
503
+ logger.error(`Invalid --agent "${args.agent}" (use codex | claude).`);
499
504
  process.exit(1);
500
505
  }
501
506
  if (args.action !== undefined && args.action !== "init") {
@@ -552,8 +557,8 @@ var evalCommand = defineCommand({
552
557
  type: "positional"
553
558
  },
554
559
  agent: {
555
- default: "claude",
556
- description: "Agent CLI that reads and grades the docs: claude | codex.",
560
+ default: "codex",
561
+ description: "Agent CLI that reads and grades the docs: codex | claude.",
557
562
  type: "string"
558
563
  },
559
564
  file: {
@@ -626,7 +631,7 @@ var evalCommand = defineCommand({
626
631
  process.exit(1);
627
632
  }
628
633
  if (error instanceof BlumeError) {
629
- logger.error(error.diagnostic.message);
634
+ reportDiagnostics([error.diagnostic], root);
630
635
  process.exit(1);
631
636
  }
632
637
  if (error?.code === "ENOENT") {
@@ -668,5 +673,5 @@ export {
668
673
  passFraction
669
674
  };
670
675
 
671
- //# debugId=83C1CBF787A3FD3264756E2164756E21
672
- //# sourceMappingURL=chunk-ahnw3kxw.js.map
676
+ //# debugId=7175171294EC3BBC64756E2164756E21
677
+ //# sourceMappingURL=chunk-jwyddg7y.js.map
@@ -0,0 +1,15 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/cli/commands/eval.ts", "../src/eval/prompts.ts", "../src/eval/report.ts", "../src/eval/run.ts", "../src/eval/schema.ts", "../src/eval/findings.ts"],
4
+ "sourcesContent": [
5
+ "import { existsSync } from \"node:fs\";\n\nimport { defineCommand } from \"citty\";\nimport { join } from \"pathe\";\n\nimport { AGENTS, launchAgent } from \"../../audit/agent.ts\";\nimport type { AgentKind } from \"../../audit/agent.ts\";\nimport { BlumeError } from \"../../core/diagnostics.ts\";\nimport { scanProject } from \"../../core/project-graph.ts\";\nimport { evalFixPrompt, initPrompt } from \"../../eval/prompts.ts\";\nimport {\n evalReportJson,\n fixLines,\n headerLine,\n questionDetails,\n questionLine,\n startLine,\n summaryLine,\n warningLines,\n writeEvalReport,\n} from \"../../eval/report.ts\";\nimport { runEval } from \"../../eval/run.ts\";\nimport type { EvalResult } from \"../../eval/run.ts\";\nimport { EvalsFileError, loadEvalsFile } from \"../../eval/schema.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport { reportInternalError } from \"../internal-error.ts\";\nimport { flushStdout, logger, reportDiagnostics } from \"../log.ts\";\n\nconst DEFAULT_FILE = \"evals.yaml\";\n\n/** Reader wall-clock ceiling per question, in seconds. */\nconst DEFAULT_TIMEOUT_S = 180;\n\nconst isAgentKind = (value: string): value is AgentKind => value in AGENTS;\n\n/**\n * Launch the interactive agent CLI, turning a missing executable into the\n * install hint. Only `ENOENT` means \"not installed\" — any other spawn failure\n * (`EACCES`, `EMFILE`, …) must surface as itself.\n */\nconst notInstalled = (agent: AgentKind): never => {\n const cli = AGENTS[agent];\n logger.error(\n `${cli.name} (\\`${cli.bin}\\`) was not found on PATH. Install it with \\`${cli.install}\\`.`\n );\n return process.exit(1);\n};\n\nconst launchAgentCode = async (\n agent: AgentKind,\n prompt: string\n): Promise<number> => {\n try {\n return await launchAgent(AGENTS[agent].bin, prompt);\n } catch (error) {\n // SAFETY: only the `code` tag is inspected; a spawn failure throws an\n // ErrnoException, and any other thrown value fails the comparison and\n // rethrows unchanged.\n if ((error as NodeJS.ErrnoException)?.code !== \"ENOENT\") {\n throw error;\n }\n return notInstalled(agent);\n }\n};\n\n/** The fraction of run (non-skipped) questions that passed. */\nexport const passFraction = (result: EvalResult): number => {\n const ran = result.results.length - result.counts.skip;\n return ran === 0 ? 1 : result.counts.pass / ran;\n};\n\ninterface EvalFlags {\n action?: string;\n agent: string;\n file: string;\n fix?: boolean;\n json?: boolean;\n threshold?: string;\n timeout?: string;\n}\n\n/** Validate the flag surface, exiting with a message on the first offense. */\nconst parseFlags = (args: EvalFlags) => {\n if (!isAgentKind(args.agent)) {\n logger.error(`Invalid --agent \"${args.agent}\" (use codex | claude).`);\n process.exit(1);\n }\n if (args.action !== undefined && args.action !== \"init\") {\n logger.error(`Unknown action \"${args.action}\" (did you mean \"init\"?).`);\n process.exit(1);\n }\n if (args.json && args.fix) {\n logger.error(\"--json and --fix are mutually exclusive.\");\n process.exit(1);\n }\n const threshold = args.threshold === undefined ? 1 : Number(args.threshold);\n if (!Number.isFinite(threshold) || threshold < 0 || threshold > 1) {\n logger.error(`Invalid --threshold \"${args.threshold}\" (use 0..1).`);\n process.exit(1);\n }\n const timeoutS =\n args.timeout === undefined ? DEFAULT_TIMEOUT_S : Number(args.timeout);\n if (!Number.isInteger(timeoutS) || timeoutS <= 0) {\n logger.error(`Invalid --timeout \"${args.timeout}\" (whole seconds).`);\n process.exit(1);\n }\n return { agent: args.agent, threshold, timeoutS };\n};\n\n/** `blume eval --fix`: hand the failing report to the interactive agent. */\nconst runFixHandoff = async (\n agent: AgentKind,\n result: EvalResult,\n root: string,\n threshold: number\n): Promise<void> => {\n const count = result.counts.fail + result.counts.error;\n if (count === 0) {\n return;\n }\n const cli = AGENTS[agent];\n const report = await writeEvalReport(result, root, threshold);\n process.stderr.write(\n ` Handing ${count} failed question${count === 1 ? \"\" : \"s\"} to ${cli.name}…\\n\\n`\n );\n const code = await launchAgentCode(agent, evalFixPrompt(report));\n if (code !== 0) {\n process.exit(code);\n }\n};\n\n/** `blume eval init`: draft a starter evals file via the interactive agent. */\nconst runInit = async (agent: AgentKind, file: string): Promise<void> => {\n const path = join(process.cwd(), file);\n if (existsSync(path)) {\n logger.error(\n `${file} already exists — edit it directly, or pass --file to draft elsewhere.`\n );\n process.exit(1);\n }\n const code = await launchAgentCode(agent, initPrompt(file));\n if (code !== 0) {\n process.exit(code);\n }\n};\n\nexport const evalCommand = defineCommand({\n args: {\n action: {\n description: 'Optional action: \"init\" drafts a starter evals file.',\n required: false,\n type: \"positional\",\n },\n agent: {\n default: \"codex\",\n description: \"Agent CLI that reads and grades the docs: codex | claude.\",\n type: \"string\",\n },\n file: {\n default: DEFAULT_FILE,\n description: \"The evals file to run.\",\n type: \"string\",\n },\n fix: {\n description:\n \"After a failing run, hand the report to the agent to fix the docs interactively.\",\n type: \"boolean\",\n },\n json: {\n description: \"Emit the report as JSON on stdout (for CI/editors).\",\n type: \"boolean\",\n },\n threshold: {\n description:\n \"Minimum passing fraction (0..1) before the run exits non-zero. Defaults to 1.\",\n type: \"string\",\n },\n timeout: {\n description: `Reader time limit per question, in seconds. Defaults to ${DEFAULT_TIMEOUT_S}.`,\n type: \"string\",\n },\n verbose: {\n description: \"Include the reader's full answer under each failure.\",\n type: \"boolean\",\n },\n },\n meta: commandMeta.eval,\n async run({ args }) {\n const root = process.cwd();\n const { agent, threshold, timeoutS } = parseFlags(args);\n if (args.action === \"init\") {\n await runInit(agent, args.file);\n return;\n }\n\n let result: EvalResult;\n try {\n // `scanProject`, not `prepareProject`: the eval reads the content tree\n // and never regenerates the runtime, so it doesn't contend with a\n // running dev server. Same reasoning as `blume audit`.\n const project = await scanProject(root, { mode: \"build\" });\n const evalsPath = join(root, args.file);\n const { evals, raw } = await loadEvalsFile(evalsPath);\n\n process.stderr.write(`${headerLine(evals.questions.length, agent)}\\n\\n`);\n result = await runEval({\n agent,\n evals,\n evalsPath,\n onProgress: (event) => {\n // Straight to stderr, not `logger.info` — consola drops info-level\n // lines in test and CI environments.\n if (event.kind === \"question-start\") {\n process.stderr.write(\n `${startLine(event.id, event.index, event.total)}\\n`\n );\n return;\n }\n const lines = [\n questionLine(event.result),\n ...questionDetails(event.result, Boolean(args.verbose)),\n ];\n process.stderr.write(`${lines.join(\"\\n\")}\\n`);\n },\n project,\n rawEvals: raw,\n readerTimeoutMs: timeoutS * 1000,\n });\n } catch (error) {\n if (error instanceof EvalsFileError) {\n logger.error(error.message);\n process.exit(1);\n }\n if (error instanceof BlumeError) {\n reportDiagnostics([error.diagnostic], root);\n process.exit(1);\n }\n // SAFETY: only the `code` tag is inspected; a spawn failure throws an\n // ErrnoException, and any other thrown value fails the comparison and\n // falls through to the internal-error report.\n if ((error as NodeJS.ErrnoException)?.code === \"ENOENT\") {\n notInstalled(agent);\n }\n reportInternalError(error);\n process.exit(1);\n }\n\n const tail = [\n \"\",\n ...warningLines(result, root),\n ...fixLines(result, root),\n \"\",\n ` ${summaryLine(result)}`,\n \"\",\n ];\n process.stderr.write(tail.join(\"\\n\"));\n\n const failed = passFraction(result) < threshold;\n\n if (args.fix) {\n // The gate is a CI concern; a handoff run succeeds when the agent\n // session does, not when the docs already passed.\n await runFixHandoff(agent, result, root, threshold);\n return;\n }\n\n if (args.json) {\n process.stdout.write(evalReportJson(result, root, threshold));\n if (failed) {\n // `process.exit` doesn't flush a piped stdout — without this the JSON\n // is truncated mid-write in exactly the CI setups that consume it.\n await flushStdout();\n process.exit(1);\n }\n return;\n }\n\n if (failed) {\n process.exit(1);\n }\n },\n});\n",
6
+ "import type { EvalQuestion } from \"./schema.ts\";\n\n/**\n * The reader's instructions. The agent is spawned in an empty directory with\n * its file/shell/web tools disabled, so the prompt's job is to direct it at\n * the MCP docs tools and forbid the one escape hatch that remains: answering\n * from prior knowledge of the product.\n */\nexport const readerPrompt = (question: EvalQuestion): string =>\n `You are evaluating whether a product's documentation can answer a user's question.\n\nAnswer the question below using ONLY the connected documentation tools (search_docs, get_page, list_pages, get_navigation). Rules:\n- Do not use prior knowledge about the product. Do not guess.\n- Do not read files, run commands, or access the network.\n- Search first, then read the most relevant pages with get_page.\n- If the documentation does not contain the answer, say exactly what information is missing instead of inventing one.\n\nQuestion: ${question.question}\n\nReply with a concise answer containing the specific facts the documentation provides. Plain text only.`;\n\n/** The judge's instructions: grade the answer against the expected facts. */\nexport const judgePrompt = (question: EvalQuestion, answer: string): string => {\n const facts = question.expected.map((fact) => `- ${fact}`).join(\"\\n\");\n return `You are grading an answer against expected facts. Do not use any tools.\n\nQuestion: ${question.question}\n\nExpected facts — each must be present in substance (paraphrase is fine, contradiction is not):\n${facts}\n\nAnswer to grade:\n\"\"\"\n${answer}\n\"\"\"\n\nAn answer that states the documentation lacks the information FAILS.\n\nReply with ONLY this JSON object on a single line, no markdown fences:\n{\"pass\": true|false, \"score\": 0.0-1.0, \"missing\": [\"expected facts absent or contradicted\"], \"notes\": \"one sentence\"}`;\n};\n\n/** The `--fix` handoff prompt: where the report is and the ground rules. */\nexport const evalFixPrompt = (reportPath: string): string =>\n `Fix the documentation gaps found by \\`blume eval\\` in this project.\n\nThe full report is at ${reportPath}. It is JSON: each entry in \\`eval.results\\` with status \"fail\" is one question the documentation could not answer. Each carries the \\`question\\`, the \\`expected\\` facts, the judge's \\`missing\\` facts, and the reader agent's \\`answer\\` (what the docs currently convey). The matching \\`diagnostics\\` entry names the source \\`file\\` of the page that should answer it.\n\nWork through every failed question:\n1. Read the page named in the finding (or choose the best page when none is named).\n2. Edit the documentation so it states the missing facts explicitly. Add prose, not filler; keep the page's voice.\n3. Never delete questions from the evals file or weaken expected facts.\n\nWhen you are done, run \\`blume eval\\` to verify, and repeat until every question passes.`;\n\n/** The `eval init` prompt: draft a starter evals file from the docs. */\nexport const initPrompt = (evalsPath: string): string =>\n `Draft a starter evals file for \\`blume eval\\` in this documentation project.\n\nRead the documentation source pages in this project and write ${evalsPath} with about 10 high-value questions a real user would ask — installation, configuration, deployment, and the project's headline features. For each question, list the expected facts a correct answer must state, grounded in what the documentation actually promises (never invent facts the docs don't state).\n\nThe file format is YAML:\n\nquestions:\n - id: kebab-case-slug\n question: One user question?\n expected:\n - a fact the answer must contain\n - another required fact\n routes:\n - /route/of/the/page/that/answers/it\n\nRules:\n- Every \\`expected\\` fact must be verifiable in the docs today.\n- Prefer questions whose answers live on one page; set \\`routes\\` to that page.\n- Keep ids unique and questions short.\n\nWhen you are done, print the file and suggest running \\`blume eval\\` to try it.`;\n",
7
+ "import { mkdtemp, writeFile } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\n\nimport { colors } from \"consola/utils\";\nimport type { ColorFunction } from \"consola/utils\";\nimport { join, relative } from \"pathe\";\n\nimport { AGENTS } from \"../audit/agent.ts\";\nimport { duration, money, seconds } from \"../cli/report-format.ts\";\nimport { countBySeverity } from \"../core/diagnostics.ts\";\nimport type { EvalResult, QuestionResult, QuestionStatus } from \"./run.ts\";\n\nconst GLYPH = {\n error: \"!\",\n fail: \"✖\",\n pass: \"✔\",\n skip: \"⊘\",\n} satisfies Record<QuestionStatus, string>;\n\nconst STATUS_COLOR = {\n error: colors.yellow,\n fail: colors.red,\n pass: colors.green,\n skip: colors.dim,\n} satisfies Record<QuestionStatus, ColorFunction>;\n\n/** Longest id gets the room; everything shorter aligns to it. */\nconst ID_PAD = 28;\n\n/** One question's progress/report line: glyph, id, status, score, time, cost. */\nexport const questionLine = (result: QuestionResult): string => {\n const color = STATUS_COLOR[result.status];\n const glyph = color(GLYPH[result.status]);\n const id = result.id.padEnd(ID_PAD);\n if (result.status === \"skip\") {\n return ` ${glyph} ${id} ${colors.dim(\"skipped\")}`;\n }\n const score = result.score === undefined ? \"\" : result.score.toFixed(2);\n const cost = money(result.costUsd);\n const cells = [\n color(result.status),\n score,\n colors.dim(seconds(result.durationMs)),\n cost === \"\" ? \"\" : colors.dim(cost),\n ]\n .filter((cell) => cell !== \"\")\n .join(\" \");\n return ` ${glyph} ${id} ${cells}`;\n};\n\n/** Indented context under a question's line: missing facts, error detail. */\nexport const questionDetails = (\n result: QuestionResult,\n verbose: boolean\n): string[] => {\n const lines: string[] = [];\n if (result.status === \"fail\") {\n for (const fact of result.missing) {\n lines.push(` ${colors.dim(`missing: ${fact}`)}`);\n }\n }\n if (result.status === \"error\" && result.detail) {\n lines.push(` ${colors.dim(result.detail)}`);\n }\n if (verbose && result.answer && result.status !== \"pass\") {\n lines.push(\n ...result.answer\n .split(\"\\n\")\n .map((line) => ` ${colors.dim(`> ${line}`)}`)\n );\n }\n return lines;\n};\n\n/** The one-line totals: `9 passed · 2 failed · 1 skipped · 1m 42s · $0.71`. */\nexport const summaryLine = (result: EvalResult): string => {\n const { counts } = result;\n const parts = [\n `${counts.pass} passed`,\n counts.fail > 0 ? `${counts.fail} failed` : \"\",\n counts.error > 0 ? `${counts.error} errored` : \"\",\n counts.skip > 0 ? `${counts.skip} skipped` : \"\",\n duration(result.durationMs),\n money(result.costUsd),\n ].filter((part) => part !== \"\");\n return parts.join(\" · \");\n};\n\n/** The header line the command prints before the first question runs. */\nexport const headerLine = (total: number, agent: EvalResult[\"agent\"]): string =>\n `${colors.bold(\"blume eval\")} ${total} question(s) · ${AGENTS[agent].name}`;\n\n/** The dim announce line while a question's agents run. */\nexport const startLine = (id: string, index: number, total: number): string =>\n ` ${colors.dim(`▸ ${id} (${index + 1}/${total})`)}`;\n\n/**\n * `fix:` pointers for failed questions, naming the file that resolves each. A\n * question whose agent run errored gets a `run failed:` line pointing at the\n * question instead: the run never graded the docs, so there's no page to fix.\n */\nexport const fixLines = (result: EvalResult, root: string): string[] =>\n result.diagnostics\n .filter((diagnostic) => diagnostic.code !== \"BLUME_EVAL_ROUTE_UNKNOWN\")\n .map((finding) => {\n const site = finding.file\n ? `${relative(root, finding.file)}${finding.line ? `:${finding.line}` : \"\"}`\n : \"\";\n const label =\n finding.code === \"BLUME_EVAL_QUESTION_ERROR\"\n ? colors.red(\"run failed:\")\n : colors.cyan(\"fix:\");\n return ` ${label} ${site} ${colors.dim(finding.message)}`;\n });\n\n/** Dim warnings for route hints that no longer match a page. */\nexport const warningLines = (result: EvalResult, root: string): string[] =>\n result.diagnostics\n .filter((diagnostic) => diagnostic.code === \"BLUME_EVAL_ROUTE_UNKNOWN\")\n .map((finding) => {\n const site = finding.file\n ? ` ${relative(root, finding.file)}${finding.line ? `:${finding.line}` : \"\"}`\n : \"\";\n return ` ${colors.yellow(\"⚠\")}${site} ${colors.dim(finding.message)}`;\n });\n\n/** The human report, written to stderr by the command. */\nexport const formatEvalReport = (\n result: EvalResult,\n root: string,\n options: { verbose?: boolean } = {}\n): string => {\n const lines: string[] = [headerLine(result.results.length, result.agent), \"\"];\n\n for (const question of result.results) {\n lines.push(\n questionLine(question),\n ...questionDetails(question, Boolean(options.verbose))\n );\n }\n lines.push(\"\");\n\n // The finding tells the author which file fixes which failure.\n const failures = fixLines(result, root);\n lines.push(...failures);\n if (failures.length > 0) {\n lines.push(\"\");\n }\n\n lines.push(` ${summaryLine(result)}`, \"\");\n return lines.join(\"\\n\");\n};\n\n/**\n * The machine-readable report. The `diagnostics` + `summary` shape matches\n * `blume validate --json` and `blume audit --json` exactly — anything parsing\n * those keeps working — with the eval run's own results alongside.\n */\nexport const evalReportJson = (\n result: EvalResult,\n root: string,\n threshold: number\n): string => {\n const diagnostics = result.diagnostics.map((diagnostic) =>\n diagnostic.file\n ? { ...diagnostic, file: relative(root, diagnostic.file) }\n : diagnostic\n );\n return `${JSON.stringify(\n {\n diagnostics,\n eval: {\n agent: result.agent,\n costUsd: result.costUsd,\n counts: result.counts,\n durationMs: result.durationMs,\n results: result.results,\n threshold,\n },\n summary: countBySeverity(result.diagnostics),\n },\n null,\n 2\n )}\\n`;\n};\n\n/**\n * Write the full JSON report where a `--fix` agent can read it — a file\n * rather than inline prompt text, because a long run's answers would exceed\n * the platform's argv limit.\n */\nexport const writeEvalReport = async (\n result: EvalResult,\n root: string,\n threshold: number\n): Promise<string> => {\n const dir = await mkdtemp(join(tmpdir(), \"blume-eval-\"));\n const path = join(dir, \"report.json\");\n await writeFile(path, evalReportJson(result, root, threshold));\n return path;\n};\n",
8
+ "import { mkdir, mkdtemp, writeFile } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\n\nimport { join } from \"pathe\";\n\nimport { buildMcpData } from \"../ai/mcp/data.ts\";\nimport { AGENTS } from \"../audit/agent.ts\";\nimport type { AgentKind } from \"../audit/agent.ts\";\nimport type { BlumeProject } from \"../core/project-graph.ts\";\nimport type { Diagnostic } from \"../core/types.ts\";\nimport {\n agentArgs,\n parseVerdict,\n readAgentOutput,\n runAgentHeadless,\n writeMcpConfig,\n} from \"./agents.ts\";\nimport type { HeadlessRunner } from \"./agents.ts\";\nimport { questionFinding, routeFindings } from \"./findings.ts\";\nimport { judgePrompt, readerPrompt } from \"./prompts.ts\";\nimport type { EvalQuestion, EvalsFile } from \"./schema.ts\";\n\n/** Reader runs search and read several pages; the judge grades one answer. */\nconst DEFAULT_READER_TIMEOUT_MS = 180_000;\nconst DEFAULT_JUDGE_TIMEOUT_MS = 60_000;\n\nexport type QuestionStatus = \"error\" | \"fail\" | \"pass\" | \"skip\";\n\n/** One question's outcome, carrying everything the reports print. */\nexport interface QuestionResult {\n answer?: string;\n costUsd?: number;\n /** Why the run errored (timeout, agent failure, unparseable verdict). */\n detail?: string;\n durationMs: number;\n expected: string[];\n id: string;\n missing: string[];\n notes?: string;\n question: string;\n routes: string[];\n score?: number;\n status: QuestionStatus;\n}\n\nexport interface EvalResult {\n agent: AgentKind;\n /** Total spend, when the agent CLI reports it (claude does, codex doesn't). */\n costUsd?: number;\n counts: Record<QuestionStatus, number>;\n diagnostics: Diagnostic[];\n durationMs: number;\n results: QuestionResult[];\n}\n\nexport type EvalProgress =\n | {\n kind: \"question-end\";\n index: number;\n result: QuestionResult;\n total: number;\n }\n | { kind: \"question-start\"; id: string; index: number; total: number };\n\nexport interface EvalRunOptions {\n agent: AgentKind;\n evals: EvalsFile;\n /** Where the evals file lives, for findings with no usable route hint. */\n evalsPath: string;\n judgeTimeoutMs?: number;\n onProgress?: (event: EvalProgress) => void;\n project: BlumeProject;\n /** The evals file's raw text, for line-anchoring findings. */\n rawEvals: string;\n readerTimeoutMs?: number;\n /** The spawn function — injectable so tests never launch a real agent. */\n run?: HeadlessRunner;\n}\n\ninterface QuestionContext {\n bin: string;\n dir: string;\n judgeTimeoutMs: number;\n kind: AgentKind;\n mcp: Awaited<ReturnType<typeof writeMcpConfig>>;\n readerTimeoutMs: number;\n run: HeadlessRunner;\n}\n\nconst errored = (\n question: EvalQuestion,\n detail: string,\n durationMs: number\n): QuestionResult => ({\n detail,\n durationMs,\n expected: question.expected,\n id: question.id,\n missing: [],\n question: question.question,\n routes: question.routes,\n status: \"error\",\n});\n\n/** Run one question: a fresh empty cwd, the reader, then the judge. */\nconst runQuestion = async (\n question: EvalQuestion,\n index: number,\n context: QuestionContext\n): Promise<QuestionResult> => {\n const started = performance.now();\n const elapsed = () => Math.round(performance.now() - started);\n\n // An empty working directory per invocation is the fresh-eyes guardrail:\n // even if a tool restriction slips, there is nothing here to read.\n const workDir = join(context.dir, `work-${index}`);\n await mkdir(workDir, { recursive: true });\n\n const answerPath = join(workDir, \"answer.txt\");\n const reader = await context.run(\n context.bin,\n agentArgs(context.kind, { lastMessagePath: answerPath, mcp: context.mcp }),\n {\n cwd: workDir,\n prompt: readerPrompt(question),\n timeoutMs: context.readerTimeoutMs,\n }\n );\n const answer = await readAgentOutput(context.kind, reader, answerPath);\n if (answer.isError) {\n return {\n ...errored(question, `reader ${answer.detail ?? \"failed\"}`, elapsed()),\n costUsd: answer.costUsd,\n };\n }\n\n const verdictPath = join(workDir, \"verdict.txt\");\n const judge = await context.run(\n context.bin,\n agentArgs(context.kind, { lastMessagePath: verdictPath }),\n {\n cwd: workDir,\n prompt: judgePrompt(question, answer.text),\n timeoutMs: context.judgeTimeoutMs,\n }\n );\n const graded = await readAgentOutput(context.kind, judge, verdictPath);\n const costUsd =\n answer.costUsd === undefined && graded.costUsd === undefined\n ? undefined\n : (answer.costUsd ?? 0) + (graded.costUsd ?? 0);\n if (graded.isError) {\n return {\n ...errored(question, `judge ${graded.detail ?? \"failed\"}`, elapsed()),\n answer: answer.text,\n costUsd,\n };\n }\n\n const verdict = parseVerdict(graded.text);\n if (!verdict) {\n return {\n ...errored(question, \"judge returned no parseable verdict\", elapsed()),\n answer: answer.text,\n costUsd,\n };\n }\n\n return {\n answer: answer.text,\n costUsd,\n durationMs: elapsed(),\n expected: question.expected,\n id: question.id,\n missing: verdict.missing,\n notes: verdict.notes || undefined,\n question: question.question,\n routes: question.routes,\n score: verdict.score,\n status: verdict.pass ? \"pass\" : \"fail\",\n };\n};\n\n/**\n * Run every question through the reader/judge pair, sequentially: each\n * question is already two agent sessions, and a serial run keeps progress\n * output ordered and cost attribution obvious.\n */\nexport const runEval = async (options: EvalRunOptions): Promise<EvalResult> => {\n const started = performance.now();\n const kind = options.agent;\n const run = options.run ?? runAgentHeadless;\n const anchor = { path: options.evalsPath, raw: options.rawEvals };\n\n const dir = await mkdtemp(join(tmpdir(), \"blume-eval-\"));\n const snapshotPath = join(dir, \"mcp-data.json\");\n await writeFile(\n snapshotPath,\n JSON.stringify(await buildMcpData(options.project))\n );\n const mcp = await writeMcpConfig(dir, snapshotPath);\n\n const context: QuestionContext = {\n bin: AGENTS[kind].bin,\n dir,\n judgeTimeoutMs: options.judgeTimeoutMs ?? DEFAULT_JUDGE_TIMEOUT_MS,\n kind,\n mcp,\n readerTimeoutMs: options.readerTimeoutMs ?? DEFAULT_READER_TIMEOUT_MS,\n run,\n };\n\n const diagnostics: Diagnostic[] = [];\n const results: QuestionResult[] = [];\n const { questions } = options.evals;\n\n for (const [index, question] of questions.entries()) {\n diagnostics.push(...routeFindings(question, options.project, anchor));\n\n if (question.skip) {\n results.push({\n durationMs: 0,\n expected: question.expected,\n id: question.id,\n missing: [],\n question: question.question,\n routes: question.routes,\n status: \"skip\",\n });\n continue;\n }\n\n options.onProgress?.({\n id: question.id,\n index,\n kind: \"question-start\",\n total: questions.length,\n });\n // Sequential by design: each question is already two agent sessions, and\n // a serial run keeps progress output ordered and cost attribution obvious.\n // oxlint-disable-next-line no-await-in-loop\n const result = await runQuestion(question, index, context);\n results.push(result);\n if (result.status === \"fail\" || result.status === \"error\") {\n diagnostics.push(\n questionFinding(\n question,\n {\n detail: result.detail,\n missing: result.missing,\n status: result.status,\n },\n options.project,\n anchor\n )\n );\n }\n options.onProgress?.({\n index,\n kind: \"question-end\",\n result,\n total: questions.length,\n });\n }\n\n const counts = {\n error: 0,\n fail: 0,\n pass: 0,\n skip: 0,\n } satisfies Record<QuestionStatus, number>;\n for (const result of results) {\n counts[result.status] += 1;\n }\n const costs = results.flatMap((result) =>\n result.costUsd === undefined ? [] : [result.costUsd]\n );\n\n return {\n agent: kind,\n costUsd:\n costs.length > 0\n ? costs.reduce((total, cost) => total + cost, 0)\n : undefined,\n counts,\n diagnostics,\n durationMs: Math.round(performance.now() - started),\n results,\n };\n};\n",
9
+ "import { readFile } from \"node:fs/promises\";\n\nimport { load } from \"js-yaml\";\nimport { z } from \"zod\";\n\nimport { YAML_SCHEMA } from \"../core/yaml.ts\";\n\n/** Question ids are kebab-case slugs so they read well in reports and CI logs. */\nconst ID_PATTERN = /^[a-z0-9][a-z0-9-]*$/u;\n\nconst questionSchema = z.strictObject({\n expected: z\n .array(z.string().min(1))\n .min(1, \"expected must list at least one fact\"),\n id: z\n .string()\n .regex(ID_PATTERN, \"id must be a kebab-case slug (a-z, 0-9, dashes)\"),\n question: z.string().min(1),\n routes: z\n .union([z.string(), z.array(z.string())])\n .default([])\n .transform((value) => (Array.isArray(value) ? value : [value])),\n severity: z.enum([\"error\", \"warning\"]).default(\"error\"),\n skip: z.boolean().default(false),\n});\n\n/** One author-written eval: a question plus the facts a passing answer states. */\nexport type EvalQuestion = z.infer<typeof questionSchema>;\n\nconst fullSchema = z.strictObject({\n questions: z.array(questionSchema).min(1),\n version: z.literal(1).default(1),\n});\n\n/**\n * The evals file schema. A bare top-level list of questions is accepted as\n * shorthand — `loadEvalsFile` wraps it before validating, rather than a\n * `z.union`, so schema errors name the offending field instead of collapsing\n * into an opaque \"invalid union\" issue.\n */\nexport const evalsFileSchema = fullSchema.superRefine((value, context) => {\n const seen = new Set<string>();\n for (const question of value.questions) {\n if (seen.has(question.id)) {\n context.addIssue({\n code: z.ZodIssueCode.custom,\n message: `duplicate question id \"${question.id}\"`,\n path: [\"questions\"],\n });\n }\n seen.add(question.id);\n }\n});\n\nexport type EvalsFile = z.infer<typeof evalsFileSchema>;\n\n/** A problem loading or validating the evals file, with the path it names. */\nexport class EvalsFileError extends Error {\n readonly path: string;\n\n constructor(path: string, message: string) {\n super(message);\n this.name = \"EvalsFileError\";\n this.path = path;\n }\n}\n\nconst describeIssues = (error: z.ZodError): string =>\n error.issues\n .map((issue) => {\n const at = issue.path.length > 0 ? ` at ${issue.path.join(\".\")}` : \"\";\n return `${issue.message}${at}`;\n })\n .join(\"; \");\n\n/**\n * Read and validate an evals file. Returns the parsed questions plus the raw\n * text, kept so findings can anchor to the line a question is defined on.\n */\nexport const loadEvalsFile = async (\n path: string\n): Promise<{ evals: EvalsFile; raw: string }> => {\n let raw: string;\n try {\n raw = await readFile(path, \"utf-8\");\n } catch {\n throw new EvalsFileError(\n path,\n `No evals file found at ${path}. Run \\`blume eval init\\` to draft one.`\n );\n }\n\n let parsed: unknown;\n try {\n parsed = load(raw, { schema: YAML_SCHEMA });\n } catch (error) {\n const detail = error instanceof Error ? error.message : String(error);\n throw new EvalsFileError(path, `Invalid YAML in ${path}: ${detail}`);\n }\n\n // The bare-list shorthand: a top-level sequence of questions.\n const candidate = Array.isArray(parsed) ? { questions: parsed } : parsed;\n const result = evalsFileSchema.safeParse(candidate);\n if (!result.success) {\n throw new EvalsFileError(\n path,\n `Invalid evals file at ${path}: ${describeIssues(result.error)}`\n );\n }\n return { evals: result.data, raw };\n};\n\n/**\n * The 1-based line where a question's `id:` entry appears in the raw evals\n * file, so a finding with no route hint can still point somewhere editable.\n */\nexport const locateQuestion = (raw: string, id: string): number | undefined => {\n const pattern = new RegExp(`^\\\\s*-?\\\\s*id:\\\\s*[\"']?${id}[\"']?\\\\s*$`, \"u\");\n const lines = raw.split(\"\\n\");\n for (const [index, line] of lines.entries()) {\n if (pattern.test(line)) {\n return index + 1;\n }\n }\n return undefined;\n};\n",
10
+ "import type { BlumeProject } from \"../core/project-graph.ts\";\nimport type { Diagnostic } from \"../core/types.ts\";\nimport { locateQuestion } from \"./schema.ts\";\nimport type { EvalQuestion } from \"./schema.ts\";\n\nconst DOCS_URL = \"https://useblume.dev/docs/cli/evals\";\n\n/** Where a finding should anchor when no route hint matches a page. */\nexport interface EvalsAnchor {\n path: string;\n raw: string;\n}\n\n/** The manifest route a hint names, if any. */\nconst hintedRoute = (question: EvalQuestion, project: BlumeProject) => {\n for (const hint of question.routes) {\n const route = project.manifest.routes.find(\n (candidate) => candidate.path === hint\n );\n if (route) {\n return route;\n }\n }\n};\n\n/**\n * Warnings for route hints that name no manifest route — docs move, and a\n * finding that silently anchors to the evals file instead of the page it\n * used to name is a debugging session; a warning is a one-line fix.\n */\nexport const routeFindings = (\n question: EvalQuestion,\n project: BlumeProject,\n anchor: EvalsAnchor\n): Diagnostic[] => {\n const known = new Set(project.manifest.routes.map((route) => route.path));\n return question.routes\n .filter((hint) => !known.has(hint))\n .map((hint) => ({\n code: \"BLUME_EVAL_ROUTE_UNKNOWN\",\n docsUrl: DOCS_URL,\n file: anchor.path,\n line: locateQuestion(anchor.raw, question.id),\n message: `Question \"${question.id}\" hints at route \"${hint}\", which matches no page.`,\n severity: \"warning\" as const,\n suggestion:\n \"Update the question's `routes` to the page's current route, or remove the hint.\",\n }));\n};\n\n/** What the finding needs to know about how the question went. */\nexport interface QuestionOutcome {\n /** Why the run errored, when it did. */\n detail?: string;\n /** The expected facts the judge found absent or contradicted. */\n missing: string[];\n status: \"error\" | \"fail\";\n}\n\n/**\n * The diagnostic for a failed or errored question. A failure is anchored to\n * the page that should have answered it (via the first matching route hint)\n * or, failing that, to the question's line in the evals file. An errored run —\n * the agent crashed, timed out, or answered in a shape Blume couldn't read —\n * says nothing about the docs, so it always points at the question instead of\n * a page there's nothing to fix in.\n */\nexport const questionFinding = (\n question: EvalQuestion,\n outcome: QuestionOutcome,\n project: BlumeProject,\n anchor: EvalsAnchor\n): Diagnostic => {\n const questionSite = {\n file: anchor.path,\n line: locateQuestion(anchor.raw, question.id),\n };\n\n if (outcome.status === \"error\") {\n return {\n code: \"BLUME_EVAL_QUESTION_ERROR\",\n docsUrl: DOCS_URL,\n message: `The agent run failed for \"${question.question}\"${\n outcome.detail ? ` — ${outcome.detail}` : \"\"\n }, so the docs weren't graded.`,\n severity: question.severity,\n suggestion:\n \"Rerun `blume eval`; if it persists, check the agent CLI installation and the failure detail.\",\n ...questionSite,\n };\n }\n\n const route = hintedRoute(question, project);\n const site = route\n ? { file: route.sourcePath, url: route.path }\n : questionSite;\n\n const missing =\n outcome.missing.length > 0\n ? ` — missing: ${outcome.missing.join(\"; \")}`\n : \"\";\n return {\n code: \"BLUME_EVAL_QUESTION_FAILED\",\n docsUrl: DOCS_URL,\n message: `Docs could not answer: \"${question.question}\"${missing}`,\n severity: question.severity,\n suggestion:\n \"State the missing facts on this page, then rerun `blume eval`.\",\n ...site,\n };\n};\n"
11
+ ],
12
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA,iBAAS;;;ACKF,IAAM,eAAe,CAAC,aAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAQU,SAAS;AAAA;AAAA;AAKd,IAAM,cAAc,CAAC,UAAwB,WAA2B;AAAA,EAC7E,MAAM,QAAQ,SAAS,SAAS,IAAI,CAAC,SAAS,KAAK,MAAM,EAAE,KAAK;AAAA,CAAI;AAAA,EACpE,OAAO;AAAA;AAAA,YAEG,SAAS;AAAA;AAAA;AAAA,EAGnB;AAAA;AAAA;AAAA;AAAA,EAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUK,IAAM,gBAAgB,CAAC,eAC5B;AAAA;AAAA,wBAEsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUjB,IAAM,aAAa,CAAC,cACzB;AAAA;AAAA,gEAE8D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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