blume 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -0
- package/CHANGELOG.md +113 -0
- package/README.md +1 -1
- package/dist/cli/{chunk-6k4ftwze.js → chunk-0gz36akr.js} +18 -2
- package/dist/cli/{chunk-6k4ftwze.js.map → chunk-0gz36akr.js.map} +3 -3
- package/dist/cli/{chunk-zp79m0ts.js → chunk-1n228xqb.js} +2 -2
- package/dist/cli/{chunk-ddndchfr.js → chunk-2f3ndkpw.js} +57 -29
- package/dist/cli/chunk-2f3ndkpw.js.map +14 -0
- package/dist/cli/{chunk-fsmrqk8a.js → chunk-2f7n4qzt.js} +8 -2
- package/dist/cli/{chunk-fsmrqk8a.js.map → chunk-2f7n4qzt.js.map} +3 -3
- package/dist/cli/{chunk-ppzjqwx2.js → chunk-2n4ps1b3.js} +17 -18
- package/dist/cli/{chunk-ppzjqwx2.js.map → chunk-2n4ps1b3.js.map} +3 -3
- package/dist/cli/{chunk-5r8g91qn.js → chunk-43zcf4gz.js} +398 -159
- package/dist/cli/chunk-43zcf4gz.js.map +36 -0
- package/dist/cli/chunk-4ejxbzee.js +39 -0
- package/dist/cli/chunk-4ejxbzee.js.map +10 -0
- package/dist/cli/{chunk-hr8ne106.js → chunk-4h8z9vv5.js} +296 -77
- package/dist/cli/chunk-4h8z9vv5.js.map +16 -0
- package/dist/cli/{chunk-k7pj68a8.js → chunk-5cg2rzgf.js} +18 -16
- package/dist/cli/{chunk-k7pj68a8.js.map → chunk-5cg2rzgf.js.map} +2 -2
- package/dist/cli/{chunk-h2ez8dzb.js → chunk-5ffywsmb.js} +4 -4
- package/dist/cli/{chunk-g698a744.js → chunk-5wj2qwn2.js} +5 -5
- package/dist/cli/chunk-6bm0xpgd.js +18 -0
- package/dist/cli/chunk-6bm0xpgd.js.map +10 -0
- package/dist/cli/{chunk-3yce002v.js → chunk-713mngdq.js} +15 -8
- package/dist/cli/chunk-713mngdq.js.map +14 -0
- package/dist/cli/{chunk-91ws1n6j.js → chunk-9geymqns.js} +17 -15
- package/dist/cli/{chunk-91ws1n6j.js.map → chunk-9geymqns.js.map} +2 -2
- package/dist/cli/{chunk-6dtt0zfn.js → chunk-9xr4dgee.js} +27 -18
- package/dist/cli/chunk-9xr4dgee.js.map +10 -0
- package/dist/cli/{chunk-sqw4ekg1.js → chunk-amrb6hgh.js} +2 -2
- package/dist/cli/chunk-cm89scdv.js +443 -0
- package/dist/cli/chunk-cm89scdv.js.map +11 -0
- package/dist/cli/{chunk-wdrt2k2v.js → chunk-cmtcnh9f.js} +90 -26
- package/dist/cli/chunk-cmtcnh9f.js.map +10 -0
- package/dist/cli/chunk-cy5bm0j0.js +104 -0
- package/dist/cli/chunk-cy5bm0j0.js.map +11 -0
- package/dist/cli/{chunk-7mbqtmgb.js → chunk-e7vvk5ya.js} +21 -12
- package/dist/cli/chunk-e7vvk5ya.js.map +10 -0
- package/dist/cli/{chunk-qkb5a8sa.js → chunk-g2z9x01v.js} +6 -98
- package/dist/cli/chunk-g2z9x01v.js.map +10 -0
- package/dist/cli/{chunk-273ygyr4.js → chunk-ga0pf4aj.js} +7 -7
- package/dist/cli/{chunk-273ygyr4.js.map → chunk-ga0pf4aj.js.map} +3 -3
- package/dist/cli/{chunk-h7k3nq3v.js → chunk-gp84za0h.js} +2 -2
- package/dist/cli/{chunk-hqp2ajnh.js → chunk-h2a48yhd.js} +195 -73
- package/dist/cli/chunk-h2a48yhd.js.map +36 -0
- package/dist/cli/{chunk-pbg5a4s3.js → chunk-jnwj5kjj.js} +71 -47
- package/dist/cli/chunk-jnwj5kjj.js.map +19 -0
- package/dist/cli/chunk-kwrg63tm.js +31 -0
- package/dist/cli/chunk-kwrg63tm.js.map +10 -0
- package/dist/cli/{chunk-8g8ytmgx.js → chunk-nd1821sk.js} +21 -19
- package/dist/cli/{chunk-8g8ytmgx.js.map → chunk-nd1821sk.js.map} +2 -2
- package/dist/cli/{chunk-w4bxdvsa.js → chunk-ntv4qrt7.js} +17 -15
- package/dist/cli/{chunk-w4bxdvsa.js.map → chunk-ntv4qrt7.js.map} +2 -2
- package/dist/cli/{chunk-bfwp9vp6.js → chunk-p804f3pe.js} +7 -7
- package/dist/cli/{chunk-4e9b9ra6.js → chunk-py62fewh.js} +6 -6
- package/dist/cli/{chunk-4e9b9ra6.js.map → chunk-py62fewh.js.map} +1 -1
- package/dist/cli/chunk-q3wxxq39.js +126 -0
- package/dist/cli/chunk-q3wxxq39.js.map +11 -0
- package/dist/cli/{chunk-j85scx15.js → chunk-rekqz4qg.js} +142 -46
- package/dist/cli/chunk-rekqz4qg.js.map +10 -0
- package/dist/cli/{chunk-00gs3wqs.js → chunk-ta27feev.js} +1 -1
- package/dist/cli/{chunk-v6ya5kcb.js → chunk-xkz5xbtv.js} +4031 -1132
- package/dist/cli/chunk-xkz5xbtv.js.map +213 -0
- package/dist/cli/{chunk-bbnwccaz.js → chunk-y4ykbark.js} +2 -2
- package/dist/cli/{chunk-n1yg3tj3.js → chunk-y5h4r2y0.js} +6 -6
- package/dist/cli/{chunk-n1yg3tj3.js.map → chunk-y5h4r2y0.js.map} +3 -3
- package/dist/cli/{chunk-nfcyttvj.js → chunk-yj17vs39.js} +9 -9
- package/dist/cli/{chunk-nfcyttvj.js.map → chunk-yj17vs39.js.map} +1 -1
- package/dist/cli/{chunk-7vtckvaw.js → chunk-yxmk4pec.js} +16 -14
- package/dist/cli/{chunk-7vtckvaw.js.map → chunk-yxmk4pec.js.map} +2 -2
- package/dist/cli/{chunk-gs7r695n.js → chunk-zccbjcj0.js} +22 -8
- package/dist/cli/{chunk-gs7r695n.js.map → chunk-zccbjcj0.js.map} +3 -3
- package/dist/cli/{chunk-xh43dwgw.js → chunk-zf748avv.js} +415 -225
- package/dist/cli/chunk-zf748avv.js.map +37 -0
- package/dist/cli/{chunk-d1v5rhy0.js → chunk-zhvd6adm.js} +16 -14
- package/dist/cli/{chunk-d1v5rhy0.js.map → chunk-zhvd6adm.js.map} +2 -2
- package/dist/cli/index.js +28 -20
- package/dist/cli/index.js.map +5 -5
- package/dist/types/ai/agent-surface.d.ts +8 -7
- package/dist/types/ai/ai-catalog.d.ts +7 -0
- package/dist/types/ai/ask-context.d.ts +22 -0
- package/dist/types/ai/ask.d.ts +271 -58
- package/dist/types/ai/index.d.ts +2 -2
- package/dist/types/ai/link-headers.d.ts +8 -1
- package/dist/types/ai/openapi-components.d.ts +5 -2
- package/dist/types/ai/relative-links.d.ts +9 -7
- package/dist/types/ai/site-skill.d.ts +26 -0
- package/dist/types/ai/skills.d.ts +20 -1
- package/dist/types/ai/tar.d.ts +1 -3
- package/dist/types/analytics/index.d.ts +2 -0
- package/dist/types/analytics/one-dollar-stats.d.ts +48 -0
- package/dist/types/analytics/schema.d.ts +14 -0
- package/dist/types/astro/integration.d.ts +11 -2
- package/dist/types/captcha/hcaptcha.d.ts +27 -0
- package/dist/types/captcha/index.d.ts +28 -0
- package/dist/types/captcha/schema.d.ts +29 -0
- package/dist/types/captcha/turnstile.d.ts +28 -0
- package/dist/types/components/content/api-field.d.ts +59 -0
- package/dist/types/components/content/api-page.d.ts +95 -0
- package/dist/types/components/layout/nav-utils.d.ts +26 -0
- package/dist/types/components/openapi/helpers.d.ts +137 -0
- package/dist/types/components/openapi/security.d.ts +85 -0
- package/dist/types/consent/ethyca.d.ts +48 -0
- package/dist/types/consent/index.d.ts +37 -0
- package/dist/types/consent/native.d.ts +28 -0
- package/dist/types/consent/osano.d.ts +42 -0
- package/dist/types/consent/schema.d.ts +110 -0
- package/dist/types/core/base-path.d.ts +21 -7
- package/dist/types/core/config-input.d.ts +196 -27
- package/dist/types/core/data.d.ts +49 -4
- package/dist/types/core/directive-diagnostics.d.ts +12 -0
- package/dist/types/core/footer.d.ts +8 -0
- package/dist/types/core/heading-markers.d.ts +5 -7
- package/dist/types/core/i18n-ui.d.ts +86 -0
- package/dist/types/core/i18n.d.ts +2 -0
- package/dist/types/core/includes.d.ts +8 -2
- package/dist/types/core/last-modified.d.ts +10 -0
- package/dist/types/core/localizable.d.ts +7 -0
- package/dist/types/core/meta.d.ts +8 -0
- package/dist/types/core/page-modes.d.ts +29 -0
- package/dist/types/core/redirect-patterns.d.ts +144 -0
- package/dist/types/core/related.d.ts +40 -0
- package/dist/types/core/schema.d.ts +558 -56
- package/dist/types/core/sources/lower.d.ts +29 -16
- package/dist/types/core/sources/normalize.d.ts +13 -1
- package/dist/types/core/sources/read.d.ts +5 -0
- package/dist/types/core/sources/watch.d.ts +12 -5
- package/dist/types/core/standard-schema.d.ts +5 -0
- package/dist/types/core/types.d.ts +1 -1
- package/dist/types/core/variables.d.ts +42 -0
- package/dist/types/deploy/artifacts.d.ts +6 -4
- package/dist/types/deploy/headers.d.ts +5 -0
- package/dist/types/deploy/node-headers.d.ts +13 -2
- package/dist/types/deploy/platforms/cloudflare.d.ts +5 -0
- package/dist/types/deploy/platforms/netlify.d.ts +7 -0
- package/dist/types/deploy/platforms/types.d.ts +8 -0
- package/dist/types/deploy/platforms/vercel.d.ts +6 -0
- package/dist/types/deploy/redirects.d.ts +61 -22
- package/dist/types/deploy/vercel-negotiation.d.ts +9 -0
- package/dist/types/markdown/code-title.d.ts +17 -0
- package/dist/types/markdown/directives.d.ts +62 -0
- package/dist/types/markdown/features.d.ts +24 -2
- package/dist/types/markdown/mdast.d.ts +63 -0
- package/dist/types/narration/build.d.ts +70 -0
- package/dist/types/narration/provider.d.ts +26 -0
- package/dist/types/narration/script.d.ts +154 -0
- package/dist/types/openapi/asyncapi.d.ts +4 -2
- package/dist/types/openapi/model.d.ts +12 -6
- package/dist/types/openapi/overlay.d.ts +54 -0
- package/dist/types/openapi/parse.d.ts +13 -0
- package/dist/types/openapi/references.d.ts +14 -4
- package/dist/types/ratelimit/cloudflare.d.ts +39 -0
- package/dist/types/ratelimit/index.d.ts +27 -0
- package/dist/types/ratelimit/memory.d.ts +36 -0
- package/dist/types/ratelimit/schema.d.ts +111 -0
- package/dist/types/ratelimit/upstash.d.ts +21 -0
- package/dist/types/ratelimit/wrangler.d.ts +23 -0
- package/dist/types/reference/asyncapi.d.ts +10 -10
- package/dist/types/reference/graphql.d.ts +13 -10
- package/dist/types/reference/openapi.d.ts +33 -12
- package/dist/types/reference/options.d.ts +45 -5
- package/dist/types/reference/scalar.d.ts +13 -0
- package/dist/types/reference/schema.d.ts +60 -36
- package/dist/types/search/documents.d.ts +12 -1
- package/dist/types/search/orama-index.d.ts +4 -0
- package/dist/types/seo/metatags.d.ts +20 -0
- package/docs/02-deployment.mdx +44 -6
- package/docs/03-upgrading.mdx +4 -4
- package/docs/04-migrating.mdx +1 -1
- package/docs/08-faq.mdx +1 -1
- package/docs/advanced/changelog.mdx +2 -2
- package/docs/advanced/custom-pages.mdx +3 -3
- package/docs/advanced/skills.mdx +14 -0
- package/docs/cli/audit.mdx +38 -2
- package/docs/cli/evals.mdx +3 -3
- package/docs/cli/index.mdx +1 -0
- package/docs/cli/translate.mdx +3 -3
- package/docs/cli/version.mdx +1 -1
- package/docs/configuration/analytics.mdx +22 -1
- package/docs/configuration/assistant.mdx +188 -36
- package/docs/configuration/consent.mdx +100 -0
- package/docs/configuration/customization.mdx +6 -4
- package/docs/configuration/index.mdx +63 -5
- package/docs/configuration/meta.ts +3 -0
- package/docs/configuration/narration.mdx +119 -0
- package/docs/configuration/rate-limiting.mdx +69 -0
- package/docs/configuration/search.mdx +30 -2
- package/docs/configuration/theming.mdx +3 -1
- package/docs/content/components.mdx +107 -1
- package/docs/content/frontmatter.mdx +77 -1
- package/docs/content/i18n.mdx +40 -3
- package/docs/content/includes.mdx +16 -0
- package/docs/content/index.mdx +4 -2
- package/docs/content/islands.mdx +1 -1
- package/docs/content/meta.mdx +4 -1
- package/docs/content/meta.ts +1 -0
- package/docs/content/navigation.mdx +28 -6
- package/docs/content/sources/contentful.mdx +32 -0
- package/docs/content/sources/custom.mdx +39 -0
- package/docs/content/sources/github-releases.mdx +31 -0
- package/docs/content/sources/index.mdx +91 -0
- package/docs/content/sources/meta.ts +16 -0
- package/docs/content/sources/notion.mdx +32 -0
- package/docs/content/sources/obsidian.mdx +37 -0
- package/docs/content/sources/payload.mdx +30 -0
- package/docs/content/sources/remote-mdx.mdx +40 -0
- package/docs/content/sources/sanity.mdx +29 -0
- package/docs/content/sources/strapi.mdx +31 -0
- package/docs/content/syntax.mdx +81 -2
- package/docs/content/variables.mdx +41 -0
- package/docs/content/versioning.mdx +1 -1
- package/docs/discoverability/agent-discovery.mdx +30 -3
- package/docs/discoverability/index.mdx +3 -2
- package/docs/discoverability/llms-txt.mdx +1 -1
- package/docs/discoverability/markdown.mdx +2 -2
- package/docs/discoverability/metadata.mdx +17 -0
- package/docs/discoverability/open-graph.mdx +5 -3
- package/docs/discoverability/rss.mdx +1 -1
- package/docs/references/api-pages.mdx +74 -0
- package/docs/references/asyncapi.mdx +2 -2
- package/docs/references/graphql.mdx +3 -3
- package/docs/references/meta.ts +1 -1
- package/docs/references/openapi.mdx +106 -5
- package/docs/references/scalar.mdx +3 -1
- package/package.json +36 -1
- package/skills/blume/SKILL.md +3 -0
- package/skills/blume-migrate/SKILL.md +5 -5
- package/skills/blume-migrate/references/docusaurus.md +3 -3
- package/skills/blume-migrate/references/fumadocs.md +1 -1
- package/skills/blume-migrate/references/mintlify.md +37 -19
- package/skills/blume-migrate/references/nextra.md +3 -3
- package/skills/blume-migrate/references/starlight.md +2 -1
- package/skills/blume-migrate/scripts/mintlify-codemod.mjs +67 -16
- package/skills/blume-write-skill/SKILL.md +82 -0
- package/src/ai/agent-readability.ts +4 -3
- package/src/ai/agent-surface.ts +9 -7
- package/src/ai/ai-catalog.ts +12 -5
- package/src/ai/api/handlers.ts +2 -2
- package/src/ai/api/spec.ts +2 -2
- package/src/ai/api-catalog.ts +6 -2
- package/src/ai/ask-context.ts +73 -20
- package/src/ai/ask-data.ts +6 -0
- package/src/ai/ask-tools.ts +142 -0
- package/src/ai/ask.ts +354 -76
- package/src/ai/changelog-markdown.ts +2 -2
- package/src/ai/component-markdown.ts +75 -0
- package/src/ai/cors.ts +2 -0
- package/src/ai/index.ts +12 -0
- package/src/ai/link-headers.ts +14 -5
- package/src/ai/llms.ts +24 -9
- package/src/ai/markdown.ts +2 -1
- package/src/ai/mcp/data.ts +6 -0
- package/src/ai/mcp/discovery.ts +2 -2
- package/src/ai/mcp/query.ts +2 -2
- package/src/ai/mcp/server.ts +2 -2
- package/src/ai/openapi-components.ts +31 -9
- package/src/ai/relative-links.ts +42 -26
- package/src/ai/serializers.ts +2 -1
- package/src/ai/site-skill.ts +274 -0
- package/src/ai/skills.ts +49 -3
- package/src/ai/tar.ts +139 -12
- package/src/ai/write-skill.ts +97 -0
- package/src/analytics/head.ts +4 -0
- package/src/analytics/index.ts +5 -0
- package/src/analytics/one-dollar-stats.ts +86 -0
- package/src/analytics/schema.ts +2 -0
- package/src/astro/generate.ts +133 -19
- package/src/astro/include-hmr.ts +31 -12
- package/src/astro/include-refresh.ts +19 -8
- package/src/astro/index.ts +1 -0
- package/src/astro/integration.ts +143 -14
- package/src/astro/module-types.ts +6 -0
- package/src/astro/runtime-modules.ts +28 -13
- package/src/astro/templates.ts +364 -67
- package/src/astro/variables.ts +31 -0
- package/src/audit/catalog.ts +19 -0
- package/src/audit/checks/contrast.ts +183 -0
- package/src/audit/checks/i18n.ts +2 -3
- package/src/audit/checks/indexability.ts +2 -3
- package/src/audit/checks/links.ts +13 -13
- package/src/audit/checks/sitemap.ts +2 -3
- package/src/audit/graph.ts +3 -1
- package/src/audit/redirects.ts +46 -15
- package/src/audit/run.ts +14 -9
- package/src/audit/snapshot.ts +5 -0
- package/src/audit/types.ts +2 -1
- package/src/blume-modules.d.ts +7 -0
- package/src/captcha/client.ts +152 -0
- package/src/captcha/hcaptcha.ts +36 -0
- package/src/captcha/index.ts +28 -0
- package/src/captcha/schema.ts +32 -0
- package/src/captcha/turnstile.ts +38 -0
- package/src/captcha/verify.ts +71 -0
- package/src/cli/args.ts +32 -0
- package/src/cli/command-meta.ts +5 -0
- package/src/cli/commands/audit.ts +4 -1
- package/src/cli/commands/doctor.ts +25 -17
- package/src/cli/commands/eval.ts +19 -11
- package/src/cli/commands/skill.ts +96 -0
- package/src/cli/commands/translate.ts +9 -12
- package/src/cli/commands/validate.ts +3 -1
- package/src/cli/dev-lock.ts +157 -37
- package/src/cli/index.ts +5 -0
- package/src/cli/report-format.ts +11 -6
- package/src/cli/required-secrets.ts +71 -29
- package/src/components/BlumePage.astro +2 -0
- package/src/components/colors.ts +19 -0
- package/src/components/content/ApiEndpoint.astro +18 -0
- package/src/components/content/ApiField.astro +79 -0
- package/src/components/content/ApiPlayground.astro +62 -0
- package/src/components/content/ApiRail.astro +19 -0
- package/src/components/content/Badge.astro +5 -3
- package/src/components/content/Color.astro +1 -0
- package/src/components/content/Component.astro +2 -2
- package/src/components/content/FileTree.astro +1 -0
- package/src/components/content/GithubInfo.astro +1 -0
- package/src/components/content/Panel.astro +1 -0
- package/src/components/content/ParamField.astro +25 -0
- package/src/components/content/RequestExample.astro +17 -0
- package/src/components/content/ResponseExample.astro +17 -0
- package/src/components/content/ResponseField.astro +32 -0
- package/src/components/content/Step.astro +1 -0
- package/src/components/content/Tab.astro +0 -1
- package/src/components/content/Tabs.astro +4 -0
- package/src/components/content/Tile.astro +1 -0
- package/src/components/content/Tooltip.astro +1 -0
- package/src/components/content/Tree.astro +1 -0
- package/src/components/content/TypeTable.astro +4 -1
- package/src/components/content/View.astro +21 -0
- package/src/components/content/ViewSwitcher.astro +168 -0
- package/src/components/content/api-field.ts +100 -0
- package/src/components/content/api-page.ts +224 -0
- package/src/components/content/badge-color.ts +5 -2
- package/src/components/content/base-href.ts +13 -36
- package/src/components/content/view-switcher.ts +71 -0
- package/src/components/index.ts +2 -0
- package/src/components/islands/Assistant.astro +10 -1
- package/src/components/islands/assistant.tsx +125 -18
- package/src/components/islands/base-path.ts +47 -10
- package/src/components/islands/code-question.ts +62 -0
- package/src/components/islands/hooks.ts +145 -40
- package/src/components/islands/support-link.ts +68 -0
- package/src/components/islands/webmcp.ts +4 -2
- package/src/components/layout/Analytics.astro +11 -2
- package/src/components/layout/Banner.astro +14 -10
- package/src/components/layout/Breadcrumbs.astro +11 -4
- package/src/components/layout/ConsentBanner.astro +62 -0
- package/src/components/layout/ConsentHead.astro +38 -0
- package/src/components/layout/Directory.astro +94 -0
- package/src/components/layout/DiscoveryLinks.astro +9 -5
- package/src/components/layout/DrawerSwitchers.astro +51 -0
- package/src/components/layout/Empty.astro +2 -2
- package/src/components/layout/Header.astro +124 -82
- package/src/components/layout/LanguageSwitcher.astro +50 -17
- package/src/components/layout/NarrationPlayer.astro +1085 -0
- package/src/components/layout/NavSelector.astro +35 -9
- package/src/components/layout/NavTabMenu.astro +3 -3
- package/src/components/layout/NavTree.astro +16 -6
- package/src/components/layout/PageActions.astro +4 -3
- package/src/components/layout/PageFeedback.astro +54 -49
- package/src/components/layout/PageLayout.astro +78 -9
- package/src/components/layout/Pagination.astro +3 -3
- package/src/components/layout/ReferenceLayout.astro +17 -6
- package/src/components/layout/RelatedPages.astro +42 -0
- package/src/components/layout/RootLayout.astro +313 -50
- package/src/components/layout/Search.astro +64 -30
- package/src/components/layout/SiteFooter.astro +124 -0
- package/src/components/layout/SiteMetatags.astro +16 -0
- package/src/components/layout/VersionBanner.astro +2 -2
- package/src/components/layout/analytics-client.ts +12 -0
- package/src/components/layout/consent/native.ts +79 -0
- package/src/components/layout/consent/types.ts +37 -0
- package/src/components/layout/footer-links.ts +53 -0
- package/src/components/layout/footer-socials.ts +87 -0
- package/src/components/layout/locale-redirect.ts +107 -0
- package/src/components/layout/nav-utils.ts +83 -0
- package/src/components/layout/page-feedback.ts +96 -0
- package/src/components/layout/search/analytics.ts +98 -0
- package/src/components/layout/search/flexsearch.ts +17 -5
- package/src/components/layout/search/orama-cloud.ts +26 -14
- package/src/components/layout/search/types.ts +20 -0
- package/src/components/layout/search/typesense.ts +5 -1
- package/src/components/layout/toc-active.ts +41 -0
- package/src/components/layout/toc-element.ts +8 -14
- package/src/components/openapi/ApiTagOperations.astro +2 -2
- package/src/components/openapi/AsyncApiOperation.astro +7 -4
- package/src/components/openapi/GraphqlChip.astro +2 -2
- package/src/components/openapi/Operation.astro +163 -13
- package/src/components/openapi/Playground.astro +4 -4
- package/src/components/openapi/RequestBody.astro +6 -4
- package/src/components/openapi/RequestPanel.astro +63 -8
- package/src/components/openapi/Responses.astro +6 -4
- package/src/components/openapi/SchemaTable.astro +7 -0
- package/src/components/openapi/async-snippets.ts +4 -4
- package/src/components/openapi/async.ts +38 -6
- package/src/components/openapi/code-samples.ts +97 -0
- package/src/components/openapi/helpers.ts +19 -9
- package/src/components/openapi/message-composer.ts +6 -1
- package/src/components/openapi/message.ts +17 -2
- package/src/components/openapi/operation-model.ts +81 -11
- package/src/components/openapi/panel.ts +4 -2
- package/src/components/openapi/param-style.ts +181 -0
- package/src/components/openapi/playground-client.ts +73 -16
- package/src/components/openapi/request.ts +190 -26
- package/src/components/openapi/schema-tree.ts +30 -24
- package/src/components/openapi/security.ts +6 -3
- package/src/components/openapi/snippets.ts +953 -13
- package/src/components/openapi/ws-client.ts +18 -2
- package/src/components/props.ts +6 -0
- package/src/consent/client.ts +95 -0
- package/src/consent/clients.ts +19 -0
- package/src/consent/ethyca.ts +71 -0
- package/src/consent/head.ts +24 -0
- package/src/consent/index.ts +37 -0
- package/src/consent/init.ts +29 -0
- package/src/consent/native.ts +36 -0
- package/src/consent/osano.ts +59 -0
- package/src/consent/schema.ts +30 -0
- package/src/core/base-path.ts +62 -16
- package/src/core/builtin-tags.ts +5 -0
- package/src/core/client-address.ts +19 -0
- package/src/core/config-input.ts +203 -27
- package/src/core/data.ts +44 -4
- package/src/core/diagnostics.ts +5 -2
- package/src/core/directive-diagnostics.ts +99 -0
- package/src/core/footer.ts +26 -0
- package/src/core/frontmatter.ts +21 -18
- package/src/core/graph.ts +39 -36
- package/src/core/heading-markers.ts +5 -18
- package/src/core/i18n-ui.ts +82 -2
- package/src/core/i18n.ts +31 -3
- package/src/core/includes.ts +20 -3
- package/src/core/last-modified.ts +25 -3
- package/src/core/links.ts +16 -2
- package/src/core/locale-links.ts +5 -1
- package/src/core/localizable.ts +26 -0
- package/src/core/meta.ts +33 -19
- package/src/core/navigation.ts +71 -20
- package/src/core/page-modes.ts +56 -0
- package/src/core/project-graph.ts +138 -10
- package/src/core/redirect-patterns.ts +491 -0
- package/src/core/related.ts +131 -0
- package/src/core/schema.ts +342 -68
- package/src/core/sources/contentful-rich-text.ts +27 -20
- package/src/core/sources/filesystem.ts +20 -2
- package/src/core/sources/github-releases.ts +25 -6
- package/src/core/sources/lexical.ts +23 -18
- package/src/core/sources/lower.ts +201 -34
- package/src/core/sources/mdx-remote.ts +51 -16
- package/src/core/sources/normalize.ts +327 -91
- package/src/core/sources/notion.ts +52 -25
- package/src/core/sources/obsidian.ts +23 -6
- package/src/core/sources/portable-text.ts +38 -21
- package/src/core/sources/read.ts +8 -3
- package/src/core/sources/strapi-blocks.ts +20 -16
- package/src/core/sources/watch.ts +20 -7
- package/src/core/standard-schema.ts +10 -6
- package/src/core/types.ts +1 -1
- package/src/core/ui-packs/ar.ts +43 -0
- package/src/core/ui-packs/bg.ts +45 -0
- package/src/core/ui-packs/bn.ts +43 -0
- package/src/core/ui-packs/ca.ts +46 -0
- package/src/core/ui-packs/cs.ts +44 -0
- package/src/core/ui-packs/da.ts +45 -0
- package/src/core/ui-packs/de.ts +46 -0
- package/src/core/ui-packs/el.ts +45 -0
- package/src/core/ui-packs/es.ts +46 -0
- package/src/core/ui-packs/fa.ts +45 -0
- package/src/core/ui-packs/fi.ts +45 -0
- package/src/core/ui-packs/fr.ts +46 -0
- package/src/core/ui-packs/he.ts +43 -0
- package/src/core/ui-packs/hi.ts +44 -0
- package/src/core/ui-packs/hr.ts +45 -0
- package/src/core/ui-packs/hu.ts +44 -0
- package/src/core/ui-packs/id.ts +45 -0
- package/src/core/ui-packs/it.ts +45 -0
- package/src/core/ui-packs/ja.ts +45 -0
- package/src/core/ui-packs/ko.ts +44 -0
- package/src/core/ui-packs/nl.ts +46 -0
- package/src/core/ui-packs/no.ts +44 -0
- package/src/core/ui-packs/pl.ts +45 -0
- package/src/core/ui-packs/pt-br.ts +46 -0
- package/src/core/ui-packs/pt.ts +45 -0
- package/src/core/ui-packs/ro.ts +45 -0
- package/src/core/ui-packs/ru.ts +45 -0
- package/src/core/ui-packs/sk.ts +44 -0
- package/src/core/ui-packs/sr.ts +45 -0
- package/src/core/ui-packs/sv.ts +44 -0
- package/src/core/ui-packs/th.ts +43 -0
- package/src/core/ui-packs/tr.ts +45 -0
- package/src/core/ui-packs/uk.ts +45 -0
- package/src/core/ui-packs/vi.ts +45 -0
- package/src/core/ui-packs/zh-tw.ts +43 -0
- package/src/core/ui-packs/zh.ts +43 -0
- package/src/core/variables.ts +103 -0
- package/src/core/version-cut.ts +52 -15
- package/src/deploy/artifacts.ts +104 -14
- package/src/deploy/cloudflare-negotiation.ts +39 -17
- package/src/deploy/headers.ts +10 -5
- package/src/deploy/node-headers.ts +64 -10
- package/src/deploy/platforms/cloudflare.ts +44 -3
- package/src/deploy/platforms/netlify.ts +34 -1
- package/src/deploy/platforms/node.ts +1 -0
- package/src/deploy/platforms/static.ts +1 -0
- package/src/deploy/platforms/types.ts +8 -0
- package/src/deploy/platforms/vercel.ts +38 -2
- package/src/deploy/redirects.ts +139 -36
- package/src/deploy/robots.ts +2 -2
- package/src/deploy/rss.ts +4 -3
- package/src/deploy/sitemap.ts +7 -5
- package/src/deploy/vercel-negotiation.ts +36 -0
- package/src/markdown/api-rail.ts +259 -0
- package/src/markdown/base-links.ts +34 -36
- package/src/markdown/code-title.ts +35 -9
- package/src/markdown/directives.ts +242 -36
- package/src/markdown/features.ts +20 -2
- package/src/markdown/fence-meta.ts +2 -0
- package/src/markdown/include.ts +11 -1
- package/src/markdown/index.ts +35 -11
- package/src/markdown/math.ts +4 -4
- package/src/markdown/mdast.ts +5 -2
- package/src/markdown/relative-links.ts +12 -4
- package/src/markdown/variables.ts +56 -0
- package/src/markdown/views.ts +82 -0
- package/src/narration/build.ts +412 -0
- package/src/narration/player.ts +249 -0
- package/src/narration/provider.ts +29 -0
- package/src/narration/script.ts +592 -0
- package/src/og/card.ts +136 -11
- package/src/og/derive.ts +41 -31
- package/src/og/index.ts +1 -0
- package/src/openapi/asyncapi.ts +4 -2
- package/src/openapi/model.ts +77 -36
- package/src/openapi/overlay.ts +256 -0
- package/src/openapi/parse.ts +55 -2
- package/src/openapi/proxy.ts +63 -10
- package/src/openapi/references.ts +21 -5
- package/src/openapi/render-mdx.ts +46 -3
- package/src/openapi/scalar.ts +40 -6
- package/src/openapi/source.ts +1 -1
- package/src/ratelimit/cloudflare.ts +54 -0
- package/src/ratelimit/index.ts +30 -0
- package/src/ratelimit/memory.ts +45 -0
- package/src/ratelimit/runtime.ts +229 -0
- package/src/ratelimit/schema.ts +28 -0
- package/src/ratelimit/upstash.ts +30 -0
- package/src/ratelimit/wrangler.ts +70 -0
- package/src/reference/asyncapi.ts +2 -2
- package/src/reference/graphql.ts +5 -2
- package/src/reference/openapi.ts +21 -7
- package/src/reference/options.ts +51 -7
- package/src/reference/scalar.ts +33 -8
- package/src/registry/eject.ts +201 -28
- package/src/registry/registry.ts +7 -0
- package/src/search/adapters/version-scope.ts +30 -0
- package/src/search/documents.ts +93 -28
- package/src/search/orama-index.ts +28 -3
- package/src/search/pagefind-ranking.ts +39 -0
- package/src/search/popular.ts +2 -1
- package/src/search/sync/algolia.ts +15 -4
- package/src/search/sync/orama-cloud.ts +3 -0
- package/src/search/sync/typesense.ts +5 -0
- package/src/seo/jsonld.ts +7 -3
- package/src/seo/metatags.ts +67 -0
- package/src/theme/chrome-icons.ts +1 -0
- package/src/theme/color.ts +500 -0
- package/src/theme/entry.ts +56 -3
- package/src/theme/palette.ts +121 -45
- package/src/translate/meta.ts +68 -24
- package/src/translate/prompts.ts +1 -0
- package/src/translate/run.ts +3 -3
- package/src/translate/validate.ts +12 -3
- package/src/translate/work-list.ts +56 -17
- package/src/upgrade/upgrade.ts +4 -171
- package/dist/cli/chunk-3yce002v.js.map +0 -14
- package/dist/cli/chunk-5r8g91qn.js.map +0 -34
- package/dist/cli/chunk-6dtt0zfn.js.map +0 -10
- package/dist/cli/chunk-7mbqtmgb.js.map +0 -10
- package/dist/cli/chunk-ddndchfr.js.map +0 -14
- package/dist/cli/chunk-esh98wmb.js +0 -23
- package/dist/cli/chunk-esh98wmb.js.map +0 -10
- package/dist/cli/chunk-hqp2ajnh.js.map +0 -35
- package/dist/cli/chunk-hr8ne106.js.map +0 -13
- package/dist/cli/chunk-j85scx15.js.map +0 -10
- package/dist/cli/chunk-mqc662a6.js +0 -75
- package/dist/cli/chunk-mqc662a6.js.map +0 -11
- package/dist/cli/chunk-pbg5a4s3.js.map +0 -19
- package/dist/cli/chunk-qkb5a8sa.js.map +0 -10
- package/dist/cli/chunk-v6ya5kcb.js.map +0 -189
- package/dist/cli/chunk-wdrt2k2v.js.map +0 -10
- package/dist/cli/chunk-xh43dwgw.js.map +0 -36
- package/docs/content/sources.mdx +0 -338
- /package/dist/cli/{chunk-zp79m0ts.js.map → chunk-1n228xqb.js.map} +0 -0
- /package/dist/cli/{chunk-h2ez8dzb.js.map → chunk-5ffywsmb.js.map} +0 -0
- /package/dist/cli/{chunk-g698a744.js.map → chunk-5wj2qwn2.js.map} +0 -0
- /package/dist/cli/{chunk-sqw4ekg1.js.map → chunk-amrb6hgh.js.map} +0 -0
- /package/dist/cli/{chunk-h7k3nq3v.js.map → chunk-gp84za0h.js.map} +0 -0
- /package/dist/cli/{chunk-bfwp9vp6.js.map → chunk-p804f3pe.js.map} +0 -0
- /package/dist/cli/{chunk-00gs3wqs.js.map → chunk-ta27feev.js.map} +0 -0
- /package/dist/cli/{chunk-bbnwccaz.js.map → chunk-y4ykbark.js.map} +0 -0
|
@@ -7,45 +7,47 @@ import {
|
|
|
7
7
|
} from "./index.js";
|
|
8
8
|
import {
|
|
9
9
|
deployPlatform
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import"./chunk-
|
|
12
|
-
import"./chunk-
|
|
10
|
+
} from "./chunk-xkz5xbtv.js";
|
|
11
|
+
import"./chunk-zccbjcj0.js";
|
|
12
|
+
import"./chunk-43zcf4gz.js";
|
|
13
13
|
import {
|
|
14
14
|
publishBuildProject,
|
|
15
15
|
ogCacheDir,
|
|
16
16
|
pruneCardCache,
|
|
17
17
|
cardCacheTally
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import"./chunk-
|
|
18
|
+
} from "./chunk-zf748avv.js";
|
|
19
|
+
import"./chunk-2f3ndkpw.js";
|
|
20
20
|
import {
|
|
21
21
|
deployOutputDir,
|
|
22
22
|
deployStaticDir,
|
|
23
23
|
surfaceAdapterOutput
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-4h8z9vv5.js";
|
|
25
25
|
import {
|
|
26
26
|
ensureGitignore
|
|
27
27
|
} from "./chunk-yzhm0j9q.js";
|
|
28
|
-
import"./chunk-
|
|
28
|
+
import"./chunk-ta27feev.js";
|
|
29
29
|
import {
|
|
30
30
|
removedBuildFlags,
|
|
31
31
|
flagList,
|
|
32
32
|
removedBuildFlagsAdvice
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-g2z9x01v.js";
|
|
34
34
|
import {
|
|
35
35
|
refuseIfDevRunning
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-cmtcnh9f.js";
|
|
37
37
|
import {
|
|
38
38
|
refuseIfEjected
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-py62fewh.js";
|
|
40
40
|
import"./chunk-jq5n4avg.js";
|
|
41
|
-
import"./chunk-
|
|
42
|
-
import"./chunk-
|
|
41
|
+
import"./chunk-cm89scdv.js";
|
|
42
|
+
import"./chunk-2f7n4qzt.js";
|
|
43
|
+
import"./chunk-amrb6hgh.js";
|
|
43
44
|
import {
|
|
44
45
|
prepareProject
|
|
45
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-5ffywsmb.js";
|
|
46
47
|
import {
|
|
47
48
|
serverFeatures
|
|
48
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-cy5bm0j0.js";
|
|
50
|
+
import"./chunk-6bm0xpgd.js";
|
|
49
51
|
|
|
50
52
|
// src/cli/commands/build.ts
|
|
51
53
|
import { existsSync } from "node:fs";
|
|
@@ -298,5 +300,5 @@ export {
|
|
|
298
300
|
runClientAssetChecks
|
|
299
301
|
};
|
|
300
302
|
|
|
301
|
-
//# debugId=
|
|
302
|
-
//# sourceMappingURL=chunk-
|
|
303
|
+
//# debugId=FA158DE8F0D59FE864756E2164756E21
|
|
304
|
+
//# sourceMappingURL=chunk-5cg2rzgf.js.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"import { existsSync } from \"node:fs\";\nimport { readdir, stat } from \"node:fs/promises\";\n\nimport { build } from \"astro\";\nimport { defineCommand } from \"citty\";\nimport { join } from \"pathe\";\n\nimport { publishBuildProject } from \"../../astro/integration.ts\";\nimport { BlumeError } from \"../../core/diagnostics.ts\";\nimport { ensureGitignore } from \"../../core/gitignore.ts\";\nimport type { BlumeProject } from \"../../core/project-graph.ts\";\nimport { serverFeatures } from \"../../core/server-features.ts\";\nimport {\n deployOutputDir,\n deployStaticDir,\n surfaceAdapterOutput,\n} from \"../../deploy/adapter-output.ts\";\nimport { deployPlatform } from \"../../deploy/platforms/index.ts\";\nimport { cardCacheTally, ogCacheDir, pruneCardCache } from \"../../og/cache.ts\";\nimport {\n flagList,\n removedBuildFlags,\n removedBuildFlagsAdvice,\n} from \"../../upgrade/upgrade.ts\";\nimport { astroBuildDiagnostics } from \"../build-failure.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport { refuseIfDevRunning } from \"../dev-lock.ts\";\nimport { refuseIfEjected } from \"../eject-scripts.ts\";\nimport { logger, reportDiagnostics } from \"../log.ts\";\nimport { prepareProject } from \"../prepare.ts\";\n\nconst BUDGET_JS = \"budget-js\";\nconst BUDGET_CSS = \"budget-css\";\n\ninterface BudgetArgs {\n \"budget-css\"?: string;\n \"budget-js\"?: string;\n}\n\n/**\n * Reject a non-numeric performance budget. `Number(\"250kb\")` is `NaN` and\n * `total > NaN` is always false, so a typo'd flag would silently pass the gate;\n * fail up front instead.\n */\nconst validateBudgetFlags = (args: BudgetArgs): void => {\n for (const flag of [BUDGET_JS, BUDGET_CSS] as const) {\n const value = args[flag];\n const parsed = Number(value);\n // Equivalent to `!(parsed > 0)` but without the inverted check: this must\n // also reject `NaN` (a typo'd flag like \"250kb\"), which `parsed <= 0` alone\n // would let through since `NaN <= 0` is false.\n if (value !== undefined && (Number.isNaN(parsed) || parsed <= 0)) {\n logger.error(\n `Invalid --${flag} \"${value}\" (expected a positive number of kB).`\n );\n process.exit(1);\n }\n }\n};\n\n/**\n * Report how many OG cards the build read back from the on-disk cache against\n * how many it rendered (the endpoint tallies both), so a warm rebuild shows\n * where the time went. With `prune`, also drop the cached cards this build\n * never asked for — renamed pages, edited descriptions, cards from an earlier\n * Blume version — so a persisted cache holds exactly the current site's cards.\n */\nconst reportCardCache = async (\n project: BlumeProject,\n prune: boolean\n): Promise<void> => {\n const cards = cardCacheTally();\n if (!cards) {\n return;\n }\n logger.info(\n `OG cards: ${cards.hits} reused from the cache, ${cards.misses} rendered`\n );\n if (prune) {\n await pruneCardCache(ogCacheDir(project.context));\n }\n};\n\nconst formatBytes = (bytes: number): string => {\n if (bytes < 1024) {\n return `${bytes} B`;\n }\n const digits = bytes < 1024 * 100 ? 1 : 0;\n return `${(bytes / 1024).toFixed(digits)} kB`;\n};\n\n/** Sizes of `dist/_astro/*.<ext>`, largest first (empty when none exist). */\nconst astroAssets = async (\n distDir: string,\n ext: string\n): Promise<{ name: string; size: number }[]> => {\n const astroDir = join(distDir, \"_astro\");\n if (!existsSync(astroDir)) {\n return [];\n }\n const entries = await readdir(astroDir);\n const files = entries.filter((name) => name.endsWith(`.${ext}`));\n const sized = await Promise.all(\n files.map(async (name) => {\n const info = await stat(join(astroDir, name));\n return { name, size: info.size };\n })\n );\n return sized.toSorted((a, b) => b.size - a.size);\n};\n\nconst totalSize = (assets: { size: number }[]): number =>\n assets.reduce((sum, asset) => sum + asset.size, 0);\n\n/**\n * Print the client JavaScript Astro shipped, largest first, plus the total. A\n * dependency-free bundle report — the interactive weight of a docs site is its\n * `_astro/*.js`, so this surfaces regressions without a visualizer.\n */\nconst reportBundleSizes = async (distDir: string): Promise<void> => {\n const sized = await astroAssets(distDir, \"js\");\n if (sized.length === 0) {\n logger.info(\"No client JavaScript emitted — the site ships zero JS.\");\n return;\n }\n const rows = sized\n .slice(0, 15)\n .map((file) => ` ${formatBytes(file.size).padStart(8)} ${file.name}`);\n logger.box(\n [\n `Client JavaScript — ${sized.length} file(s), ${formatBytes(totalSize(sized))} total`,\n \"\",\n ...rows,\n sized.length > 15 ? ` … and ${sized.length - 15} more` : null,\n ]\n .filter((line) => line !== null)\n .join(\"\\n\")\n );\n};\n\n/**\n * Enforce a performance budget on the built client assets: fail the build when\n * total `_astro/*.js` (or `*.css`) exceeds the given kB cap. Budgets that would\n * otherwise be \"documented, not measured\" become a real CI gate. Returns whether\n * every budget passed.\n */\nconst enforceBudget = async (\n distDir: string,\n args: BudgetArgs\n): Promise<\"fail\" | \"pass\" | \"skip\"> => {\n const checks: { ext: string; limitKb: number; name: string }[] = [\n ...(args[BUDGET_JS]\n ? [{ ext: \"js\", limitKb: Number(args[BUDGET_JS]), name: \"JavaScript\" }]\n : []),\n ...(args[BUDGET_CSS]\n ? [{ ext: \"css\", limitKb: Number(args[BUDGET_CSS]), name: \"CSS\" }]\n : []),\n ];\n if (checks.length === 0) {\n return \"skip\";\n }\n let passed = true;\n for (const check of checks) {\n // oxlint-disable-next-line no-await-in-loop -- a couple of sequential reads\n const total = totalSize(await astroAssets(distDir, check.ext));\n const limit = check.limitKb * 1024;\n if (total > limit) {\n passed = false;\n logger.error(\n `${check.name} budget exceeded: ${formatBytes(total)} > ${check.limitKb} kB`\n );\n } else {\n logger.success(\n `${check.name} budget: ${formatBytes(total)} / ${check.limitKb} kB`\n );\n }\n }\n return passed ? \"pass\" : \"fail\";\n};\n\n/**\n * Run the optional bundle report (`--analyze`) and performance-budget gate\n * against the directory whose `_astro/` client assets the deploy serves.\n * Shared by real and isolated builds — an isolated CI run passing\n * `--budget-js` must still fail on an exceeded budget rather than silently\n * skipping the check. Exits non-zero when a budget is exceeded.\n */\nexport const runClientAssetChecks = async (\n staticDir: string,\n args: { analyze?: boolean } & BudgetArgs\n): Promise<void> => {\n if (args.analyze) {\n await reportBundleSizes(staticDir);\n }\n if ((await enforceBudget(staticDir, args)) === \"fail\") {\n process.exit(1);\n }\n};\n\n/**\n * Print the build summary box and run the optional bundle report / budget\n * gate against the served static dir. The deploy artifacts themselves\n * (search index, llms.txt, sitemap, robots, redirect and header files, …)\n * were written by the integration's `astro:build:done` hook during\n * `build()` — see `deploy/artifacts.ts`. Exits non-zero if a budget is\n * exceeded.\n */\nconst reportBuild = async (\n project: BlumeProject,\n distDir: string,\n args: { analyze?: boolean } & BudgetArgs\n): Promise<void> => {\n const { config } = project;\n const features = serverFeatures(config);\n // The sitemap needs both the flag and a `site` (absolute URLs) — only the\n // latter deserves the remediation hint.\n const sitemapNote = config.seo.sitemap\n ? \"no (set deployment.site)\"\n : \"no (seo.sitemap is false)\";\n const rows: [label: string, value: string | number][] = [\n [\"Output\", config.deployment.options.output],\n [\"Adapter\", config.deployment.kind],\n [\"Site\", config.deployment.options.site ?? \"not set\"],\n [\"Search\", config.search.provider.kind],\n [\"Redirects\", config.redirects.length],\n [\n \"Sitemap\",\n config.deployment.options.site && config.seo.sitemap\n ? \"yes\"\n : sitemapNote,\n ],\n [\"Robots\", config.seo.robots ? \"yes\" : \"no\"],\n [\"Agent JSON\", config.agents.agentReadability ? \"yes\" : \"no\"],\n [\"LLM files\", config.agents.llmsTxt.enabled ? \"yes\" : \"no\"],\n [\"Server features\", features.length > 0 ? features.join(\", \") : \"none\"],\n ];\n // One label column for every row, sized by the longest label.\n const labelWidth = Math.max(...rows.map(([label]) => label.length)) + 2;\n logger.box(\n rows\n .map(([label, value]) => `${label.padEnd(labelWidth)}${value}`)\n .join(\"\\n\")\n );\n\n await runClientAssetChecks(distDir, args);\n\n // Only reachable with --no-strict (strict aborts earlier): repeat the missing\n // count next to the success banner so it can't scroll away unseen.\n if (project.droppedPages > 0) {\n logger.warn(\n `${project.droppedPages} page(s) failed frontmatter validation and are missing from this build.`\n );\n }\n logger.success(`Built to ${distDir}`);\n};\n\nexport const buildCommand = defineCommand({\n args: {\n analyze: {\n description: \"Report client JavaScript bundle sizes after the build.\",\n type: \"boolean\",\n },\n [BUDGET_CSS]: {\n description: \"Fail if total client CSS exceeds this many kB.\",\n type: \"string\",\n },\n [BUDGET_JS]: {\n description: \"Fail if total client JavaScript exceeds this many kB.\",\n type: \"string\",\n },\n isolated: {\n description:\n \"Build into an isolated .blume-verify runtime (and its own dist) so a running dev server and the real dist/ are untouched. For verifying changes while `blume dev` runs.\",\n type: \"boolean\",\n },\n preview: {\n description: \"Include drafts and unpublished CMS content.\",\n type: \"boolean\",\n },\n strict: {\n default: true,\n description:\n \"Fail on error diagnostics (default; pass --no-strict to build anyway, dropping pages that fail validation).\",\n type: \"boolean\",\n },\n },\n meta: commandMeta.build,\n async run({ args, rawArgs }) {\n const root = process.cwd();\n\n // citty accepts unknown flags, so a Blume 1 `--adapter vercel --output\n // server` would otherwise build a static site without a word.\n const removed = removedBuildFlags(rawArgs);\n if (removed.length > 0) {\n logger.error(\n `blume build no longer takes ${flagList(removed)}. ${removedBuildFlagsAdvice(removed)}`\n );\n process.exit(1);\n }\n await refuseIfEjected(root, \"build\");\n\n // `--isolated` (or BLUME_RUNTIME_DIR) relocates the whole runtime to a\n // sibling dir so this build never touches a live dev server's `.blume/` or\n // the user's real `dist/`. A non-default runtime dir has no dev lock, so the\n // refusal below lets it proceed; a plain build still refuses.\n const runtimeDir = args.isolated\n ? \".blume-verify\"\n : process.env.BLUME_RUNTIME_DIR;\n refuseIfDevRunning(root, \"building\", { isolatedHint: true, runtimeDir });\n if (args.isolated) {\n await ensureGitignore(root, [\".blume-verify/\"]);\n }\n\n validateBudgetFlags(args);\n\n const project = await prepareProject({\n mode: \"build\",\n preview: args.preview,\n root,\n runtimeDir,\n strict: args.strict,\n });\n\n logger.start(\n `Building ${project.graph.pages.length} page(s) (${project.config.deployment.options.output} output)`\n );\n\n // Hand the scanned project to the integration: its `astro:build:done`\n // hook writes the deploy artifacts (search index, llms.txt, sitemap, …)\n // into Astro's client output during the build. An isolated build is a\n // throwaway verify that only needs to confirm the site compiles and\n // renders, so it publishes nothing — no network post-steps (a hosted\n // search sync would push), no deploy artifacts.\n if (!runtimeDir) {\n publishBuildProject(project);\n }\n\n try {\n await build({\n logLevel: \"info\",\n root: project.context.outDir,\n });\n } catch (error) {\n // Astro rejects when the site fails to compile or render (MDX that\n // doesn't parse, a component that throws): report that as a build error\n // at the file it names, not as an internal error blaming Blume. A\n // BlumeError keeps its own diagnostic.\n if (error instanceof BlumeError || !(error instanceof Error)) {\n throw error;\n }\n reportDiagnostics(astroBuildDiagnostics(error), root);\n process.exit(1);\n }\n\n // A real build also prunes the cache; an isolated verify must not evict\n // cards a live dev server is still serving.\n await reportCardCache(project, !runtimeDir);\n\n // Everything the deploy target does differently after `astro build` comes\n // off its platform (see `deploy/platforms/*`): a server build's post-build\n // step (Vercel's function-bundle audit and negotiation routes, Cloudflare's\n // wrapper Worker), and where its bundle and static assets landed.\n const { deployment } = project.config;\n const platform = deployPlatform(deployment);\n const server = deployment.options.output === \"server\";\n const finalize = async (isolated: boolean): Promise<void> => {\n if (\n server &&\n platform.finalizeBuild &&\n !(await platform.finalizeBuild({ isolated, log: logger, project }))\n ) {\n process.exit(1);\n }\n };\n\n // The bundle report and budget gate still run for an isolated build —\n // `blume build --isolated --budget-js 100` exiting 0 without measuring\n // anything would be a silent false pass in CI. An isolated build never\n // surfaces the adapter bundle to the project root, so its output dirs\n // resolve under the relocated runtime.\n if (runtimeDir) {\n await finalize(true);\n await runClientAssetChecks(\n deployStaticDir(project.config, project.context),\n args\n );\n logger.success(\n `Isolated build OK — output at ${deployOutputDir(project.config, project.context)} (not published).`\n );\n return;\n }\n\n // A server adapter's deploy bundle is a build artifact — keep it out of\n // version control (Vercel's own CLI ignores `.vercel/` for the same reason).\n // Ignoring it is independent of whether the bundle had to be moved below:\n // Vercel writes straight to the project root, Netlify does not.\n const { ignoreDir } = platform.hiddenRuntime;\n if (server && ignoreDir) {\n await ensureGitignore(root, [ignoreDir]);\n }\n\n // Netlify writes its deploy bundle relative to the Astro root — which Blume\n // points at the hidden `.blume` runtime — so the bundle lands where the\n // deploy platform never looks. Surface it up to the project root before\n // publishing artifacts into the served static dir.\n const surfaced = await surfaceAdapterOutput(\n project.config,\n project.context\n );\n if (surfaced.moved) {\n logger.success(`Surfaced ${deployment.kind} output to ${surfaced.to}`);\n }\n\n await finalize(false);\n\n await reportBuild(\n project,\n deployStaticDir(project.config, project.context),\n args\n );\n },\n});\n",
|
|
6
6
|
"import { z } from \"zod\";\n\nimport type { Diagnostic } from \"../core/types.ts\";\n\n/**\n * The fields of an `astro build` rejection the report reads. Rolldown bundles\n * every plugin failure (an MDX compile error, say) into one error whose\n * `errors` holds each; a failure carries `loc` where the compiler pinned it,\n * or only `id`, the module that failed.\n */\nconst buildErrorSchema = z.looseObject({\n errors: z.array(z.instanceof(Error)).optional(),\n id: z.string().optional(),\n loc: z\n .looseObject({\n column: z.number().optional(),\n file: z.string().optional(),\n line: z.number().optional(),\n })\n .optional(),\n});\n\n/** One failure as a diagnostic at the file (and position) it names. */\nconst failureDiagnostic = (error: Error): Diagnostic => {\n const parsed = buildErrorSchema.safeParse(error);\n const { id, loc } = parsed.success ? parsed.data : {};\n // A named error (`MDXError`, `CompilerError`) says which step failed.\n const name = error.name === \"Error\" ? \"\" : `${error.name}: `;\n return {\n code: \"BLUME_BUILD_FAILED\",\n column: loc?.column,\n file: loc?.file ?? id,\n line: loc?.line,\n message: `${name}${error.message}`,\n severity: \"error\",\n };\n};\n\n/**\n * What `astro build` rejected with, as build diagnostics: one per failure\n * Rolldown collected, else the error itself. A page Blume's own checks pass\n * can still fail Astro's compile (MDX that doesn't parse) or render, and that\n * is a problem in the site, reported at its file, rather than an internal\n * error blaming Blume.\n */\nexport const astroBuildDiagnostics = (error: Error): Diagnostic[] => {\n const parsed = buildErrorSchema.safeParse(error);\n const failures = parsed.success ? (parsed.data.errors ?? []) : [];\n return (failures.length > 0 ? failures : [error]).map(failureDiagnostic);\n};\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": "
|
|
9
|
-
"debugId": "
|
|
8
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AACA;AACA;;;ACLA;AAUA,IAAM,mBAAmB,EAAE,YAAY;AAAA,EACrC,QAAQ,EAAE,MAAM,EAAE,WAAW,KAAK,CAAC,EAAE,SAAS;AAAA,EAC9C,IAAI,EAAE,OAAO,EAAE,SAAS;AAAA,EACxB,KAAK,EACF,YAAY;AAAA,IACX,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,IAC5B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,IAC1B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,CAAC,EACA,SAAS;AACd,CAAC;AAGD,IAAM,oBAAoB,CAAC,UAA6B;AAAA,EACtD,MAAM,SAAS,iBAAiB,UAAU,KAAK;AAAA,EAC/C,QAAQ,IAAI,QAAQ,OAAO,UAAU,OAAO,OAAO,CAAC;AAAA,EAEpD,MAAM,OAAO,MAAM,SAAS,UAAU,KAAK,GAAG,MAAM;AAAA,EACpD,OAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAQ,KAAK;AAAA,IACb,MAAM,KAAK,QAAQ;AAAA,IACnB,MAAM,KAAK;AAAA,IACX,SAAS,GAAG,OAAO,MAAM;AAAA,IACzB,UAAU;AAAA,EACZ;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,MAAM,SAAS,WAAW,QAAQ,WAAW;AAAA,IAC7C,MAAM,WAAW,OAAO,aAAqC;AAAA,MAC3D,IACE,UACA,SAAS,iBACT,CAAE,MAAM,SAAS,cAAc,EAAE,UAAU,KAAK,QAAQ,QAAQ,CAAC,GACjE;AAAA,QACA,QAAQ,KAAK,CAAC;AAAA,MAChB;AAAA;AAAA,IAQF,IAAI,YAAY;AAAA,MACd,MAAM,SAAS,IAAI;AAAA,MACnB,MAAM,qBACJ,gBAAgB,QAAQ,QAAQ,QAAQ,OAAO,GAC/C,IACF;AAAA,MACA,OAAO,QACL,iCAAiC,gBAAgB,QAAQ,QAAQ,QAAQ,OAAO,oBAClF;AAAA,MACA;AAAA,IACF;AAAA,IAMA,QAAQ,cAAc,SAAS;AAAA,IAC/B,IAAI,UAAU,WAAW;AAAA,MACvB,MAAM,gBAAgB,MAAM,CAAC,SAAS,CAAC;AAAA,IACzC;AAAA,IAMA,MAAM,WAAW,MAAM,qBACrB,QAAQ,QACR,QAAQ,OACV;AAAA,IACA,IAAI,SAAS,OAAO;AAAA,MAClB,OAAO,QAAQ,YAAY,WAAW,kBAAkB,SAAS,IAAI;AAAA,IACvE;AAAA,IAEA,MAAM,SAAS,KAAK;AAAA,IAEpB,MAAM,YACJ,SACA,gBAAgB,QAAQ,QAAQ,QAAQ,OAAO,GAC/C,IACF;AAAA;AAEJ,CAAC;",
|
|
9
|
+
"debugId": "FA158DE8F0D59FE864756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
packageDirFrom,
|
|
4
4
|
generateRuntime
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-zf748avv.js";
|
|
6
6
|
import {
|
|
7
7
|
loadEnvFiles,
|
|
8
8
|
reportInternalError,
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
} from "./index.js";
|
|
14
14
|
import {
|
|
15
15
|
scanProject
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-43zcf4gz.js";
|
|
17
17
|
import {
|
|
18
18
|
serverFeatures,
|
|
19
19
|
checkRequiredSecrets
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-cy5bm0j0.js";
|
|
21
21
|
|
|
22
22
|
// src/cli/yarn-pnp.ts
|
|
23
23
|
import { existsSync } from "node:fs";
|
|
@@ -119,4 +119,4 @@ var prepareProject = async (options) => {
|
|
|
119
119
|
export { prepareProject };
|
|
120
120
|
|
|
121
121
|
//# debugId=28CF8258A34C9DAE64756E2164756E21
|
|
122
|
-
//# sourceMappingURL=chunk-
|
|
122
|
+
//# sourceMappingURL=chunk-5ffywsmb.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
loadConfig
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import"./chunk-
|
|
4
|
+
} from "./chunk-xkz5xbtv.js";
|
|
5
|
+
import"./chunk-zccbjcj0.js";
|
|
6
6
|
import {
|
|
7
7
|
commandMeta,
|
|
8
8
|
reportInternalError,
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
reportDiagnostics
|
|
12
12
|
} from "./index.js";
|
|
13
13
|
import"./chunk-jq5n4avg.js";
|
|
14
|
-
import"./chunk-
|
|
14
|
+
import"./chunk-43zcf4gz.js";
|
|
15
15
|
import {
|
|
16
16
|
CutError,
|
|
17
17
|
cutVersion
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-e7vvk5ya.js";
|
|
19
19
|
|
|
20
20
|
// src/cli/commands/version.ts
|
|
21
21
|
import { defineCommand } from "citty";
|
|
@@ -88,4 +88,4 @@ export {
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
//# debugId=86F69482E9E3E55264756E2164756E21
|
|
91
|
-
//# sourceMappingURL=chunk-
|
|
91
|
+
//# sourceMappingURL=chunk-5wj2qwn2.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
asciiSlugify
|
|
4
|
+
} from "./chunk-xkz5xbtv.js";
|
|
5
|
+
|
|
6
|
+
// src/ai/site-skill.ts
|
|
7
|
+
var NAME_MAX = 64;
|
|
8
|
+
var siteSkillName = (project) => {
|
|
9
|
+
const { site } = project.config.deployment.options;
|
|
10
|
+
const fromTitle = asciiSlugify(project.config.title);
|
|
11
|
+
const name = fromTitle || asciiSlugify(site ? new URL(site).hostname : "") || "docs";
|
|
12
|
+
return name.slice(0, NAME_MAX).replace(/-+$/u, "");
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { siteSkillName };
|
|
16
|
+
|
|
17
|
+
//# debugId=D5EE89A8D7931D3164756E2164756E21
|
|
18
|
+
//# sourceMappingURL=chunk-6bm0xpgd.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/ai/site-skill.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { hasGeneratedChangelog } from \"../astro/pages.ts\";\nimport {\n mountBasePath,\n normalizeBasePath,\n withBasePath,\n} from \"../core/base-path.ts\";\nimport { CHANGELOG_INDEX_ROUTE } from \"../core/changelog-index.ts\";\nimport { discoverPagesSync } from \"../core/custom-pages.ts\";\nimport type { BlumeProject } from \"../core/project-graph.ts\";\nimport { absoluteUrl } from \"../core/site-url.ts\";\nimport type { NavNode, PageRecord } from \"../core/types.ts\";\nimport { resolveReferences } from \"../openapi/references.ts\";\nimport { docsPhrase } from \"./ai-catalog.ts\";\nimport { API_PAGES_PATH } from \"./api/paths.ts\";\nimport { asciiSlugify } from \"./mcp/discovery.ts\";\nimport {\n SKILL_DESCRIPTION_MAX,\n generatesSiteSkill,\n skillMdArtifact,\n} from \"./skills.ts\";\nimport type { SkillArtifact } from \"./skills.ts\";\n\n/**\n * The site's own agent skill (`agents.skillMd`): a `SKILL.md` in the Agent\n * Skills format, built from what the build already knows — the site's title\n * and description, how to read any page as Markdown, llms.txt and the MCP\n * server, the API references, and a map of the docs with each page's one-line\n * description. No model writes it, so it costs nothing and is current with\n * every build: a guide to the docs rather than a summary of the product. A\n * hand-written skill of the same name in `agents.skills` replaces it.\n */\n\n/** The most pages the map lists; llms.txt holds the rest. */\nexport const MAX_SKILL_PAGES = 200;\n\n/** The Agent Skills spec caps a skill name at 64 characters. */\nconst NAME_MAX = 64;\n\n/** Where the site skill is served besides the discovery index. */\nexport const SKILL_MD_PATH = \"/skill.md\";\n\n/**\n * The site skill's name: the title as a skill name (lowercase alphanumerics\n * and single hyphens), else the site's host, for a title with no Latin\n * letters in it.\n */\nexport const siteSkillName = (project: BlumeProject): string => {\n const { site } = project.config.deployment.options;\n const fromTitle = asciiSlugify(project.config.title);\n const name =\n fromTitle || asciiSlugify(site ? new URL(site).hostname : \"\") || \"docs\";\n return name.slice(0, NAME_MAX).replace(/-+$/u, \"\");\n};\n\n/** A title as Markdown link text (brackets escaped, as in llms.txt). */\nconst linkText = (title: string): string =>\n title.replaceAll(/[\\\\[\\]]/gu, String.raw`\\$&`);\n\n/**\n * Current-version, default-locale pages worth listing: not API operations,\n * and not changelog entries, which the changelog index covers in one line.\n */\nconst mappedPages = (project: BlumeProject): PageRecord[] => {\n const defaultLocale = project.config.i18n?.defaultLocale;\n return project.graph.pages.filter(\n (page) =>\n !(\n page.meta.ai.exclude ||\n page.meta.draft ||\n page.meta.sidebar.hidden ||\n page.meta.seo.noindex ||\n page.version !== \"\" ||\n page.source.name === \"openapi\" ||\n page.contentType === \"changelog\"\n ) &&\n (defaultLocale === undefined || page.locale === defaultLocale)\n );\n};\n\n/** Renders the page map, listing each page once, up to the cap. */\nclass PageMap {\n readonly #byRoute: Map<string, PageRecord>;\n readonly #listed = new Set<string>();\n readonly #url: (route: string) => string;\n\n constructor(pages: PageRecord[], url: (route: string) => string) {\n this.#byRoute = new Map(pages.map((page) => [page.route, page]));\n this.#url = url;\n }\n\n /** How many listable pages the cap left out. */\n get omitted(): number {\n return this.#byRoute.size - this.#listed.size;\n }\n\n /** The Markdown link line for a route, or nothing when it isn't listed. */\n line(route: string): string[] {\n const page = this.#byRoute.get(route);\n if (\n !page ||\n this.#listed.has(route) ||\n this.#listed.size >= MAX_SKILL_PAGES\n ) {\n return [];\n }\n this.#listed.add(route);\n const summary = page.description ? `: ${page.description}` : \"\";\n return [`- [${linkText(page.title)}](${this.#url(route)})${summary}`];\n }\n\n /** One navigation level: its loose pages, then each group under a heading. */\n level(nodes: NavNode[], depth: number): string[] {\n const list: string[] = [];\n const groups: string[] = [];\n for (const node of nodes) {\n if (node.kind === \"page\") {\n list.push(...this.line(node.route));\n continue;\n }\n const blocks = [\n ...(node.route ? this.line(node.route) : []),\n ...this.level(node.children, depth + 1),\n ];\n if (blocks.length > 0) {\n groups.push(\n \"\",\n `${\"#\".repeat(Math.min(depth, 6))} ${node.label}`,\n \"\",\n ...blocks\n );\n }\n }\n return [...list, ...groups];\n }\n\n /** Pages the navigation doesn't reach, in route order. */\n rest(): string[] {\n return [...this.#byRoute.keys()]\n .toSorted((a, b) => a.localeCompare(b))\n .flatMap((route) => this.line(route));\n }\n}\n\n/** The \"Reading the docs\" bullets: every agent surface the site serves. */\nconst surfaceLines = (\n project: BlumeProject,\n url: (path: string) => string\n): string[] => {\n const { agents } = project.config;\n const lines = [\n `- Any page as Markdown: add \\`.md\\` to its URL (the home page is ${url(\"/index.md\")}). Every page link below already points at the Markdown.`,\n ];\n if (agents.llmsTxt.enabled) {\n lines.push(\n `- [llms.txt](${url(\"/llms.txt\")}): every page with a one-line summary.`,\n `- [llms-full.txt](${url(\"/llms-full.txt\")}): every page in one file, for when you need all of it.`\n );\n }\n if (agents.mcp.enabled) {\n lines.push(\n `- MCP server at ${url(agents.mcp.route)}, with \\`search_docs\\`, \\`get_page\\`, \\`list_pages\\`, and \\`get_navigation\\`. Connect it to search the docs instead of guessing URLs.`\n );\n }\n if (agents.api) {\n lines.push(\n `- [JSON API](${url(API_PAGES_PATH)}): the page index, with each page as JSON and Markdown.`\n );\n }\n const userPages = project.context.pagesRoot\n ? discoverPagesSync(project.context.pagesRoot)\n : [];\n if (hasGeneratedChangelog(project, userPages)) {\n lines.push(\n `- [Changelog](${url(`${CHANGELOG_INDEX_ROUTE}.md`)}): release notes, newest first.`\n );\n }\n return lines;\n};\n\n/** The \"API reference\" bullets, one per rendered reference. */\nconst referenceLines = (\n project: BlumeProject,\n url: (path: string) => string\n): string[] =>\n resolveReferences(project.config).map((reference) => {\n // Scalar renders its own page with no Markdown mirror; Blume-rendered\n // references are pages like any other, one per operation.\n const route =\n reference.kind === \"scalar\"\n ? reference.route\n : withBasePath(reference.basePath, reference.route);\n const pages =\n reference.kind === \"scalar\"\n ? \"\"\n : \", with a page per operation (add `.md` for its Markdown)\";\n return `- [${linkText(reference.label)}](${url(route)})${pages}.`;\n });\n\n/** The skill's frontmatter `description`: what it's for and when to use it. */\nconst skillDescription = (project: BlumeProject): string => {\n const { description, title } = project.config;\n const summary = description ? ` ${description.trim()}` : \"\";\n return `Read ${docsPhrase(title, \"docs\")} instead of answering from memory.${summary} Use when a task involves ${title}: how it works, how to set it up or configure it, or its API.`.slice(\n 0,\n SKILL_DESCRIPTION_MAX\n );\n};\n\n/** The site skill's `SKILL.md`. */\nconst skillMarkdown = (project: BlumeProject, name: string): string => {\n const { config } = project;\n const { site = \"\" } = config.deployment.options;\n const base = normalizeBasePath(config.deployment.options.base);\n // Mounted and encoded like llms.txt's links.\n const url = (path: string): string =>\n encodeURI(absoluteUrl(site, mountBasePath(base, path)));\n const markdownUrl = (route: string): string =>\n url(route === \"/\" ? \"/index.md\" : `${route}.md`);\n\n const map = new PageMap(mappedPages(project), markdownUrl);\n const pages = [\n ...map.level(project.graph.navigation.sidebar, 3),\n ...map.rest(),\n ];\n const { omitted } = map;\n if (omitted > 0) {\n pages.push(\n \"\",\n config.agents.llmsTxt.enabled\n ? `…and ${omitted} more. [llms.txt](${url(\"/llms.txt\")}) lists every page.`\n : `…and ${omitted} more.`\n );\n }\n const references = referenceLines(project, url);\n\n return [\n \"---\",\n `name: ${name}`,\n `description: ${JSON.stringify(skillDescription(project))}`,\n \"---\",\n \"\",\n `# ${config.title}`,\n \"\",\n ...(config.description ? [config.description.trim(), \"\"] : []),\n `This skill points you at ${docsPhrase(config.title, \"docs\")}, at ${url(\"/\")}. When a task involves ${config.title}, read the relevant page before relying on what you remember: the docs are the source of truth, and they change.`,\n \"\",\n \"## Reading the docs\",\n \"\",\n ...surfaceLines(project, url),\n ...(references.length > 0\n ? [\"\", \"## API reference\", \"\", ...references]\n : []),\n ...(pages.length > 0 ? [\"\", \"## Pages\", \"\", ...pages] : []),\n \"\",\n ]\n .join(\"\\n\")\n .replaceAll(/\\n{3,}/gu, \"\\n\\n\");\n};\n\n/**\n * The generated site skill, or `null` when `agents.skillMd` is off or there\n * is no `deployment.site` to make its links absolute.\n */\nexport const buildSiteSkill = (project: BlumeProject): SkillArtifact | null => {\n if (!generatesSiteSkill(project.config)) {\n return null;\n }\n const name = siteSkillName(project);\n return skillMdArtifact(\n name,\n skillDescription(project),\n skillMarkdown(project, name)\n );\n};\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;AAoCA,IAAM,WAAW;AAUV,IAAM,gBAAgB,CAAC,YAAkC;AAAA,EAC9D,QAAQ,SAAS,QAAQ,OAAO,WAAW;AAAA,EAC3C,MAAM,YAAY,aAAa,QAAQ,OAAO,KAAK;AAAA,EACnD,MAAM,OACJ,aAAa,aAAa,OAAO,IAAI,IAAI,IAAI,EAAE,WAAW,EAAE,KAAK;AAAA,EACnE,OAAO,KAAK,MAAM,GAAG,QAAQ,EAAE,QAAQ,QAAQ,EAAE;AAAA;",
|
|
8
|
+
"debugId": "D5EE89A8D7931D3164756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import {
|
|
3
3
|
trimEnd,
|
|
4
4
|
normalizeRoute,
|
|
5
|
-
|
|
5
|
+
mountBasePath,
|
|
6
6
|
stripBasePath,
|
|
7
7
|
absoluteUrl2,
|
|
8
8
|
MCP_TOOLS
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-zccbjcj0.js";
|
|
10
10
|
import {
|
|
11
11
|
commandMeta
|
|
12
12
|
} from "./index.js";
|
|
@@ -41,13 +41,16 @@ var SCHEMA = {
|
|
|
41
41
|
contentType: "enum",
|
|
42
42
|
description: "string",
|
|
43
43
|
facetTerms: "enum[]",
|
|
44
|
+
keywords: "string[]",
|
|
44
45
|
locale: "enum",
|
|
45
46
|
route: "string",
|
|
46
47
|
title: "string",
|
|
47
48
|
version: "enum"
|
|
48
49
|
};
|
|
49
50
|
var toFacetTerms = (facets) => Object.entries(facets).map(([key, value]) => `${key}:${value}`);
|
|
50
|
-
var BOOST = { description: 2, title: 3 };
|
|
51
|
+
var BOOST = { description: 2, keywords: 3, title: 3 };
|
|
52
|
+
var boostedDatabases = new WeakSet;
|
|
53
|
+
var byBoostedScore = (a, b) => b[1] * (b[2].boost ?? 1) - a[1] * (a[2].boost ?? 1);
|
|
51
54
|
var LATIN_SCRIPT = "Latn";
|
|
52
55
|
var parseLocale = (tag) => {
|
|
53
56
|
const hyphenated = tag.replace(/[.@].*$/u, "").replaceAll("_", "-");
|
|
@@ -144,6 +147,9 @@ var buildOramaIndex = async (documents, locale) => {
|
|
|
144
147
|
const tokenizer = segmentingTokenizer(locale);
|
|
145
148
|
const db = tokenizer ? create({ components: { tokenizer }, schema: SCHEMA }) : create({ schema: SCHEMA });
|
|
146
149
|
await insertMultiple(db, documents.map((doc) => doc.facets ? { ...doc, facetTerms: toFacetTerms(doc.facets) } : doc));
|
|
150
|
+
if (documents.some((doc) => (doc.boost ?? 1) !== 1)) {
|
|
151
|
+
boostedDatabases.add(db);
|
|
152
|
+
}
|
|
147
153
|
return db;
|
|
148
154
|
};
|
|
149
155
|
var ALL_TOKENS = 0;
|
|
@@ -165,7 +171,8 @@ var queryOramaIndex = async (db, term, limit, filters) => {
|
|
|
165
171
|
const unfiltered = {
|
|
166
172
|
boost: BOOST,
|
|
167
173
|
limit,
|
|
168
|
-
properties: ["title", "description", "content"],
|
|
174
|
+
properties: ["title", "keywords", "description", "content"],
|
|
175
|
+
...boostedDatabases.has(db) && { sortBy: byBoostedScore },
|
|
169
176
|
term
|
|
170
177
|
};
|
|
171
178
|
const params = Object.keys(where).length > 0 ? { ...unfiltered, where } : unfiltered;
|
|
@@ -258,7 +265,7 @@ var normalizeRoute2 = (input, data) => {
|
|
|
258
265
|
return stripBasePath(data.base, normalizeRoute(noSuffix));
|
|
259
266
|
};
|
|
260
267
|
var urlFor = (route, data) => {
|
|
261
|
-
const path =
|
|
268
|
+
const path = mountBasePath(data.base, route);
|
|
262
269
|
return data.site ? absoluteUrl2(data.site, path) : path;
|
|
263
270
|
};
|
|
264
271
|
var excerptFor = (doc) => {
|
|
@@ -353,7 +360,7 @@ var TOOL_DEFINITIONS = MCP_TOOLS.map((tool) => ({
|
|
|
353
360
|
name: tool.name,
|
|
354
361
|
title: tool.title
|
|
355
362
|
}));
|
|
356
|
-
var resourceUri = (route, data) => data.site ? urlFor(route, data) : `${LOCAL_RESOURCE_SCHEME}${
|
|
363
|
+
var resourceUri = (route, data) => data.site ? urlFor(route, data) : `${LOCAL_RESOURCE_SCHEME}${mountBasePath(data.base, route)}`;
|
|
357
364
|
var resourceRoute = (uri, data) => normalizeRoute2(uri.startsWith(LOCAL_RESOURCE_SCHEME) ? uri.slice(LOCAL_RESOURCE_SCHEME.length) : uri, data);
|
|
358
365
|
var TOOL_CALL_PARAMS = z2.object({
|
|
359
366
|
arguments: z2.record(z2.string(), z2.unknown()).optional(),
|
|
@@ -472,5 +479,5 @@ export {
|
|
|
472
479
|
mcpStdioCommand
|
|
473
480
|
};
|
|
474
481
|
|
|
475
|
-
//# debugId=
|
|
476
|
-
//# sourceMappingURL=chunk-
|
|
482
|
+
//# debugId=19894529A226AE0264756E2164756E21
|
|
483
|
+
//# sourceMappingURL=chunk-713mngdq.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/cli/commands/mcp-stdio.ts", "../src/ai/mcp/stdio.ts", "../src/ai/mcp/server.ts", "../src/ai/mcp/query.ts", "../src/search/orama-index.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { readFile } from \"node:fs/promises\";\n\nimport { defineCommand } from \"citty\";\n\nimport type { McpData } from \"../../ai/mcp/data.ts\";\nimport { serveMcpStdio } from \"../../ai/mcp/stdio.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\n\nexport const mcpStdioCommand = defineCommand({\n args: {\n data: {\n description: \"Path to a serialized MCP data snapshot (JSON).\",\n required: true,\n type: \"string\",\n },\n },\n meta: commandMeta[\"mcp-stdio\"],\n async run({ args }) {\n // stdout belongs to the JSON-RPC transport from here on; every diagnostic\n // must go to stderr or the MCP client chokes on the stray line.\n let data: McpData;\n try {\n // SAFETY: the snapshot is written by `blume eval` itself as\n // JSON.stringify of an McpData; a hand-mangled file fails the parse and\n // lands in the catch below.\n data = JSON.parse(await readFile(args.data, \"utf-8\")) as McpData;\n } catch (error) {\n const detail = error instanceof Error ? error.message : String(error);\n process.stderr.write(\n `blume mcp-stdio: cannot load the snapshot at ${args.data}: ${detail}\\n`\n );\n process.exit(1);\n }\n await serveMcpStdio(data);\n },\n});\n",
|
|
6
|
+
"import { once } from \"node:events\";\nimport type { Readable, Writable } from \"node:stream\";\n\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\n\nimport type { McpData } from \"./data.ts\";\nimport { buildServer, createIndexProvider } from \"./server.ts\";\n\n/** Streams for `serveMcpStdio`, injectable so tests can use in-memory pipes. */\nexport interface McpStdioStreams {\n stdin?: Readable;\n stdout?: Writable;\n}\n\n/**\n * Serve a precomputed MCP data snapshot over a stdio transport until the\n * client hangs up.\n *\n * The SDK transport reads its input stream but never watches for its end, so\n * a client that simply closes the pipe — which is how every MCP host shuts a\n * stdio server down — would leave the process running forever. EOF on the\n * input stream therefore ends the serve loop explicitly.\n */\nexport const serveMcpStdio = async (\n data: McpData,\n streams: McpStdioStreams = {}\n): Promise<void> => {\n const stdin = streams.stdin ?? process.stdin;\n const stdout = streams.stdout ?? process.stdout;\n const transport = new StdioServerTransport(stdin, stdout);\n const server = buildServer(\n data,\n createIndexProvider(data.documents, data.defaultLocale)\n );\n await server.connect(transport);\n await once(stdin, \"end\");\n await transport.close();\n};\n",
|
|
7
|
+
"import { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport type { ServerOptions } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport { WebStandardStreamableHTTPServerTransport } from \"@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js\";\nimport {\n ErrorCode,\n ListResourcesRequestSchema,\n ListToolsRequestSchema,\n McpError,\n ReadResourceRequestSchema,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport { z } from \"zod\";\n\nimport { mountBasePath } from \"../../core/base-path.ts\";\nimport { readCappedText } from \"../../core/request-body.ts\";\nimport type { McpData } from \"./data.ts\";\nimport {\n createIndexProvider,\n getNavigation,\n getPageMarkdown,\n listPages,\n normalizeRoute,\n searchDocs,\n TOOL_INPUTS,\n urlFor,\n} from \"./query.ts\";\nimport type { OramaIndexProvider } from \"./query.ts\";\nimport { MCP_TOOLS } from \"./tools.ts\";\n\nexport { createIndexProvider } from \"./query.ts\";\nexport type { OramaIndexProvider } from \"./query.ts\";\n\n/**\n * The low-level SDK `Server` is used (rather than the high-level `McpServer`)\n * because the latter's `registerTool` is generic over the caller's Zod instance;\n * Blume's zod and the SDK's may resolve to different copies, whose types don't\n * unify. The operations themselves live in `query.ts`, shared with the JSON\n * docs API; this module is the MCP transport over them.\n */\n\n/** Every page resource is the page's agent Markdown. */\nconst RESOURCE_MIME_TYPE = \"text/markdown\";\n/** The MCP spec's JSON-RPC code for an unknown resource URI. */\nconst RESOURCE_NOT_FOUND = -32_002;\n/** URI scheme for page resources when no `deployment.site` is configured. */\nconst LOCAL_RESOURCE_SCHEME = \"blume:\";\n/**\n * The largest request body the HTTP endpoint reads. A JSON-RPC call to these\n * tools is a few hundred bytes; the cap keeps one oversized POST from being\n * buffered whole, as the assistant route's does.\n */\nconst MCP_BODY_LIMIT_BYTES = 65_536;\n\nconst CORS_HEADERS = {\n \"Access-Control-Allow-Headers\":\n \"Content-Type, Mcp-Session-Id, Mcp-Protocol-Version\",\n \"Access-Control-Allow-Methods\": \"GET, POST, OPTIONS\",\n \"Access-Control-Allow-Origin\": \"*\",\n \"Access-Control-Expose-Headers\": \"Mcp-Session-Id\",\n};\n\n/**\n * A tool's advertised JSON Schema. The dialect key is dropped (noise in a\n * tools/list payload), as is the root `additionalProperties: false` — the\n * runtime strips unknown keys rather than rejecting them, and the advertised\n * schema shouldn't promise stricter validation than the server performs.\n */\nconst inputSchemaFor = (schema: z.ZodType) => {\n const {\n $schema: _dialect,\n additionalProperties: _closed,\n ...rest\n } = z.toJSONSchema(schema);\n return rest;\n};\n\n/** The `tools/list` payload, derived from shared metadata + input schemas. */\nconst TOOL_DEFINITIONS = MCP_TOOLS.map((tool) => ({\n annotations: tool.annotations,\n description: tool.description,\n inputSchema: inputSchemaFor(\n // SAFETY: TOOL_INPUTS declares a schema for every MCP_TOOLS name; the two\n // lists are maintained together so names and descriptions never drift.\n TOOL_INPUTS[tool.name as keyof typeof TOOL_INPUTS]\n ),\n name: tool.name,\n title: tool.title,\n}));\n\n/** One `resources/list` entry: a page served as `text/markdown`. */\ninterface PageResource {\n description?: string;\n mimeType: string;\n name: string;\n title: string;\n uri: string;\n}\n\n/**\n * A page's resource URI. Resource URIs must be absolute, so this is the page's\n * served URL when a site is configured (the same URL `search_docs` and\n * `list_pages` emit, so an agent can hand either back to `resources/read`),\n * and a `blume:` URI carrying the based route otherwise.\n */\nconst resourceUri = (route: string, data: McpData): string =>\n data.site\n ? urlFor(route, data)\n : `${LOCAL_RESOURCE_SCHEME}${mountBasePath(data.base, route)}`;\n\n/** The `pages` key a resource URI (either form, or a bare route) names. */\nconst resourceRoute = (uri: string, data: McpData): string =>\n normalizeRoute(\n uri.startsWith(LOCAL_RESOURCE_SCHEME)\n ? uri.slice(LOCAL_RESOURCE_SCHEME.length)\n : uri,\n data\n );\n\n/**\n * The `tools/call` params, as far as the server reads them before dispatch:\n * each tool validates its own `arguments` against `TOOL_INPUTS`.\n */\nconst TOOL_CALL_PARAMS = z.object({\n arguments: z.record(z.string(), z.unknown()).optional(),\n name: z.string(),\n});\n\n/** A tool call's `arguments` object, before the tool's own validation. */\ntype ToolArguments = NonNullable<\n z.output<typeof TOOL_CALL_PARAMS>[\"arguments\"]\n>;\n\n/** A tool call's text result, marked as an error when `isError` is set. */\nconst text = (value: string, isError = false) => {\n const content = [{ text: value, type: \"text\" as const }];\n return isError ? { content, isError: true } : { content };\n};\n\n/** Construct a fresh MCP server with Blume's read-only docs tools registered. */\nexport const buildServer = (\n data: McpData,\n index: OramaIndexProvider\n): Server => {\n const capabilities = { resources: {}, tools: {} };\n const serverOptions: ServerOptions = data.instructions\n ? { capabilities, instructions: data.instructions }\n : { capabilities };\n const server = new Server(\n { name: data.name, version: data.version },\n serverOptions\n );\n\n server.setRequestHandler(ListToolsRequestSchema, () => ({\n tools: TOOL_DEFINITIONS,\n }));\n\n // Every page doubles as a resource, so a client that attaches context by\n // URI (rather than calling tools) can browse and read the docs too. The\n // list is the same route set `list_pages` returns; reading one serves the\n // same agent Markdown `get_page` does.\n server.setRequestHandler(ListResourcesRequestSchema, () => ({\n resources: data.routes.map((route) => {\n const resource: PageResource = {\n mimeType: RESOURCE_MIME_TYPE,\n name: route.title,\n title: route.title,\n uri: resourceUri(route.route, data),\n };\n if (route.description) {\n resource.description = route.description;\n }\n return resource;\n }),\n }));\n\n server.setRequestHandler(ReadResourceRequestSchema, (request) => {\n const { uri } = request.params;\n const markdown = getPageMarkdown(data, resourceRoute(uri, data));\n if (markdown === undefined) {\n throw new McpError(\n RESOURCE_NOT_FOUND,\n `No page found at \"${uri}\". Use resources/list or list_pages to find valid URIs.`\n );\n }\n return {\n contents: [{ mimeType: RESOURCE_MIME_TYPE, text: markdown, uri }],\n };\n });\n\n const callTool = async (name: string, args: ToolArguments) => {\n if (name === \"search_docs\") {\n const results = await searchDocs(\n data,\n index,\n TOOL_INPUTS.search_docs.parse(args)\n );\n return text(JSON.stringify(results, null, 2));\n }\n\n if (name === \"get_page\") {\n const input = TOOL_INPUTS.get_page.parse(args);\n const key = normalizeRoute(input.route, data);\n const markdown = getPageMarkdown(data, key);\n if (markdown === undefined) {\n return text(\n `No page found at \"${key}\". Use list_pages or search_docs to find valid routes.`,\n true\n );\n }\n return text(markdown);\n }\n\n if (name === \"list_pages\") {\n const listing = listPages(data, TOOL_INPUTS.list_pages.parse(args));\n return text(JSON.stringify(listing, null, 2));\n }\n\n if (name === \"get_navigation\") {\n const result = getNavigation(\n data,\n TOOL_INPUTS.get_navigation.parse(args)\n );\n if (\"error\" in result) {\n return text(result.error, true);\n }\n return text(JSON.stringify(result.navigation, null, 2));\n }\n\n // The MCP spec answers an unknown tool with a protocol error, not a\n // failed tool result.\n throw new McpError(ErrorCode.InvalidParams, `Unknown tool: ${name}`);\n };\n\n // `tools/call` goes through the fallback handler rather than a registered\n // one: the SDK parses a registered handler's request against its own\n // schema first and reports a malformed call (`arguments` that aren't an\n // object) as -32603 Internal error carrying a raw Zod dump. Reading the\n // params here answers it as -32602 Invalid params with a short message.\n server.fallbackRequestHandler = async (request) => {\n if (request.method !== \"tools/call\") {\n throw new McpError(ErrorCode.MethodNotFound, \"Method not found\");\n }\n const params = TOOL_CALL_PARAMS.safeParse(request.params);\n if (!params.success) {\n throw new McpError(\n ErrorCode.InvalidParams,\n \"Invalid tools/call params: `name` must be a string and `arguments`, when given, an object.\"\n );\n }\n return await callTool(params.data.name, params.data.arguments ?? {});\n };\n\n return server;\n};\n\n/** A JSON-RPC error response the transport would send, for errors raised before it runs. */\nconst jsonRpcError = (\n status: number,\n code: number,\n message: string\n): Response =>\n Response.json(\n { error: { code, message }, id: null, jsonrpc: \"2.0\" },\n { headers: CORS_HEADERS, status }\n );\n\n/**\n * Build a stateless Streamable-HTTP MCP request handler from a data snapshot.\n *\n * The Orama index is built once and reused; a fresh `Server` and transport are\n * created per request (required by the SDK's stateless mode, which skips session\n * tracking). `enableJsonResponse` makes each call a plain request/response — no\n * SSE — which suits read-only docs tools and runs on any adapter (Node, Vercel,\n * Netlify, Cloudflare). CORS is added so browser-based connectors (e.g.\n * claude.ai) can reach the endpoint.\n */\nexport const createMcpFetchHandler = (\n data: McpData\n): ((request: Request) => Promise<Response>) => {\n const index = createIndexProvider(data.documents, data.defaultLocale);\n\n return async (request: Request): Promise<Response> => {\n if (request.method === \"OPTIONS\") {\n return new Response(null, { headers: CORS_HEADERS, status: 204 });\n }\n if (request.method === \"GET\") {\n // No server-initiated streams are needed for read-only tools.\n return new Response(\"Method Not Allowed\", {\n headers: { ...CORS_HEADERS, Allow: \"POST, OPTIONS\" },\n status: 405,\n });\n }\n\n // The transport would read the body with `request.json()`, buffering\n // whatever a client sends; read it under the cap first and hand the\n // transport a copy.\n let forwarded = request;\n if (request.method === \"POST\") {\n const body = await readCappedText(request, MCP_BODY_LIMIT_BYTES);\n if (body === undefined) {\n return jsonRpcError(\n 413,\n ErrorCode.InvalidRequest,\n \"Request too large: the body must be at most 64 KB.\"\n );\n }\n forwarded = new Request(request.url, {\n body,\n headers: request.headers,\n method: \"POST\",\n });\n }\n\n const server = buildServer(data, index);\n const transport = new WebStandardStreamableHTTPServerTransport({\n enableJsonResponse: true,\n // The SDK enables stateless mode only when this is `undefined`; `null` is\n // not an accepted value for the `(() => string) | undefined` option.\n // oxlint-disable-next-line sonarjs/no-undefined-assignment\n sessionIdGenerator: undefined,\n });\n await server.connect(transport);\n const response = await transport.handleRequest(forwarded);\n\n const headers = new Headers(response.headers);\n for (const [key, value] of Object.entries(CORS_HEADERS)) {\n headers.set(key, value);\n }\n return new Response(response.body, {\n headers,\n status: response.status,\n statusText: response.statusText,\n });\n };\n};\n",
|
|
8
|
+
"import { z } from \"zod\";\n\nimport {\n mountBasePath,\n normalizeRoute as normalizePageRoute,\n stripBasePath,\n} from \"../../core/base-path.ts\";\nimport { absoluteUrl } from \"../../core/site-url.ts\";\nimport { trimEnd } from \"../../core/trim.ts\";\nimport type { Navigation } from \"../../core/types.ts\";\nimport { buildOramaIndex, queryOramaIndex } from \"../../search/orama-index.ts\";\nimport type { OramaDoc } from \"../../search/orama-index.ts\";\nimport type { McpData } from \"./data.ts\";\n\n/**\n * The read-only docs operations behind the agent-facing surfaces — search,\n * page lookup, the page listing, and the navigation tree — over an\n * {@link McpData} snapshot. The MCP server (`server.ts`) and the JSON docs API\n * (`ai/api/handlers.ts`) are both thin transports over these, so a tool call\n * and its REST twin can never answer differently. SDK-free on purpose: the\n * prerendered API endpoints import this module without pulling the MCP SDK\n * into their bundle.\n *\n * Each input is defined once in Zod: the runtime parse and the JSON Schema\n * advertised by `tools/list` (via `z.toJSONSchema`) derive from the same\n * definition, so they cannot drift.\n */\n\n/** Default and maximum number of hits returned by a search. */\nexport const DEFAULT_SEARCH_LIMIT = 8;\nexport const MAX_SEARCH_LIMIT = 20;\n/** Excerpt length when a page has no description. */\nconst EXCERPT_LENGTH = 200;\n\n// Each field is a preprocess pipe: the input side accepts the sloppy shapes\n// LLM callers actually send (a bare string for an array field, `[]`/`{}`\n// meaning \"no filter\", out-of-range limits clamped rather than rejected), and\n// the pipe's *output* side is the clean shape — which is exactly what\n// `z.toJSONSchema` emits for `tools/list`. No coercion can ever fail, so a\n// tool call is never rejected on argument shape, matching the previous\n// hand-rolled coercions.\n\n/**\n * The optional content-type filter `search_docs` and `list_pages` share.\n * `[]` or no usable strings mean \"no filter\", not \"match nothing\"; a bare\n * string is accepted as a one-element list.\n */\nconst contentTypesField = z.preprocess((value) => {\n const list = (Array.isArray(value) ? value : [value]).filter(\n (entry): entry is string => typeof entry === \"string\"\n );\n return list.length > 0 ? list : undefined;\n}, z.array(z.string()).optional().describe('Only include pages of these content types (frontmatter `type`, e.g. `[\"doc\", \"rfc\"]`). `list_pages` shows each page\\'s type. Omit to include every type.'));\n\n/**\n * The optional facet filter `search_docs` and `list_pages` share. Only\n * string-valued entries survive; an empty `{}` means \"no filter\".\n */\n/** Accepts any plain object, so the string-valued entries can be sifted out. */\nconst looseFacetObject = z.record(z.string(), z.unknown());\n\nconst filtersField = z.preprocess((value) => {\n const candidate = looseFacetObject.safeParse(value);\n if (!candidate.success) {\n return;\n }\n const entries = Object.entries(candidate.data).filter(\n (entry): entry is [string, string] => typeof entry[1] === \"string\"\n );\n return entries.length > 0 ? Object.fromEntries(entries) : undefined;\n}, z.record(z.string(), z.string()).optional().describe('Only include pages matching every facet, key → required value (e.g. `{\"status\": \"enforced\"}`). Facets are metadata the site declares per content type; `list_pages` shows each page\\'s facet values. Omit for no facet filtering.'));\n\n/** Clamped into range rather than rejected; non-numeric means the default. */\nconst limitField = z.preprocess(\n (value) => {\n // `Number` is the identity on numbers, so one conversion covers both the\n // well-typed call and a numeric string.\n const num = Number(value);\n return Number.isFinite(num)\n ? Math.min(Math.max(Math.trunc(num), 1), MAX_SEARCH_LIMIT)\n : undefined;\n },\n z\n .int()\n .min(1)\n .max(MAX_SEARCH_LIMIT)\n .optional()\n .describe(`Maximum hits to return (default ${DEFAULT_SEARCH_LIMIT}).`)\n);\n\n/** A required text field; a missing or non-string value coerces to \"\". */\nconst textField = (description: string) =>\n z.preprocess((value) => {\n const parsed = z.string().safeParse(value);\n return parsed.success ? parsed.data : \"\";\n }, z.string().describe(description));\n\n/** An optional trimmed text field; blank or non-string means \"absent\". */\nconst optionalTextField = (description: string) =>\n z.preprocess((value) => {\n const parsed = z.string().safeParse(value);\n const trimmed = parsed.success ? parsed.data.trim() : \"\";\n return trimmed || undefined;\n }, z.string().optional().describe(description));\n\n/** The optional locale filter `search_docs` and `list_pages` share. */\nconst localeField = optionalTextField(\n \"Only include pages in this locale (e.g. `fr`). Omit for every language.\"\n);\n\n/** The optional docs-version scope `search_docs` and `list_pages` share. */\nconst versionField = optionalTextField(\n 'Docs version to scope to on a versioned site: `\"latest\"` (the default — current docs only), `\"all\"` (every version), or an archived version id (e.g. `\"v1.0\"`). Ignored when the site is unversioned.'\n);\n\n/** Every tool's input schema — the runtime parse and tools/list source. */\nexport const TOOL_INPUTS = {\n get_navigation: z.object({\n locale: optionalTextField(\n \"Locale whose navigation tree to return (defaults to the default locale).\"\n ),\n version: optionalTextField(\n \"Archived version id whose tree to return (defaults to the current docs).\"\n ),\n }),\n get_page: z.object({\n route: textField(\"The page route, e.g. `/guides/install`.\"),\n }),\n list_pages: z.object({\n contentTypes: contentTypesField,\n filters: filtersField,\n locale: localeField,\n version: versionField,\n }),\n search_docs: z.object({\n contentTypes: contentTypesField,\n filters: filtersField,\n limit: limitField,\n locale: localeField,\n query: textField(\"The search query.\"),\n version: versionField,\n }),\n};\n\n/** One `search_docs` result entry; `version` only appears on versioned sites. */\nexport interface SearchHitPayload {\n contentType: string | undefined;\n excerpt: string;\n facets: Record<string, string> | undefined;\n route: string;\n title: string;\n url: string;\n version?: string;\n}\n\n/** One `list_pages` entry; `version` only appears on versioned sites. */\nexport interface PageListingPayload {\n contentType: string;\n description: string | undefined;\n facets: Record<string, string> | undefined;\n lastModified: string | null;\n route: string;\n title: string;\n url: string;\n version?: string;\n}\n\n/** Whether a page's facet values satisfy every requested filter entry. */\nconst matchesFacets = (\n facets: Record<string, string> | undefined,\n filters: Record<string, string>\n): boolean =>\n Object.entries(filters).every(([key, value]) => facets?.[key] === value);\n\n/**\n * Resolve the `version` scope on a versioned site: `undefined` disables the\n * filter (`\"all\"`), `\"\"` is the current docs (the default — agents almost\n * always want the live documentation), and anything else is an archived id\n * (an unknown id simply matches nothing). On an unversioned site the input is\n * ignored entirely. The input arrives pre-trimmed (blank coerced to absent)\n * from the tool's input schema.\n */\nconst asVersionScope = (\n value: string | undefined,\n data: McpData\n): string | undefined => {\n if (!data.archivedVersions) {\n return;\n }\n if (value === \"all\") {\n return;\n }\n if (value === undefined || value === \"latest\" || value === \"current\") {\n return \"\";\n }\n return value;\n};\n\n/**\n * Error message for a `get_navigation` version id that isn't a configured\n * archived version, or `null` when the id is valid (or the site is\n * unversioned, where the id is ignored like the other tools' scopes). Unlike\n * `asVersionScope`'s match-nothing filters, a bad id here would otherwise\n * silently return the *current* tree posing as the requested snapshot.\n */\nconst unknownVersionError = (\n versionId: string | undefined,\n data: McpData\n): string | null =>\n versionId &&\n data.archivedVersions &&\n !data.archivedVersions.includes(versionId)\n ? `Unknown version \"${versionId}\". Archived versions: ${data.archivedVersions.join(\", \")}.`\n : null;\n\n/**\n * Normalize a user-supplied route to a `pages` key (`/`, `/a/b`, no suffix).\n * Accepts a full URL too — `search_docs` hits and llms.txt entries carry\n * `site` + `deployment.base`, and an agent following \"pass a route from\n * `search_docs`\" will hand one straight back — reducing it to its base-less,\n * percent-decoded path.\n */\nexport const normalizeRoute = (input: string, data: McpData): string => {\n let value = input.trim();\n if (/^https?:\\/\\//iu.test(value)) {\n try {\n value = new URL(value).pathname;\n } catch {\n // Not parseable as a URL after all; treat it as a path.\n }\n }\n try {\n value = decodeURI(value);\n } catch {\n // Malformed percent sequence — compare it as written.\n }\n // Trailing slashes come off before the suffix so `/a/b.md/` still loses its\n // `.md`; normalizePageRoute then settles the leading slash.\n const noSuffix = trimEnd(value, \"/\").replace(/\\.mdx?$/u, \"\");\n return stripBasePath(data.base, normalizePageRoute(noSuffix));\n};\n\n/** Build the absolute (or root-relative) URL for a route. */\nexport const urlFor = (route: string, data: McpData): string => {\n // Routes are base-less manifest paths; layer `deployment.base` on top so the\n // URL matches where the page is served (the sitemap/llms.txt convention).\n const path = mountBasePath(data.base, route);\n // Concatenate rather than `new URL(path, site)` — a root-absolute path\n // would drop the base path of a subpath deployment (`acme.com/docs`).\n return data.site ? absoluteUrl(data.site, path) : path;\n};\n\n/** A hit's excerpt: its description, else the head of its content with an\n * ellipsis only when something was actually cut off. */\nconst excerptFor = (doc: OramaDoc): string => {\n if (doc.description) {\n return doc.description;\n }\n const head = doc.content.slice(0, EXCERPT_LENGTH).trim();\n return doc.content.length > EXCERPT_LENGTH ? `${head}…` : head;\n};\n\n/** Lazily builds the Orama index over a snapshot's documents, once. */\nexport type OramaIndexProvider = () => Promise<\n Awaited<ReturnType<typeof buildOramaIndex>>\n>;\n\n/**\n * Memoize the search index so every server built from a snapshot shares it.\n * `locale` is the snapshot's `defaultLocale`, forwarded so non-Latin scripts\n * (Japanese and Chinese, but equally Cyrillic, Greek, Hebrew, Devanagari…)\n * get a word-segmenting tokenizer.\n */\nexport const createIndexProvider = (\n documents: OramaDoc[],\n locale?: string\n): OramaIndexProvider => {\n let dbPromise: ReturnType<OramaIndexProvider> | null = null;\n return function provideIndex() {\n dbPromise ??= buildOramaIndex(documents, locale);\n return dbPromise;\n };\n};\n\n/** Full-text search over the snapshot; the `search_docs` operation. */\nexport const searchDocs = async (\n data: McpData,\n index: OramaIndexProvider,\n input: z.output<typeof TOOL_INPUTS.search_docs>\n): Promise<SearchHitPayload[]> => {\n const db = await index();\n const hits = await queryOramaIndex(\n db,\n input.query,\n input.limit ?? DEFAULT_SEARCH_LIMIT,\n {\n contentTypes: input.contentTypes,\n facets: input.filters,\n locale: input.locale,\n version: asVersionScope(input.version, data),\n }\n );\n // `route` is the key `get_page` takes (the tool descriptions promise\n // it); `url` is where the page is served.\n return hits.map((doc: OramaDoc) => {\n const hit: SearchHitPayload = {\n contentType: doc.contentType,\n excerpt: excerptFor(doc),\n facets: doc.facets,\n route: doc.route,\n title: doc.title,\n url: urlFor(doc.route, data),\n };\n if (data.archivedVersions) {\n hit.version = doc.version ?? \"\";\n }\n return hit;\n });\n};\n\n/** A page's agent Markdown, or `undefined` when no page has the route. */\nexport const getPageMarkdown = (\n data: McpData,\n route: string\n): string | undefined => data.pages[route];\n\n/** Every non-hidden route matching the filters; the `list_pages` operation. */\nexport const listPages = (\n data: McpData,\n input: z.output<typeof TOOL_INPUTS.list_pages>\n): PageListingPayload[] => {\n const { contentTypes, filters, locale } = input;\n const versionScope = asVersionScope(input.version, data);\n return data.routes\n .filter(\n (route) =>\n (!contentTypes || contentTypes.includes(route.contentType)) &&\n (!filters || matchesFacets(route.facets, filters)) &&\n (!locale || route.locale === locale) &&\n (versionScope === undefined || route.version === versionScope)\n )\n .map((route) => {\n const listing: PageListingPayload = {\n contentType: route.contentType,\n description: route.description,\n facets: route.facets,\n lastModified: route.lastModified,\n route: route.route,\n title: route.title,\n url: urlFor(route.route, data),\n };\n if (data.archivedVersions) {\n listing.version = route.version;\n }\n return listing;\n });\n};\n\n/**\n * The navigation tree for a locale and version; the `get_navigation`\n * operation. A version id selects the snapshot's tree; a locale selects its\n * language (falling back through the default locale to any tree the snapshot\n * has). Without a version, a locale selects the current docs' localized\n * tree. An unknown id on a versioned site is an error string — the current\n * tree would silently masquerade as the requested snapshot.\n */\nexport const getNavigation = (\n data: McpData,\n input: z.output<typeof TOOL_INPUTS.get_navigation>\n): { error: string } | { navigation: Navigation } => {\n const { locale, version: versionId } = input;\n const unknownVersion = unknownVersionError(versionId, data);\n if (unknownVersion) {\n return { error: unknownVersion };\n }\n let { navigation } = data;\n const byLocale = versionId\n ? data.navigationByVersion?.[versionId]\n : undefined;\n if (byLocale) {\n navigation =\n (locale ? byLocale[locale] : undefined) ??\n byLocale[data.defaultLocale ?? \"\"] ??\n Object.values(byLocale)[0] ??\n navigation;\n } else if (locale && data.navigationByLocale?.[locale]) {\n navigation = data.navigationByLocale[locale];\n }\n return { navigation };\n};\n",
|
|
9
|
+
"import { create, insertMultiple, search } from \"@orama/orama\";\nimport type {\n AnyOrama,\n EnumArrComparisonOperator,\n EnumComparisonOperator,\n Tokenizer,\n} from \"@orama/orama\";\n\n/**\n * The minimal document shape both the client-side search dialog and the\n * server-side MCP `search_docs` tool index. Mirrors the `blume-search.json`\n * entries built by `buildSearchDocuments`.\n */\nexport interface OramaDoc {\n content: string;\n description: string;\n route: string;\n title: string;\n /** Locale code; indexed as an enum so queries can filter to one language. */\n locale?: string;\n /**\n * Docs version; indexed as an enum so queries can filter to one version.\n * The current docs carry `\"\"`, which the enum stores and matches exactly.\n */\n version?: string;\n /** Resolved page `type`; indexed as an enum so queries can filter by type. */\n contentType?: string;\n /** Declared facet values (`content.types.<type>.facets`), key → value. */\n facets?: Record<string, string>;\n /** Carried through for the search dialog's breadcrumb + filter pills. Stored\n * but not indexed, so they ride along on the returned document untouched. */\n breadcrumb?: string[];\n section?: string;\n /** The page's relevance multiplier (`search.boost`); stored, not indexed. */\n boost?: number;\n /** Extra terms the page is found by (`search.keywords`). */\n keywords?: string[];\n}\n\nconst SCHEMA = {\n content: \"string\",\n // Enums (not full-text \"string\") so `where` does an exact-match filter.\n contentType: \"enum\",\n description: \"string\",\n // Facets, flattened to `key:value` terms — enum[] so one static schema\n // serves every project's facet keys, with `containsAll` matching a filter\n // set. Derived from `facets` at insert time.\n facetTerms: \"enum[]\",\n keywords: \"string[]\",\n locale: \"enum\",\n route: \"string\",\n title: \"string\",\n version: \"enum\",\n} as const;\n\n/** Flatten a facet map to the `key:value` terms the `facetTerms` enum holds. */\nconst toFacetTerms = (facets: Record<string, string>): string[] =>\n Object.entries(facets).map(([key, value]) => `${key}:${value}`);\n\n/**\n * Title and description outrank body text, matching the search dialog; a\n * page's keywords count as much as its title, since its author chose them.\n */\nconst BOOST = { description: 2, keywords: 3, title: 3 };\n\n/** Databases holding a boosted page, which rank by boosted score. */\nconst boostedDatabases = new WeakSet<AnyOrama>();\n\n/** A search match as Orama's sort function sees it: id, score, document. */\ntype RankedMatch = [unknown, number, OramaDoc];\n\n/** Rank matches by relevance times the page's `search.boost`. */\nconst byBoostedScore = (a: RankedMatch, b: RankedMatch): number =>\n b[1] * (b[2].boost ?? 1) - a[1] * (a[2].boost ?? 1);\n\n/**\n * The script whose text Orama's default tokenizer keeps mostly intact. Its\n * delimiter class is `/[^A-Za-zàèéìòóù0-9_'-]+/`, so every character outside\n * that set counts as a separator: text in any other script collapses to zero\n * tokens and every query silently returns no hits. Unspaced scripts are the\n * best-known casualty, but the failure is not about spacing — Russian, Greek,\n * Hebrew and Hindi lose their tokens the same way Japanese does.\n */\nconst LATIN_SCRIPT = \"Latn\";\n\n/**\n * Parse a locale tag, tolerating the legacy forms that reach here from\n * hand-written config: underscores (`ru_RU`), POSIX suffixes (`ja_JP.UTF-8`,\n * `zh_TW@Big5`), and extlang tags ICU rejects (`zh-cmn-Hans`). The POSIX\n * codeset/modifier suffix is dropped first — it carries no BCP 47 meaning,\n * and dropping it keeps an explicit script subtag in play: `az_Cyrl.UTF-8`\n * must resolve to `Cyrl`, not fall back to `az` and maximize to Latin.\n * `Intl.Locale` still throws on extlang forms, so a failed parse retries with\n * the primary language subtag alone — enough to resolve the script, which is\n * all that gates the tokenizer. Returns `undefined` when even that subtag is\n * unparseable.\n */\nconst parseLocale = (tag: string): Intl.Locale | undefined => {\n const hyphenated = tag.replace(/[.@].*$/u, \"\").replaceAll(\"_\", \"-\");\n try {\n return new Intl.Locale(hyphenated);\n } catch {\n // Retry below with the primary subtag.\n }\n const [primary = \"\"] = hyphenated.split(\"-\");\n try {\n return new Intl.Locale(primary);\n } catch {\n return undefined;\n }\n};\n\n/**\n * The maximized locale — script and language filled in from CLDR likely-subtags\n * and alias data, so `ru` resolves to `Cyrl`, `cmn` to the canonical `zh`, and\n * an explicit script subtag is honored: `sr-Latn` reports `Latn` while\n * `az-Cyrl` reports `Cyrl`. `undefined` for tags {@link parseLocale} cannot\n * salvage; a well-formed tag ICU knows nothing about keeps an `undefined`\n * script instead.\n */\nconst resolveLocale = (tag: string): Intl.Locale | undefined =>\n parseLocale(tag)?.maximize();\n\n/**\n * Indexes whose language maximizes to one of these scripts are built as\n * character bigrams rather than whole segments, and queried to match\n * accordingly. Japanese and Chinese write compounds in {@link BIGRAM_SCRIPTS}\n * without delimiters, and the writing system — not the language subtag — is\n * what carries that convention: `yue` (Cantonese) maximizes to `Hant` and\n * needs bigrams the same way `zh` does. Korean maximizes to `Kore` and Thai\n * to `Thai`; Korean separates words with spaces and Thai has no comparable\n * bigram convention, so both keep the plain segmented tokens even where a\n * page mixes in Han or kana.\n *\n * Dictionary segmentation alone drops the adjacency that makes a compound term\n * distinctive: 資金決済法 becomes 資金 / 決済 / 法, and because Orama scores a\n * bag of words, a page that merely mentions each fragment somewhere outranks\n * the page about the law itself. Bigrams put that adjacency back as index\n * terms, and dropping the whole-segment tokens keeps a fragment as common as\n * 法 from matching on its own.\n */\nconst BIGRAM_INDEX_SCRIPTS = new Set([\"Hans\", \"Hant\", \"Jpan\"]);\n\n/**\n * Whether the index keyed to this tokenizer language is built from bigrams.\n * {@link segmentingTokenizer} stores the canonical maximized language, so the\n * builder and the strict pass in {@link queryOramaIndex} share this predicate\n * — an index is never built from bigrams that the query side then matches\n * loosely, or vice versa.\n */\nconst isBigramLanguage = (language: string): boolean => {\n const script = resolveLocale(language)?.script;\n return script !== undefined && BIGRAM_INDEX_SCRIPTS.has(script);\n};\n\n/**\n * Segments written entirely in these scripts are the ones re-cut into bigrams,\n * matching the scripts Lucene's CJK analyzer bigrams. Property escapes rather\n * than ranges, so ideographs outside the basic plane are covered as well —\n * 𠮟, the 常用漢字表 form of しかる, is one. The literals that follow belong to\n * no script of their own but appear only inside such words: the iteration\n * marks, the prolonged sound mark, and the halfwidth voiced sound marks.\n */\nconst BIGRAM_SCRIPTS =\n /^[\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}々〆〇ー゙゚]+$/u;\n\n/**\n * One index term inside a word-like segment. Being word-like does not make a\n * segment all letters: UAX #29 keeps connector punctuation, format characters\n * and mid-number punctuation *within* a word, so `Intl.Segmenter` reports\n * スネーク_ケース and robots.txt as one segment each. A term is a run of\n * letters, combining marks and digits. Marks are spelling, not punctuation —\n * Thai writes vowels and tones as combining marks, so dropping them leaves\n * consonant skeletons that collapse distinct words (เสื้อ, shirt, and เสือ,\n * tiger, differ by one mark). Two separators stay where the surrounding text\n * makes them part of the word: an apostrophe followed by a letter (don't),\n * and a decimal point or thousands separator flanked by digits (1.0.3,\n * 1,000) — split, either would leave one-letter and one-digit fragments that\n * co-occur on unrelated pages.\n */\nconst TERM =\n /[\\p{L}\\p{M}\\p{N}]+(?:(?:['’](?=\\p{L})|(?<=\\p{N})[.,](?=\\p{N}))[\\p{L}\\p{M}\\p{N}]+)*/gu;\n\n/**\n * A term written entirely in Latin script (plus digits and the separators\n * {@link TERM} keeps within a word). Orama's default tokenizer folds the\n * accented vowels it recognizes (café → cafe), so a segmented index folds\n * Latin terms too — otherwise switching a Cyrillic- or Greek-default site to\n * the segmenting tokenizer would silently drop the unaccented-query matches\n * the default tokenizer provided. Only all-Latin terms fold: marks are\n * spelling elsewhere (Thai vowels and tones; the breve that separates\n * Cyrillic й from и), so a term carrying any other script keeps its marks.\n */\nconst LATIN_TERM = /^[\\p{Script=Latin}\\p{N}'’.,]+$/u;\n\nconst MARKS = /\\p{M}+/gu;\n\nconst foldDiacritics = (term: string): string =>\n LATIN_TERM.test(term) ? term.normalize(\"NFD\").replace(MARKS, \"\") : term;\n\n/**\n * Emit every overlapping 2-character window of `run`, or the lone character.\n * Windows are cut by code point: an ideograph outside the basic plane is a\n * surrogate pair, and slicing by code unit would split it into halves that\n * match nothing.\n *\n * Dropping the whole-segment tokens means a single-character query reaches\n * only pages where the character opens a bigram: a run-final 法 sits in 示法,\n * which the query 法 does not prefix-match. Lucene's CJK analyzer shares this\n * property; indexing lone characters alongside the bigrams would reinvite the\n * fragment noise this file exists to remove.\n */\nconst addBigrams = (run: string, tokens: Set<string>): void => {\n const characters = [...run];\n if (characters.length === 1) {\n tokens.add(run);\n return;\n }\n let previous = \"\";\n for (const character of characters) {\n if (previous) {\n tokens.add(previous + character);\n }\n previous = character;\n }\n};\n\n/**\n * `Intl.Segmenter` is missing on some runtimes even though the lib type\n * declares it, so the constructor's presence is probed before use.\n */\nconst hasSegmenter = (\n segmenter: typeof Intl.Segmenter | undefined\n): segmenter is typeof Intl.Segmenter => typeof segmenter === \"function\";\n\n/**\n * A word-segmenting tokenizer for languages the default splitter can't handle,\n * built on `Intl.Segmenter` (the same engine `@orama/tokenizers` wraps).\n * Input is NFC-normalized and lowercased before segmenting — unlike the\n * upstream tokenizers — so decomposed text (macOS filenames, some CMS\n * pipelines) indexes the same terms a composed query produces, and Latin\n * terms (\"GDPR\", English pages on a mixed-locale site) still match\n * case-insensitively, with their diacritics folded by\n * {@link foldDiacritics}. Returns `undefined` for scripts the default\n * tokenizer already serves ({@link resolveLocale} decides, so `sr-Latn` keeps\n * the default while `az-Cyrl` is segmented), and on runtimes without\n * `Intl.Segmenter`, where the caller falls back to Orama's default.\n *\n * On a {@link BIGRAM_INDEX_SCRIPTS} index, runs of adjacent\n * {@link BIGRAM_SCRIPTS} segments are joined and re-cut into character\n * bigrams; everything else (Latin, digits, and every segment on a Korean or\n * Thai index) is emitted one {@link TERM} at a time. Separators end a run\n * either way — whether they stand between segments, as 「クーリング・オフ」\n * does, or inside one.\n */\nconst segmentingTokenizer = (locale?: string): Tokenizer | undefined => {\n const resolved = resolveLocale(locale ?? \"\");\n if (!resolved?.script || resolved.script === LATIN_SCRIPT) {\n return;\n }\n if (!hasSegmenter(Intl.Segmenter)) {\n return;\n }\n // The canonical maximized language (`cmn` → `zh`), so the bigram predicate\n // here and the strict query pass read the same name.\n const { language } = resolved;\n const segmenter = new Intl.Segmenter(language, { granularity: \"word\" });\n const bigram = isBigramLanguage(language);\n return {\n language,\n normalizationCache: new Map(),\n tokenize: (raw: string): string[] => {\n const tokens = new Set<string>();\n let run = \"\";\n const flush = (): void => {\n if (run) {\n addBigrams(run, tokens);\n run = \"\";\n }\n };\n const take = (term: string): void => {\n if (bigram && BIGRAM_SCRIPTS.test(term)) {\n run += term;\n return;\n }\n flush();\n tokens.add(foldDiacritics(term));\n };\n for (const segment of segmenter.segment(\n raw.normalize(\"NFC\").toLowerCase()\n )) {\n if (!segment.isWordLike) {\n flush();\n continue;\n }\n let end = 0;\n for (const match of segment.segment.matchAll(TERM)) {\n // A gap means punctuation stood there, which ends the run as surely\n // as a non-word-like segment would: スネーク_ケース pairs either side\n // of the connector, never across it.\n if (match.index > end) {\n flush();\n }\n take(match[0]);\n end = match.index + match[0].length;\n }\n if (end < segment.segment.length) {\n flush();\n }\n }\n flush();\n return [...tokens];\n },\n };\n};\n\n/**\n * Build an in-memory Orama full-text index from search documents. Shared by the\n * Orama client loader (browser), the MCP server, and assistant grounding (Node),\n * so ranking is identical wherever docs are queried. `locale` — the site's\n * `i18n.defaultLocale` — swaps in a word-segmenting tokenizer for every\n * non-Latin script, all of which Orama's default tokenizer reduces to zero\n * tokens; the tokenizer belongs to the database, so on a mixed-locale site it\n * applies to every document. That is safe in one direction only: Latin words\n * survive segmentation intact, so English pages on a segmented index stay\n * searchable, but non-Latin translations on a Latin-default index still\n * collapse to zero tokens.\n */\nexport const buildOramaIndex = async (\n documents: OramaDoc[],\n locale?: string\n): Promise<AnyOrama> => {\n const tokenizer = segmentingTokenizer(locale);\n const db = tokenizer\n ? create({ components: { tokenizer }, schema: SCHEMA })\n : create({ schema: SCHEMA });\n await insertMultiple(\n db,\n documents.map((doc) =>\n doc.facets ? { ...doc, facetTerms: toFacetTerms(doc.facets) } : doc\n )\n );\n if (documents.some((doc) => (doc.boost ?? 1) !== 1)) {\n boostedDatabases.add(db);\n }\n return db;\n};\n\n/** Orama keeps only documents matching every token at a threshold of 0. */\nconst ALL_TOKENS = 0;\n\n/** Optional exact-match filters applied to a query via Orama's `where`. */\nexport interface OramaQueryFilters {\n /** Keep only documents whose `contentType` is in this list. */\n contentTypes?: string[];\n /**\n * Keep only documents matching every facet, key → required value. Facet\n * keys and values come from the `facets` field on the indexed documents.\n */\n facets?: Record<string, string>;\n /** Keep only documents in this locale. */\n locale?: string;\n /**\n * Keep only documents of this docs version (`\"\"` is the current docs — a\n * meaningful filter value, so absence alone disables version filtering).\n */\n version?: string;\n}\n\n/**\n * The exact-match `where` clause the filters compile to. Orama types `where`\n * openly (any schema property to an operator), mirrored here by the index\n * signature; this module only ever emits the two enum operators.\n */\ninterface OramaWhereClause {\n [property: string]:\n | EnumArrComparisonOperator\n | EnumComparisonOperator\n | undefined;\n}\n\n/**\n * Query the index, returning the matching documents (highest-ranked first).\n * `filters` narrows results by exact `where` matches on the enum fields:\n * `locale` to one language, `contentTypes` to a set of page types, `facets`\n * to documents carrying every requested `key:value` term.\n *\n * On a bigrammed index the strict pass runs first: a term is only meant to\n * match where its bigrams sit together, and scoring them independently lets a\n * page sharing a couple of windows outrank the page the term is about. Terms\n * spanning several words rarely appear in full on one page, so an empty strict\n * result falls back to the default pass rather than reporting no matches.\n */\nexport const queryOramaIndex = async (\n db: AnyOrama,\n term: string,\n limit: number,\n filters?: OramaQueryFilters\n): Promise<OramaDoc[]> => {\n const facetTerms = filters?.facets ? toFacetTerms(filters.facets) : [];\n const where: OramaWhereClause = {};\n if (filters?.locale) {\n where.locale = { eq: filters.locale };\n }\n // `\"\"` (the current docs) is a real filter value, so test for presence.\n if (filters?.version !== undefined) {\n where.version = { eq: filters.version };\n }\n if (filters?.contentTypes && filters.contentTypes.length > 0) {\n where.contentType = { in: filters.contentTypes };\n }\n if (facetTerms.length > 0) {\n where.facetTerms = { containsAll: facetTerms };\n }\n // Boosts multiply every match's score before the limit applies (Orama\n // sorts the whole match set with a sort function), so a boosted page can\n // rise past matches outside the first page.\n const unfiltered = {\n boost: BOOST,\n limit,\n properties: [\"title\", \"keywords\", \"description\", \"content\"],\n ...(boostedDatabases.has(db) && { sortBy: byBoostedScore }),\n term,\n };\n const params =\n Object.keys(where).length > 0 ? { ...unfiltered, where } : unfiltered;\n const bigrammed = isBigramLanguage(db.tokenizer?.language ?? \"\");\n // The result-document generic is OramaDoc because `buildOramaIndex` is the\n // only writer to this database and inserts OramaDoc records (plus the\n // derived `facetTerms`).\n const strict = bigrammed\n ? await search<AnyOrama, OramaDoc>(db, { ...params, threshold: ALL_TOKENS })\n : undefined;\n const found =\n strict && strict.hits.length > 0\n ? strict\n : await search<AnyOrama, OramaDoc>(db, params);\n return found.hits.map((hit) => hit.document);\n};\n"
|
|
10
|
+
],
|
|
11
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAEA;;;ACFA;AAGA;;;ACHA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,cAAS;;;ACVT;;;ACAA;AAuCA,IAAM,SAAS;AAAA,EACb,SAAS;AAAA,EAET,aAAa;AAAA,EACb,aAAa;AAAA,EAIb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AACX;AAGA,IAAM,eAAe,CAAC,WACpB,OAAO,QAAQ,MAAM,EAAE,IAAI,EAAE,KAAK,WAAW,GAAG,OAAO,OAAO;AAMhE,IAAM,QAAQ,EAAE,aAAa,GAAG,UAAU,GAAG,OAAO,EAAE;AAGtD,IAAM,mBAAmB,IAAI;AAM7B,IAAM,iBAAiB,CAAC,GAAgB,MACtC,EAAE,MAAM,EAAE,GAAG,SAAS,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS;AAUnD,IAAM,eAAe;AAcrB,IAAM,cAAc,CAAC,QAAyC;AAAA,EAC5D,MAAM,aAAa,IAAI,QAAQ,YAAY,EAAE,EAAE,WAAW,KAAK,GAAG;AAAA,EAClE,IAAI;AAAA,IACF,OAAO,IAAI,KAAK,OAAO,UAAU;AAAA,IACjC,MAAM;AAAA,EAGR,OAAO,UAAU,MAAM,WAAW,MAAM,GAAG;AAAA,EAC3C,IAAI;AAAA,IACF,OAAO,IAAI,KAAK,OAAO,OAAO;AAAA,IAC9B,MAAM;AAAA,IACN;AAAA;AAAA;AAYJ,IAAM,gBAAgB,CAAC,QACrB,YAAY,GAAG,GAAG,SAAS;AAoB7B,IAAM,uBAAuB,IAAI,IAAI,CAAC,QAAQ,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",
|
|
13
|
+
"names": []
|
|
14
|
+
}
|
|
@@ -2,30 +2,32 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ensureGitignore
|
|
4
4
|
} from "./chunk-yzhm0j9q.js";
|
|
5
|
-
import"./chunk-
|
|
5
|
+
import"./chunk-xkz5xbtv.js";
|
|
6
6
|
import {
|
|
7
7
|
commandMeta,
|
|
8
8
|
logger
|
|
9
9
|
} from "./index.js";
|
|
10
10
|
import {
|
|
11
11
|
refuseIfDevRunning
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import"./chunk-
|
|
14
|
-
import"./chunk-
|
|
12
|
+
} from "./chunk-cmtcnh9f.js";
|
|
13
|
+
import"./chunk-zccbjcj0.js";
|
|
14
|
+
import"./chunk-4h8z9vv5.js";
|
|
15
15
|
import {
|
|
16
16
|
refuseIfEjected
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import"./chunk-
|
|
19
|
-
import"./chunk-
|
|
20
|
-
import"./chunk-
|
|
17
|
+
} from "./chunk-py62fewh.js";
|
|
18
|
+
import"./chunk-zf748avv.js";
|
|
19
|
+
import"./chunk-2f3ndkpw.js";
|
|
20
|
+
import"./chunk-43zcf4gz.js";
|
|
21
|
+
import"./chunk-ta27feev.js";
|
|
21
22
|
import"./chunk-jq5n4avg.js";
|
|
22
|
-
import"./chunk-
|
|
23
|
-
import"./chunk-
|
|
24
|
-
import"./chunk-
|
|
23
|
+
import"./chunk-cm89scdv.js";
|
|
24
|
+
import"./chunk-2f7n4qzt.js";
|
|
25
|
+
import"./chunk-amrb6hgh.js";
|
|
25
26
|
import {
|
|
26
27
|
prepareProject
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import"./chunk-
|
|
28
|
+
} from "./chunk-5ffywsmb.js";
|
|
29
|
+
import"./chunk-cy5bm0j0.js";
|
|
30
|
+
import"./chunk-6bm0xpgd.js";
|
|
29
31
|
|
|
30
32
|
// src/cli/commands/check.ts
|
|
31
33
|
import { existsSync } from "node:fs";
|
|
@@ -87,5 +89,5 @@ export {
|
|
|
87
89
|
checkCommand
|
|
88
90
|
};
|
|
89
91
|
|
|
90
|
-
//# debugId=
|
|
91
|
-
//# sourceMappingURL=chunk-
|
|
92
|
+
//# debugId=0A78EAC2005AB23B64756E2164756E21
|
|
93
|
+
//# sourceMappingURL=chunk-9geymqns.js.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import { existsSync } from \"node:fs\";\n\nimport { check } from \"@astrojs/check\";\nimport { sync } from \"astro\";\nimport { defineCommand } from \"citty\";\nimport { join } from \"pathe\";\n\nimport { ensureGitignore } from \"../../core/gitignore.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport { refuseIfDevRunning } from \"../dev-lock.ts\";\nimport { refuseIfEjected } from \"../eject-scripts.ts\";\nimport { logger } from \"../log.ts\";\nimport { prepareProject } from \"../prepare.ts\";\n\nexport const checkCommand = defineCommand({\n args: {\n isolated: {\n description:\n \"Type-check in an isolated .blume-verify runtime so a running dev server is untouched. For verifying changes while `blume dev` runs.\",\n type: \"boolean\",\n },\n preview: {\n description: \"Include drafts and unpublished CMS content.\",\n type: \"boolean\",\n },\n strict: {\n description: \"Fail on content diagnostics as well as type errors.\",\n type: \"boolean\",\n },\n },\n meta: commandMeta.check,\n async run({ args }) {\n const root = process.cwd();\n await refuseIfEjected(root, \"check\");\n\n // `blume check` regenerates `.blume` just like `build`, so it must refuse a\n // live dev server unless isolated. `--isolated` (or BLUME_RUNTIME_DIR)\n // relocates the runtime to `.blume-verify`, which dev never locks.\n const runtimeDir = args.isolated\n ? \".blume-verify\"\n : process.env.BLUME_RUNTIME_DIR;\n refuseIfDevRunning(root, \"checking\", { isolatedHint: true, runtimeDir });\n if (args.isolated) {\n await ensureGitignore(root, [\".blume-verify/\"]);\n }\n\n const project = await prepareProject({\n mode: \"build\",\n preview: args.preview,\n root,\n runtimeDir,\n strict: args.strict,\n strictOptIn: true,\n });\n\n const { outDir } = project.context;\n\n // Generate Astro's content/collection and font types into `.blume/.astro`\n // so `astro:*` virtual modules resolve during the check.\n await sync({ logLevel: \"warn\", root: outDir });\n\n // The project-root tsconfig is what covers the authored `pages/` and config;\n // without it astro check only sees the generated `.blume` project. Falls back\n // to the generated project's own tsconfig when the project has none.\n const tsconfig = join(root, \"tsconfig.json\");\n\n logger.start(`Type-checking ${project.graph.pages.length} page(s)`);\n const failed = await check({\n minimumFailingSeverity: \"error\",\n minimumSeverity: \"hint\",\n root: outDir,\n tsconfig: existsSync(tsconfig) ? tsconfig : undefined,\n watch: false,\n });\n\n if (failed) {\n logger.error(\"Type check failed.\");\n process.exit(1);\n }\n\n logger.success(\"No type errors.\");\n },\n});\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AACA;AACA;AASO,IAAM,eAAe,cAAc;AAAA,EACxC,MAAM;AAAA,IACJ,UAAU;AAAA,MACR,aACE;AAAA,MACF,MAAM;AAAA,IACR;AAAA,IACA,SAAS;AAAA,MACP,aAAa;AAAA,MACb,MAAM;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACN,aAAa;AAAA,MACb,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,MAAM,YAAY;AAAA,OACZ,IAAG,GAAG,QAAQ;AAAA,IAClB,MAAM,OAAO,QAAQ,IAAI;AAAA,IACzB,MAAM,gBAAgB,MAAM,OAAO;AAAA,IAKnC,MAAM,aAAa,KAAK,WACpB,kBACA,QAAQ,IAAI;AAAA,IAChB,mBAAmB,MAAM,YAAY,EAAE,cAAc,MAAM,WAAW,CAAC;AAAA,IACvE,IAAI,KAAK,UAAU;AAAA,MACjB,MAAM,gBAAgB,MAAM,CAAC,gBAAgB,CAAC;AAAA,IAChD;AAAA,IAEA,MAAM,UAAU,MAAM,eAAe;AAAA,MACnC,MAAM;AAAA,MACN,SAAS,KAAK;A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