blume 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +110 -0
- package/dist/cli/{chunk-ga0pf4aj.js → chunk-0n9xkp3d.js} +12 -3
- package/dist/cli/{chunk-ga0pf4aj.js.map → chunk-0n9xkp3d.js.map} +3 -3
- package/dist/cli/{chunk-43zcf4gz.js → chunk-0pmb4tr4.js} +541 -368
- package/dist/cli/chunk-0pmb4tr4.js.map +35 -0
- package/dist/cli/{chunk-9geymqns.js → chunk-0w6hs479.js} +15 -15
- package/dist/cli/{chunk-xkz5xbtv.js → chunk-124fvmzq.js} +2802 -1422
- package/dist/cli/chunk-124fvmzq.js.map +220 -0
- package/dist/cli/chunk-150jk7km.js +52 -0
- package/dist/cli/chunk-150jk7km.js.map +10 -0
- package/dist/cli/{chunk-y4ykbark.js → chunk-1f882900.js} +2 -2
- package/dist/cli/{chunk-5ffywsmb.js → chunk-297ajdcv.js} +8 -6
- package/dist/cli/{chunk-5ffywsmb.js.map → chunk-297ajdcv.js.map} +3 -3
- package/dist/cli/{chunk-h2a48yhd.js → chunk-32khwcb6.js} +120 -16
- package/dist/cli/{chunk-h2a48yhd.js.map → chunk-32khwcb6.js.map} +10 -10
- package/dist/cli/{chunk-5cg2rzgf.js → chunk-36bxs9c7.js} +20 -49
- package/dist/cli/{chunk-5cg2rzgf.js.map → chunk-36bxs9c7.js.map} +4 -5
- package/dist/cli/{chunk-py62fewh.js → chunk-53jqw8z0.js} +3 -3
- package/dist/cli/{chunk-5wj2qwn2.js → chunk-58bt3hag.js} +4 -4
- package/dist/cli/{chunk-e7vvk5ya.js → chunk-5cmts6dv.js} +3 -3
- package/dist/cli/{chunk-y5h4r2y0.js → chunk-60hz265r.js} +15 -5
- package/dist/cli/chunk-60hz265r.js.map +10 -0
- package/dist/cli/chunk-74wfhv79.js +65 -0
- package/dist/cli/chunk-74wfhv79.js.map +10 -0
- package/dist/cli/{chunk-g2z9x01v.js → chunk-9qzgg6mj.js} +3 -3
- package/dist/cli/{chunk-q3wxxq39.js → chunk-a57yh0h9.js} +5 -5
- package/dist/cli/{chunk-713mngdq.js → chunk-ave1wcbr.js} +76 -10
- package/dist/cli/chunk-ave1wcbr.js.map +14 -0
- package/dist/cli/{chunk-2n4ps1b3.js → chunk-bqxaqn5p.js} +40 -22
- package/dist/cli/chunk-bqxaqn5p.js.map +15 -0
- package/dist/cli/{chunk-jnwj5kjj.js → chunk-bxwhtvw8.js} +20 -7
- package/dist/cli/{chunk-jnwj5kjj.js.map → chunk-bxwhtvw8.js.map} +3 -3
- package/dist/cli/chunk-ckrcm08h.js +324 -0
- package/dist/cli/chunk-ckrcm08h.js.map +14 -0
- package/dist/cli/{chunk-2f3ndkpw.js → chunk-desvm72z.js} +3 -3
- package/dist/cli/{chunk-gp84za0h.js → chunk-dhwtqnnd.js} +2 -2
- package/dist/cli/{chunk-4h8z9vv5.js → chunk-dpy8qdjf.js} +93 -47
- package/dist/cli/chunk-dpy8qdjf.js.map +17 -0
- package/dist/cli/{chunk-2f7n4qzt.js → chunk-dqhg54mr.js} +1 -1
- package/dist/cli/{chunk-0gz36akr.js → chunk-dv2z0rzf.js} +21 -5
- package/dist/cli/chunk-dv2z0rzf.js.map +12 -0
- package/dist/cli/{chunk-cm89scdv.js → chunk-es8h0v3j.js} +9 -11
- package/dist/cli/{chunk-cm89scdv.js.map → chunk-es8h0v3j.js.map} +3 -3
- package/dist/cli/{chunk-zhvd6adm.js → chunk-gfc5fqvf.js} +14 -14
- package/dist/cli/{chunk-nd1821sk.js → chunk-gxtg6ed2.js} +33 -19
- package/dist/cli/chunk-gxtg6ed2.js.map +10 -0
- package/dist/cli/{chunk-p804f3pe.js → chunk-hvcxng5f.js} +6 -6
- package/dist/cli/{chunk-ta27feev.js → chunk-j1x92mx9.js} +21 -2
- package/dist/cli/chunk-j1x92mx9.js.map +10 -0
- package/dist/cli/{chunk-rekqz4qg.js → chunk-k3gr1nm9.js} +19 -16
- package/dist/cli/chunk-k3gr1nm9.js.map +10 -0
- package/dist/cli/{chunk-1n228xqb.js → chunk-kdpzw38a.js} +2 -2
- package/dist/cli/{chunk-cy5bm0j0.js → chunk-ms9z66nz.js} +2 -2
- package/dist/cli/{chunk-cy5bm0j0.js.map → chunk-ms9z66nz.js.map} +2 -2
- package/dist/cli/{chunk-zf748avv.js → chunk-nbyvgnnm.js} +193 -286
- package/dist/cli/chunk-nbyvgnnm.js.map +36 -0
- package/dist/cli/{chunk-6bm0xpgd.js → chunk-s0bdnc7v.js} +2 -2
- package/dist/cli/{chunk-yxmk4pec.js → chunk-sc93apfs.js} +17 -16
- package/dist/cli/{chunk-yxmk4pec.js.map → chunk-sc93apfs.js.map} +3 -3
- package/dist/cli/{chunk-cmtcnh9f.js → chunk-tfycddbt.js} +2 -2
- package/dist/cli/{chunk-9xr4dgee.js → chunk-twy7psdz.js} +29 -16
- package/dist/cli/chunk-twy7psdz.js.map +10 -0
- package/dist/cli/{chunk-ntv4qrt7.js → chunk-y4msrwm9.js} +15 -15
- package/dist/cli/{chunk-yj17vs39.js → chunk-ydp3065p.js} +5 -5
- package/dist/cli/index.js +24 -19
- package/dist/cli/index.js.map +3 -3
- package/dist/types/ai/ask-context.d.ts +6 -2
- package/dist/types/ai/ask.d.ts +24 -5
- package/dist/types/ai/component-markdown.d.ts +2 -0
- package/dist/types/ai/openapi-components.d.ts +4 -1
- package/dist/types/analytics/clics.d.ts +37 -0
- package/dist/types/analytics/index.d.ts +2 -0
- package/dist/types/analytics/schema.d.ts +18 -0
- package/dist/types/astro/integration.d.ts +11 -4
- package/dist/types/astro/markdown-negotiation.d.ts +3 -0
- package/dist/types/astro/pages.d.ts +10 -0
- package/dist/types/cli/init/scaffold.d.ts +1 -1
- package/dist/types/components/content/api-field.d.ts +4 -1
- package/dist/types/components/content/api-page.d.ts +6 -1
- package/dist/types/components/openapi/code-samples.d.ts +29 -0
- package/dist/types/components/openapi/helpers.d.ts +22 -1
- package/dist/types/components/openapi/security.d.ts +10 -0
- package/dist/types/components/openapi/snippets.d.ts +60 -0
- package/dist/types/core/changelog-index.d.ts +8 -0
- package/dist/types/core/config-input.d.ts +37 -6
- package/dist/types/core/data.d.ts +4 -0
- package/dist/types/core/i18n-ui.d.ts +2 -0
- package/dist/types/core/links.d.ts +8 -0
- package/dist/types/core/powered-by.d.ts +12 -0
- package/dist/types/core/probe.d.ts +2 -0
- package/dist/types/core/project-graph.d.ts +6 -0
- package/dist/types/core/redirect-patterns.d.ts +11 -3
- package/dist/types/core/schema.d.ts +228 -3
- package/dist/types/core/sources/cache.d.ts +3 -0
- package/dist/types/core/sources/contentful-rich-text.d.ts +11 -2
- package/dist/types/core/sources/contentful.d.ts +17 -1
- package/dist/types/core/sources/lexical.d.ts +5 -0
- package/dist/types/core/sources/lower.d.ts +10 -2
- package/dist/types/core/sources/normalize.d.ts +20 -1
- package/dist/types/core/sources/notion.d.ts +8 -0
- package/dist/types/core/sources/remote.d.ts +37 -10
- package/dist/types/core/sources/sanity.d.ts +1 -1
- package/dist/types/core/types.d.ts +17 -0
- package/dist/types/deploy/adapter-output.d.ts +2 -1
- package/dist/types/deploy/adapters/cloudflare.d.ts +7 -5
- package/dist/types/deploy/adapters/node.d.ts +58 -23
- package/dist/types/deploy/adapters/registry.d.ts +10 -0
- package/dist/types/deploy/adapters/types.d.ts +3 -2
- package/dist/types/deploy/cloudflare-negotiation.d.ts +5 -2
- package/dist/types/deploy/node-headers.d.ts +12 -4
- package/dist/types/deploy/platforms/cloudflare.d.ts +10 -7
- package/dist/types/deploy/platforms/node.d.ts +3 -1
- package/dist/types/deploy/platforms/types.d.ts +18 -7
- package/dist/types/deploy/platforms/vercel.d.ts +21 -2
- package/dist/types/deploy/redirects.d.ts +17 -1
- package/dist/types/deploy/sitemap.d.ts +2 -1
- package/dist/types/deploy/vercel-negotiation.d.ts +44 -21
- package/dist/types/narration/build.d.ts +34 -12
- package/dist/types/narration/provider.d.ts +96 -8
- package/dist/types/openapi/checks.d.ts +27 -0
- package/dist/types/openapi/graphql.d.ts +6 -0
- package/dist/types/openapi/model.d.ts +15 -4
- package/dist/types/openapi/parse.d.ts +3 -0
- package/dist/types/openapi/references.d.ts +16 -0
- package/dist/types/openapi/sentence.d.ts +11 -1
- package/dist/types/ratelimit/index.d.ts +1 -1
- package/dist/types/ratelimit/schema.d.ts +8 -0
- package/dist/types/ratelimit/upstash.d.ts +39 -14
- package/dist/types/reference/graphql.d.ts +76 -1
- package/dist/types/reference/index.d.ts +1 -1
- package/dist/types/reference/openapi.d.ts +2 -2
- package/dist/types/reference/options.d.ts +37 -1
- package/dist/types/reference/schema.d.ts +84 -0
- package/dist/types/search/adapters/registry.d.ts +3 -0
- package/dist/types/search/adapters/typesense.d.ts +14 -4
- package/dist/types/search/build.d.ts +3 -1
- package/dist/types/search/orama-index.d.ts +9 -9
- package/dist/types/search/sync/algolia.d.ts +5 -2
- package/dist/types/search/sync/index.d.ts +3 -1
- package/dist/types/search/sync/typesense.d.ts +11 -7
- package/dist/types/seo/jsonld.d.ts +11 -6
- package/dist/types/sources/contentful.d.ts +16 -0
- package/dist/types/sources/github-releases.d.ts +8 -1
- package/dist/types/sources/notion.d.ts +8 -0
- package/dist/types/sources/payload.d.ts +2 -0
- package/dist/types/sources/registry.d.ts +63 -0
- package/dist/types/sources/shared.d.ts +3 -0
- package/dist/types/sources/strapi.d.ts +2 -0
- package/docs/01-quickstart.mdx +4 -2
- package/docs/02-deployment.mdx +59 -13
- package/docs/03-upgrading.mdx +2 -1
- package/docs/04-migrating.mdx +9 -9
- package/docs/08-faq.mdx +12 -12
- package/docs/advanced/changelog.mdx +30 -2
- package/docs/advanced/custom-pages.mdx +1 -1
- package/docs/advanced/skills.mdx +1 -1
- package/docs/cli/audit.mdx +30 -7
- package/docs/cli/doctor.mdx +6 -2
- package/docs/cli/evals.mdx +4 -4
- package/docs/cli/translate.mdx +1 -0
- package/docs/cli/validate.mdx +4 -3
- package/docs/configuration/analytics.mdx +19 -1
- package/docs/configuration/assistant.mdx +6 -2
- package/docs/configuration/customization.mdx +4 -2
- package/docs/configuration/export.mdx +5 -3
- package/docs/configuration/index.mdx +4 -2
- package/docs/configuration/narration.mdx +43 -6
- package/docs/configuration/rate-limiting.mdx +23 -2
- package/docs/configuration/search.mdx +37 -14
- package/docs/content/components.mdx +2 -2
- package/docs/content/frontmatter.mdx +5 -3
- package/docs/content/i18n.mdx +2 -2
- package/docs/content/includes.mdx +1 -1
- package/docs/content/navigation.mdx +8 -6
- package/docs/content/sources/contentful.mdx +9 -4
- package/docs/content/sources/custom.mdx +7 -3
- package/docs/content/sources/github-releases.mdx +12 -2
- package/docs/content/sources/index.mdx +3 -3
- package/docs/content/sources/notion.mdx +17 -2
- package/docs/content/sources/obsidian.mdx +3 -1
- package/docs/content/sources/payload.mdx +5 -2
- package/docs/content/sources/remote-mdx.mdx +6 -0
- package/docs/content/sources/sanity.mdx +4 -2
- package/docs/content/sources/strapi.mdx +5 -2
- package/docs/content/syntax.mdx +2 -2
- package/docs/discoverability/agent-discovery.mdx +1 -1
- package/docs/discoverability/index.mdx +1 -1
- package/docs/discoverability/json-api.mdx +2 -0
- package/docs/discoverability/llms-txt.mdx +1 -1
- package/docs/discoverability/markdown.mdx +3 -1
- package/docs/discoverability/mcp.mdx +6 -0
- package/docs/discoverability/sitemap-and-robots.mdx +1 -1
- package/docs/discoverability/structured-data.mdx +8 -6
- package/docs/references/api-pages.mdx +1 -1
- package/docs/references/asyncapi.mdx +5 -1
- package/docs/references/graphql.mdx +15 -1
- package/docs/references/openapi.mdx +64 -8
- package/package.json +9 -9
- package/skills/blume/SKILL.md +1 -1
- package/skills/blume-migrate/SKILL.md +2 -2
- package/skills/blume-migrate/assets/{oxfmt@0.67.0.patch → oxfmt@0.71.0.patch} +7 -7
- package/skills/blume-migrate/references/docusaurus.md +4 -4
- package/skills/blume-migrate/references/fumadocs.md +17 -13
- package/skills/blume-migrate/references/monorepo.md +5 -5
- package/skills/blume-migrate/references/nextra.md +8 -5
- package/skills/blume-migrate/references/starlight.md +9 -7
- package/src/ai/ask-context.ts +33 -3
- package/src/ai/ask-limits.ts +13 -0
- package/src/ai/ask.ts +24 -6
- package/src/ai/changelog-markdown.ts +11 -6
- package/src/ai/component-markdown.ts +1 -1
- package/src/ai/cors.ts +12 -3
- package/src/ai/mcp/query.ts +14 -6
- package/src/ai/openapi-components.ts +28 -4
- package/src/ai/relative-links.ts +4 -38
- package/src/analytics/clics.ts +58 -0
- package/src/analytics/head.ts +5 -0
- package/src/analytics/index.ts +2 -0
- package/src/analytics/schema.ts +2 -0
- package/src/astro/generate.ts +91 -56
- package/src/astro/integration.ts +72 -22
- package/src/astro/markdown-negotiation.ts +3 -0
- package/src/astro/module-types.ts +3 -1
- package/src/astro/pages.ts +23 -0
- package/src/astro/render-deps.ts +10 -5
- package/src/astro/runtime-deps.ts +23 -2
- package/src/astro/templates.ts +129 -81
- package/src/audit/catalog.ts +19 -3
- package/src/audit/checks/links.ts +14 -1
- package/src/audit/checks/network.ts +110 -6
- package/src/audit/checks/redirects.ts +6 -4
- package/src/audit/checks/robots.ts +58 -2
- package/src/audit/run.ts +3 -0
- package/src/audit/types.ts +2 -0
- package/src/audit/url.ts +14 -5
- package/src/blume-modules.d.ts +5 -1
- package/src/cli/args.ts +51 -0
- package/src/cli/build-failure.ts +23 -0
- package/src/cli/commands/audit.ts +10 -1
- package/src/cli/commands/dev.ts +18 -2
- package/src/cli/commands/doctor.ts +45 -12
- package/src/cli/commands/eval.ts +36 -4
- package/src/cli/commands/init.ts +6 -4
- package/src/cli/commands/validate.ts +10 -1
- package/src/cli/init/scaffold.ts +9 -6
- package/src/cli/prepare.ts +6 -3
- package/src/cli/required-secrets.ts +3 -2
- package/src/components/content/ApiPlayground.astro +6 -2
- package/src/components/content/api-field.ts +4 -1
- package/src/components/content/api-page.ts +31 -7
- package/src/components/content/mermaid-element.ts +15 -1
- package/src/components/content/view-switcher.ts +7 -4
- package/src/components/islands/hooks.ts +27 -1
- package/src/components/layout/NavTree.astro +49 -5
- package/src/components/layout/NavTreeScript.astro +18 -0
- package/src/components/layout/PageActions.astro +139 -24
- package/src/components/layout/PageLayout.astro +13 -3
- package/src/components/layout/RootLayout.astro +27 -14
- package/src/components/layout/Search.astro +17 -3
- package/src/components/layout/TableOfContents.astro +24 -17
- package/src/components/layout/analytics-client.ts +8 -8
- package/src/components/layout/head-scripts.ts +6 -1
- package/src/components/layout/search/algolia.ts +10 -1
- package/src/components/layout/search/analytics.ts +42 -14
- package/src/components/layout/search/endpoint.ts +48 -5
- package/src/components/layout/search/pagefind.ts +114 -5
- package/src/components/layout/search/types.ts +12 -0
- package/src/components/layout/search/typesense.ts +18 -6
- package/src/components/openapi/AsyncApiOperation.astro +14 -7
- package/src/components/openapi/Authorization.astro +10 -0
- package/src/components/openapi/GraphqlOperation.astro +5 -0
- package/src/components/openapi/Operation.astro +24 -1
- package/src/components/openapi/ParametersTable.astro +8 -4
- package/src/components/openapi/Playground.astro +7 -1
- package/src/components/openapi/RequestBody.astro +19 -2
- package/src/components/openapi/Responses.astro +1 -0
- package/src/components/openapi/SchemaTable.astro +15 -3
- package/src/components/openapi/async-snippets.ts +61 -5
- package/src/components/openapi/async.ts +123 -29
- package/src/components/openapi/graphql-helpers.ts +35 -12
- package/src/components/openapi/helpers.ts +36 -2
- package/src/components/openapi/message-model.ts +54 -11
- package/src/components/openapi/message.ts +14 -4
- package/src/components/openapi/operation-model.ts +16 -7
- package/src/components/openapi/playground-client.ts +77 -58
- package/src/components/openapi/playground-schema.ts +1 -1
- package/src/components/openapi/schema-tree.ts +44 -14
- package/src/components/openapi/security.ts +10 -0
- package/src/components/openapi/snippets.ts +5 -3
- package/src/components/openapi/validate-json.ts +4 -3
- package/src/components/powered-by-middleware.ts +33 -0
- package/src/core/changelog-index.ts +31 -1
- package/src/core/component-diagnostics.ts +53 -0
- package/src/core/component-overrides.ts +32 -0
- package/src/core/config-input.ts +42 -6
- package/src/core/data.ts +2 -0
- package/src/core/diagnostics.ts +5 -0
- package/src/core/i18n-ui.ts +2 -0
- package/src/core/includes.ts +1 -1
- package/src/core/links.ts +47 -17
- package/src/core/powered-by.ts +12 -0
- package/src/core/probe.ts +26 -6
- package/src/core/project-graph.ts +59 -18
- package/src/core/redirect-patterns.ts +36 -7
- package/src/core/schema.ts +26 -6
- package/src/core/sources/cache.ts +6 -0
- package/src/core/sources/contentful-rich-text.ts +29 -6
- package/src/core/sources/contentful.ts +135 -25
- package/src/core/sources/filesystem.ts +26 -4
- package/src/core/sources/github-releases.ts +12 -1
- package/src/core/sources/lexical.ts +15 -10
- package/src/core/sources/lower.ts +19 -3
- package/src/core/sources/mdx-remote.ts +62 -10
- package/src/core/sources/normalize.ts +227 -41
- package/src/core/sources/notion.ts +34 -10
- package/src/core/sources/obsidian.ts +16 -3
- package/src/core/sources/payload.ts +38 -15
- package/src/core/sources/remote.ts +72 -15
- package/src/core/sources/resolve.ts +11 -1
- package/src/core/sources/sanity.ts +43 -25
- package/src/core/sources/strapi.ts +2 -2
- package/src/core/types.ts +18 -0
- package/src/core/ui-packs/ar.ts +1 -0
- package/src/core/ui-packs/bg.ts +1 -0
- package/src/core/ui-packs/bn.ts +1 -0
- package/src/core/ui-packs/ca.ts +1 -0
- package/src/core/ui-packs/cs.ts +1 -0
- package/src/core/ui-packs/da.ts +1 -0
- package/src/core/ui-packs/de.ts +1 -0
- package/src/core/ui-packs/el.ts +1 -0
- package/src/core/ui-packs/es.ts +1 -0
- package/src/core/ui-packs/fa.ts +1 -0
- package/src/core/ui-packs/fi.ts +1 -0
- package/src/core/ui-packs/fr.ts +1 -0
- package/src/core/ui-packs/he.ts +1 -0
- package/src/core/ui-packs/hi.ts +1 -0
- package/src/core/ui-packs/hr.ts +1 -0
- package/src/core/ui-packs/hu.ts +1 -0
- package/src/core/ui-packs/id.ts +1 -0
- package/src/core/ui-packs/it.ts +1 -0
- package/src/core/ui-packs/ja.ts +1 -0
- package/src/core/ui-packs/ko.ts +1 -0
- package/src/core/ui-packs/nl.ts +1 -0
- package/src/core/ui-packs/no.ts +1 -0
- package/src/core/ui-packs/pl.ts +1 -0
- package/src/core/ui-packs/pt-br.ts +1 -0
- package/src/core/ui-packs/pt.ts +1 -0
- package/src/core/ui-packs/ro.ts +1 -0
- package/src/core/ui-packs/ru.ts +1 -0
- package/src/core/ui-packs/sk.ts +1 -0
- package/src/core/ui-packs/sr.ts +1 -0
- package/src/core/ui-packs/sv.ts +1 -0
- package/src/core/ui-packs/th.ts +1 -0
- package/src/core/ui-packs/tr.ts +1 -0
- package/src/core/ui-packs/uk.ts +1 -0
- package/src/core/ui-packs/vi.ts +1 -0
- package/src/core/ui-packs/zh-tw.ts +1 -0
- package/src/core/ui-packs/zh.ts +1 -0
- package/src/deploy/adapter-output.ts +7 -2
- package/src/deploy/adapters/cloudflare.ts +7 -5
- package/src/deploy/adapters/node.ts +47 -9
- package/src/deploy/adapters/types.ts +7 -3
- package/src/deploy/artifacts.ts +2 -1
- package/src/deploy/cloudflare-negotiation.ts +36 -7
- package/src/deploy/headers.ts +15 -1
- package/src/deploy/node-headers.ts +32 -20
- package/src/deploy/platforms/cloudflare.ts +14 -9
- package/src/deploy/platforms/netlify.ts +2 -1
- package/src/deploy/platforms/node.ts +12 -2
- package/src/deploy/platforms/types.ts +21 -7
- package/src/deploy/platforms/vercel.ts +115 -17
- package/src/deploy/redirects.ts +66 -6
- package/src/deploy/rss.ts +3 -1
- package/src/deploy/sitemap.ts +39 -5
- package/src/deploy/vercel-negotiation.ts +325 -103
- package/src/eval/agents.ts +18 -1
- package/src/eval/prompts.ts +6 -3
- package/src/eval/report.ts +34 -13
- package/src/eval/run.ts +5 -0
- package/src/markdown/base-links.ts +15 -14
- package/src/markdown/package-commands.ts +9 -8
- package/src/markdown/relative-links.ts +3 -2
- package/src/narration/build.ts +218 -40
- package/src/narration/provider.ts +89 -9
- package/src/openapi/checks.ts +273 -0
- package/src/openapi/graphql-build.ts +21 -0
- package/src/openapi/graphql.ts +11 -0
- package/src/openapi/model.ts +15 -3
- package/src/openapi/parse.ts +127 -2
- package/src/openapi/references.ts +43 -3
- package/src/openapi/render-mdx.ts +68 -8
- package/src/openapi/sentence.ts +29 -2
- package/src/openapi/source.ts +39 -14
- package/src/ratelimit/index.ts +1 -1
- package/src/ratelimit/runtime.ts +37 -19
- package/src/ratelimit/upstash.ts +40 -10
- package/src/reference/graphql.ts +15 -1
- package/src/reference/index.ts +1 -0
- package/src/reference/openapi.ts +2 -2
- package/src/reference/options.ts +29 -1
- package/src/registry/eject.ts +8 -2
- package/src/search/adapters/locale-scope.ts +30 -0
- package/src/search/adapters/typesense.ts +14 -4
- package/src/search/build.ts +21 -3
- package/src/search/orama-index.ts +163 -31
- package/src/search/source-pages.ts +29 -0
- package/src/search/sync/algolia.ts +99 -9
- package/src/search/sync/index.ts +52 -13
- package/src/search/sync/typesense.ts +72 -27
- package/src/seo/jsonld.ts +38 -20
- package/src/sources/contentful.ts +12 -0
- package/src/sources/github-releases.ts +7 -1
- package/src/sources/notion.ts +7 -0
- package/src/sources/shared.ts +3 -0
- package/src/theme/color.ts +9 -10
- package/src/theme/entry.ts +43 -6
- package/src/translate/validate.ts +23 -1
- package/dist/cli/chunk-0gz36akr.js.map +0 -12
- package/dist/cli/chunk-2n4ps1b3.js.map +0 -15
- package/dist/cli/chunk-43zcf4gz.js.map +0 -36
- package/dist/cli/chunk-4ejxbzee.js +0 -39
- package/dist/cli/chunk-4ejxbzee.js.map +0 -10
- package/dist/cli/chunk-4h8z9vv5.js.map +0 -16
- package/dist/cli/chunk-713mngdq.js.map +0 -14
- package/dist/cli/chunk-9xr4dgee.js.map +0 -10
- package/dist/cli/chunk-amrb6hgh.js +0 -145
- package/dist/cli/chunk-amrb6hgh.js.map +0 -11
- package/dist/cli/chunk-nd1821sk.js.map +0 -10
- package/dist/cli/chunk-rekqz4qg.js.map +0 -10
- package/dist/cli/chunk-ta27feev.js.map +0 -10
- package/dist/cli/chunk-xkz5xbtv.js.map +0 -213
- package/dist/cli/chunk-y5h4r2y0.js.map +0 -10
- package/dist/cli/chunk-zf748avv.js.map +0 -37
- /package/dist/cli/{chunk-9geymqns.js.map → chunk-0w6hs479.js.map} +0 -0
- /package/dist/cli/{chunk-y4ykbark.js.map → chunk-1f882900.js.map} +0 -0
- /package/dist/cli/{chunk-py62fewh.js.map → chunk-53jqw8z0.js.map} +0 -0
- /package/dist/cli/{chunk-5wj2qwn2.js.map → chunk-58bt3hag.js.map} +0 -0
- /package/dist/cli/{chunk-e7vvk5ya.js.map → chunk-5cmts6dv.js.map} +0 -0
- /package/dist/cli/{chunk-g2z9x01v.js.map → chunk-9qzgg6mj.js.map} +0 -0
- /package/dist/cli/{chunk-q3wxxq39.js.map → chunk-a57yh0h9.js.map} +0 -0
- /package/dist/cli/{chunk-2f3ndkpw.js.map → chunk-desvm72z.js.map} +0 -0
- /package/dist/cli/{chunk-gp84za0h.js.map → chunk-dhwtqnnd.js.map} +0 -0
- /package/dist/cli/{chunk-2f7n4qzt.js.map → chunk-dqhg54mr.js.map} +0 -0
- /package/dist/cli/{chunk-zhvd6adm.js.map → chunk-gfc5fqvf.js.map} +0 -0
- /package/dist/cli/{chunk-p804f3pe.js.map → chunk-hvcxng5f.js.map} +0 -0
- /package/dist/cli/{chunk-1n228xqb.js.map → chunk-kdpzw38a.js.map} +0 -0
- /package/dist/cli/{chunk-6bm0xpgd.js.map → chunk-s0bdnc7v.js.map} +0 -0
- /package/dist/cli/{chunk-cmtcnh9f.js.map → chunk-tfycddbt.js.map} +0 -0
- /package/dist/cli/{chunk-ntv4qrt7.js.map → chunk-y4msrwm9.js.map} +0 -0
- /package/dist/cli/{chunk-yj17vs39.js.map → chunk-ydp3065p.js.map} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BlumeProject } from "../../core/project-graph.ts";
|
|
2
|
+
import type { ProjectContext } from "../../core/types.ts";
|
|
2
3
|
import type { BuildLog, DeployPlatform, RedirectFile } from "./types.ts";
|
|
3
4
|
/** `vercel.json` with a `redirects` array, for a static deploy of `dist/`. */
|
|
4
5
|
export declare const VERCEL_JSON_FILE: RedirectFile;
|
|
@@ -26,6 +27,22 @@ export declare const emitVercelNegotiation: (project: BlumeProject, log: BuildLo
|
|
|
26
27
|
* prerender a pattern's pages, so the adapter never sees these.
|
|
27
28
|
*/
|
|
28
29
|
export declare const emitVercelPatternRedirects: (project: BlumeProject, log: BuildLog) => Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Move a server build's static files under `deployment.base`.
|
|
32
|
+
* `@astrojs/vercel` copies them to the root of the Build Output tree's
|
|
33
|
+
* `static/`, while the pages request `<base>/_astro/…` and link to
|
|
34
|
+
* `<base>/…`, so nothing the site asks for would be found. Moved to
|
|
35
|
+
* `static/<base>/`, they're served at the base, as the routes that
|
|
36
|
+
* {@link rebaseVercelRoutes} moves there expect.
|
|
37
|
+
*/
|
|
38
|
+
export declare const moveStaticUnderBase: (context: ProjectContext, base: string) => Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Move the adapter's routing config under `deployment.base` to match the
|
|
41
|
+
* static files (see `rebaseAdapterRoutes`), its exact redirects rebuilt from
|
|
42
|
+
* the configured ones. Resolves to false when the config can't be read: the
|
|
43
|
+
* adapter's routes would then miss every path under the base.
|
|
44
|
+
*/
|
|
45
|
+
export declare const rebaseVercelRoutes: (project: BlumeProject, log: BuildLog) => Promise<boolean>;
|
|
29
46
|
/**
|
|
30
47
|
* Vercel. A server build's Build Output tree lands at `.vercel/output` — at
|
|
31
48
|
* the project root, because the adapter is handed that root up front: its
|
|
@@ -33,7 +50,9 @@ export declare const emitVercelPatternRedirects: (project: BlumeProject, log: Bu
|
|
|
33
50
|
* hidden runtime silently drops the function's chunks and `node_modules`.
|
|
34
51
|
* Static assets are served from the tree's `static/` half, so the deploy
|
|
35
52
|
* artifacts are written there; headers (the discovery files', the sandbox on
|
|
36
|
-
* downloaded SVGs) arrive through the routing config rather
|
|
37
|
-
* `_headers` file, which Vercel never reads.
|
|
53
|
+
* downloaded SVGs, `X-Powered-By`) arrive through the routing config rather
|
|
54
|
+
* than a `_headers` file, which Vercel never reads. The adapter ignores
|
|
55
|
+
* `deployment.base`, so under one the build moves the static files and the
|
|
56
|
+
* routes beneath it.
|
|
38
57
|
*/
|
|
39
58
|
export declare const vercelPlatform: DeployPlatform;
|
|
@@ -41,9 +41,25 @@ export declare const applyBaseToAstroRedirects: (redirects: Redirect[], basePath
|
|
|
41
41
|
* public file (see {@link baseRedirectTarget}).
|
|
42
42
|
*/
|
|
43
43
|
export declare const applyBaseToPlatformRedirects: (redirects: Redirect[], basePath: string, deployBase: string, routes: RouteSet) => Redirect[];
|
|
44
|
+
/**
|
|
45
|
+
* Based `redirects`, each exact one that moves a page followed by the same
|
|
46
|
+
* redirect for the page's Markdown copies: from a path no page is served at
|
|
47
|
+
* to one a page is, `/old.md` goes to `/new.md` (and `.mdx` alike), where it
|
|
48
|
+
* would otherwise 404 for an agent still reading the old URL. A pattern gets
|
|
49
|
+
* none; one that carries its capture over (`/beta/:slug*` → `/v2/:slug*`)
|
|
50
|
+
* already moves `/beta/guide.md` along. `pages` are the served page routes
|
|
51
|
+
* (carrying `basePath`, not `deployment.base`), and `bases` the deployment
|
|
52
|
+
* base each end carries: Astro's config leaves it off `from` (see
|
|
53
|
+
* {@link applyBaseToAstroRedirects}).
|
|
54
|
+
*/
|
|
55
|
+
export declare const withMirrorRedirects: (redirects: Redirect[], pages: RouteSet, bases: {
|
|
56
|
+
from: string;
|
|
57
|
+
to: string;
|
|
58
|
+
}) => Redirect[];
|
|
44
59
|
/**
|
|
45
60
|
* The configured redirects as the host platform matches them, via
|
|
46
|
-
* {@link applyBaseToPlatformRedirects}
|
|
61
|
+
* {@link applyBaseToPlatformRedirects} plus the Markdown copies of each moved
|
|
62
|
+
* page ({@link withMirrorRedirects}), exact paths ahead of patterns: hosts
|
|
47
63
|
* try rules in order, and an exact redirect wins over a pattern that also
|
|
48
64
|
* covers its path. The one basing every consumer must share: the emitted
|
|
49
65
|
* redirect files and the server wrappers all compare these paths against
|
|
@@ -11,7 +11,8 @@ export declare const describeSitemapFiles: (files: readonly SitemapFile[]) => st
|
|
|
11
11
|
* can't see: custom `.astro` pages (most importantly a custom landing `/`) and
|
|
12
12
|
* the generated `/changelog` index. Returns null when the sitemap is disabled
|
|
13
13
|
* or no `site` is configured (absolute URLs are required for a valid sitemap).
|
|
14
|
-
* Drafts, hidden, and `noindex` pages are excluded
|
|
14
|
+
* Drafts, hidden, and `noindex` pages are excluded, and so is a page whose
|
|
15
|
+
* `seo.canonical` points elsewhere.
|
|
15
16
|
*
|
|
16
17
|
* Sites within the per-file URL cap get the single classic `sitemap.xml`;
|
|
17
18
|
* larger sites get `sitemap.xml` as a sitemap index over numbered
|
|
@@ -14,25 +14,31 @@
|
|
|
14
14
|
* prerendered Markdown 404 body with the 404 status, instead of the HTML
|
|
15
15
|
* shell, and one that prefers JSON (or asks for a `.json` URL) gets the
|
|
16
16
|
* prerendered problem-details 404.
|
|
17
|
+
*
|
|
18
|
+
* Under `deployment.base` every route here matches the served URL, base
|
|
19
|
+
* included, and names the files where Blume moves them (`static/<base>/`, see
|
|
20
|
+
* {@link rebaseAdapterRoutes}); `base` is the normalized base, `""` for none.
|
|
17
21
|
*/
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
/** One header condition on a Build Output route. */
|
|
23
|
+
export interface VercelCondition {
|
|
24
|
+
key?: string;
|
|
25
|
+
type: string;
|
|
26
|
+
value?: string;
|
|
27
|
+
}
|
|
28
|
+
/** The conditions of one route: all of `has`, none of `missing`. */
|
|
29
|
+
export interface AcceptConditions {
|
|
30
|
+
has: VercelCondition[];
|
|
31
|
+
missing?: VercelCondition[];
|
|
32
|
+
}
|
|
33
|
+
/** When a client prefers `text/markdown` (or `text/x-markdown`) over HTML. */
|
|
34
|
+
export declare const ACCEPT_MARKDOWN_CONDITIONS: AcceptConditions[];
|
|
29
35
|
/**
|
|
30
36
|
* The JSON counterpart, for the problem-details 404: `application/json` or
|
|
31
37
|
* `application/problem+json`. Browsers never send either on a navigation
|
|
32
38
|
* (the catch-all wildcard does not match), so ordinary page requests are
|
|
33
39
|
* unaffected.
|
|
34
40
|
*/
|
|
35
|
-
export declare const
|
|
41
|
+
export declare const ACCEPT_JSON_CONDITIONS: AcceptConditions[];
|
|
36
42
|
/**
|
|
37
43
|
* A Build Output API route — the subset these helpers read and write. Parsed
|
|
38
44
|
* routes keep whatever other fields they carry at runtime; only these are
|
|
@@ -42,12 +48,9 @@ export interface VercelRoute {
|
|
|
42
48
|
continue?: boolean;
|
|
43
49
|
dest?: string;
|
|
44
50
|
handle?: string;
|
|
45
|
-
has?:
|
|
46
|
-
key?: string;
|
|
47
|
-
type: string;
|
|
48
|
-
value?: string;
|
|
49
|
-
}[];
|
|
51
|
+
has?: VercelCondition[];
|
|
50
52
|
headers?: Record<string, string>;
|
|
53
|
+
missing?: VercelCondition[];
|
|
51
54
|
src?: string;
|
|
52
55
|
status?: number;
|
|
53
56
|
}
|
|
@@ -82,9 +85,10 @@ export interface NegotiationRoutes {
|
|
|
82
85
|
* rewrite also stamps `x-markdown-tokens` — the estimated token count of the
|
|
83
86
|
* homepage mirror (Cloudflare's Markdown for Agents convention). Only the home
|
|
84
87
|
* route can carry it: the other rewrites are chunked alternations spanning
|
|
85
|
-
* many pages, and a count is per-page.
|
|
88
|
+
* many pages, and a count is per-page. Under a `base`, each path is matched
|
|
89
|
+
* and rewritten where it's served (`/docs` → `/docs/index.md`).
|
|
86
90
|
*/
|
|
87
|
-
export declare const buildNegotiationRoutes: (routePaths: readonly string[], homeTokens?: number) => NegotiationRoutes;
|
|
91
|
+
export declare const buildNegotiationRoutes: (routePaths: readonly string[], homeTokens?: number, base?: string) => NegotiationRoutes;
|
|
88
92
|
/**
|
|
89
93
|
* Splice the negotiation routes into a Build Output `config.json`, plus — when
|
|
90
94
|
* given — a homepage `Link` header route for agent discovery (see
|
|
@@ -102,12 +106,16 @@ export declare const buildNegotiationRoutes: (routePaths: readonly string[], hom
|
|
|
102
106
|
* phase right before the adapter's `/404.html` fallback — and nowhere when
|
|
103
107
|
* that fallback is absent, since a `dest` with no file behind it would serve
|
|
104
108
|
* nothing. With `svgAssets`, a main-phase route also sandboxes the SVGs a
|
|
105
|
-
* content source downloaded (see {@link svgAssetRoute}).
|
|
109
|
+
* content source downloaded (see {@link svgAssetRoute}). With `poweredBy`, a
|
|
110
|
+
* route at the head of the config, ahead of the adapter's redirects, names
|
|
111
|
+
* Blume on every response (see {@link poweredByRoute}). Under a `base`, every
|
|
112
|
+
* route matches and names paths beneath it, and the fallback anchor is the
|
|
113
|
+
* one {@link rebaseAdapterRoutes} moved there. Returns the updated JSON
|
|
106
114
|
* text (tab-indented, like the adapter's own output), or `null` when there is
|
|
107
115
|
* nowhere safe to splice: an unparsable config, no `routes` array, or no
|
|
108
116
|
* `handle: "filesystem"` marker to anchor the splice.
|
|
109
117
|
*/
|
|
110
|
-
export declare const injectNegotiationRoutes: (configText: string, routePaths: readonly string[], homeLinkHeader?: string | null, contentTypeOverrides?: Record<string, string>, homeTokens?: number, notFound?: NotFoundVariants, corsPaths?: readonly string[], svgAssets?: boolean) => string | null;
|
|
118
|
+
export declare const injectNegotiationRoutes: (configText: string, routePaths: readonly string[], homeLinkHeader?: string | null, contentTypeOverrides?: Record<string, string>, homeTokens?: number, notFound?: NotFoundVariants, corsPaths?: readonly string[], svgAssets?: boolean, base?: string, poweredBy?: boolean) => string | null;
|
|
111
119
|
/**
|
|
112
120
|
* Splice routes for the pattern redirects (see `vercelPatternRoutes`) into a
|
|
113
121
|
* Build Output `config.json`, in the main phase just ahead of
|
|
@@ -117,3 +125,18 @@ export declare const injectNegotiationRoutes: (configText: string, routePaths: r
|
|
|
117
125
|
* unparsable config, no `routes` array, or no `handle: "filesystem"` marker.
|
|
118
126
|
*/
|
|
119
127
|
export declare const injectRedirectRoutes: (configText: string, redirectRoutes: readonly VercelRoute[]) => string | null;
|
|
128
|
+
/**
|
|
129
|
+
* Move the adapter's routes under `deployment.base`, to match the static files
|
|
130
|
+
* Blume moves to `static/<base>/`. `@astrojs/vercel` routes a server build as
|
|
131
|
+
* if it were served from the root: its route patterns (the `_astro/` cache
|
|
132
|
+
* header, every server route) match base-less paths, its 404 fallback names
|
|
133
|
+
* `/404.html`, and it joins the base onto each redirect with no slash on the
|
|
134
|
+
* `from` side and a second time on the `to` side, which Astro hands it
|
|
135
|
+
* already based (`^/docsold$` → `/docs/docs/new`). Each pattern is
|
|
136
|
+
* re-anchored under the base and the fallback names the base's `404.html`;
|
|
137
|
+
* the adapter's redirects make way for `redirectRoutes`, the exact redirects
|
|
138
|
+
* as the host matches them. Returns the updated JSON text, or `null` when
|
|
139
|
+
* there is nowhere safe to splice: an unparsable config, no `routes` array,
|
|
140
|
+
* or no `handle: "filesystem"` marker.
|
|
141
|
+
*/
|
|
142
|
+
export declare const rebaseAdapterRoutes: (configText: string, base: string, redirectRoutes: readonly VercelRoute[]) => string | null;
|
|
@@ -2,17 +2,18 @@ import { HTMLElement } from "node-html-parser";
|
|
|
2
2
|
import type { Node } from "node-html-parser";
|
|
3
3
|
import type { BlumeProject } from "../core/project-graph.ts";
|
|
4
4
|
import type { ProjectContext } from "../core/types.ts";
|
|
5
|
-
import type { NarrationProvider } from "./provider.ts";
|
|
5
|
+
import type { GatewayNarrationProvider, NarrationProvider, OpenAINarrationProvider } from "./provider.ts";
|
|
6
6
|
import type { NarrationCues, NarrationTree } from "./script.ts";
|
|
7
7
|
/**
|
|
8
8
|
* Generated narration: after Astro writes the HTML, read every page that
|
|
9
9
|
* carries the player exactly as the browser will (same walker, same blocks),
|
|
10
10
|
* split it into sentences, and give each sentence a clip from the configured
|
|
11
11
|
* speech model. Clips are cached by what decides their sound (text, language,
|
|
12
|
-
* model, voice, instructions, provider options), so a rebuild only
|
|
13
|
-
* sentences that changed, and one sentence shared by many pages is
|
|
14
|
-
* once. Each page gets a manifest listing its clips; the player
|
|
15
|
-
* order and falls back to browser voices wherever a manifest is
|
|
12
|
+
* model, voice, instructions, provider options, endpoint), so a rebuild only
|
|
13
|
+
* pays for sentences that changed, and one sentence shared by many pages is
|
|
14
|
+
* generated once. Each page gets a manifest listing its clips; the player
|
|
15
|
+
* plays them in order and falls back to browser voices wherever a manifest is
|
|
16
|
+
* missing.
|
|
16
17
|
*/
|
|
17
18
|
/** How the build logs: the integration's Astro logger. */
|
|
18
19
|
export interface NarrationLogger {
|
|
@@ -23,7 +24,10 @@ export interface NarrationLogger {
|
|
|
23
24
|
export type Speak = (text: string, lang: string) => Promise<Uint8Array>;
|
|
24
25
|
/** What a narration build did, for the log line and tests. */
|
|
25
26
|
export interface NarrationBuildResult {
|
|
26
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Clips that failed to generate, or that a missing key left ungenerated;
|
|
29
|
+
* their pages get no manifest.
|
|
30
|
+
*/
|
|
27
31
|
failed: number;
|
|
28
32
|
/** Clips generated by the speech model on this build. */
|
|
29
33
|
generated: number;
|
|
@@ -55,16 +59,34 @@ export declare const readPlayerPage: (html: string) => PlayerPage | null;
|
|
|
55
59
|
/**
|
|
56
60
|
* A clip's cache key: a digest of everything that decides how it sounds. The
|
|
57
61
|
* Blume version is deliberately left out, unlike the OG card's: an upgrade
|
|
58
|
-
* shouldn't pay to regenerate audio that would sound the same.
|
|
62
|
+
* shouldn't pay to regenerate audio that would sound the same. A build
|
|
63
|
+
* resolves `endpoint` once and passes it in, rather than reading the
|
|
64
|
+
* environment for every sentence.
|
|
59
65
|
*/
|
|
60
|
-
export declare const clipKey: (provider: NarrationProvider, lang: string, text: string) => string;
|
|
66
|
+
export declare const clipKey: (provider: NarrationProvider, lang: string, text: string, endpoint?: string | undefined) => string;
|
|
61
67
|
/** Speak through the Vercel AI Gateway with the provider's model and voice. */
|
|
62
|
-
export declare const gatewaySpeaker: (provider:
|
|
68
|
+
export declare const gatewaySpeaker: (provider: GatewayNarrationProvider) => Speak;
|
|
69
|
+
/**
|
|
70
|
+
* Speak through OpenAI's speech API, or with `baseUrl` through any server
|
|
71
|
+
* that serves it (`POST /audio/speech`): Kokoro-FastAPI, Speaches, LiteLLM.
|
|
72
|
+
* That API takes no language, so none is sent and the model or voice
|
|
73
|
+
* decides it. Without a key, no bearer token is sent (an `Authorization` in
|
|
74
|
+
* `headers` still is). A build resolves `baseURL` once and passes it in.
|
|
75
|
+
*/
|
|
76
|
+
export declare const openaiSpeaker: (provider: OpenAINarrationProvider, baseURL?: string) => Speak;
|
|
77
|
+
/**
|
|
78
|
+
* The env var a build needs to generate with `provider` and doesn't have, or
|
|
79
|
+
* `null` when it can go ahead: the key is set, Vercel's OIDC token stands in
|
|
80
|
+
* for the gateway's, or the provider names no key (`openai()` with a
|
|
81
|
+
* `baseUrl` and no `apiKeyEnv`).
|
|
82
|
+
*/
|
|
83
|
+
export declare const missingKey: (provider: NarrationProvider) => string | null;
|
|
63
84
|
/**
|
|
64
85
|
* Generate the narration for a built site in `distDir`: a clip per sentence
|
|
65
|
-
* and a manifest per page. Does nothing unless `narration.provider` is set
|
|
66
|
-
*
|
|
67
|
-
* pages
|
|
86
|
+
* and a manifest per page. Does nothing unless `narration.provider` is set.
|
|
87
|
+
* When new clips are needed and the provider's key is missing, it warns and
|
|
88
|
+
* generates nothing, so only pages whose clips are all cached get audio (the
|
|
89
|
+
* rest read with browser voices). `speak` replaces the provider call.
|
|
68
90
|
*/
|
|
69
91
|
export declare const buildNarration: (project: BlumeProject, distDir: string, logger: NarrationLogger, speak?: Speak) => Promise<NarrationBuildResult | null>;
|
|
70
92
|
export {};
|
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/** The speech model narration uses when `gateway()` names none. */
|
|
3
3
|
export declare const DEFAULT_NARRATION_MODEL = "openai/tts-1-hd";
|
|
4
|
-
/** The voice narration uses when
|
|
4
|
+
/** The voice narration uses when the provider names none. */
|
|
5
5
|
export declare const DEFAULT_NARRATION_VOICE = "alloy";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `voice` and `instructions` are narration options and are rejected by the
|
|
10
|
-
* assistant.
|
|
7
|
+
* The AI SDK provider `openai()` narration speaks through, with or without a
|
|
8
|
+
* `baseUrl`: `@ai-sdk/openai-compatible` has no speech models.
|
|
11
9
|
*/
|
|
12
|
-
export declare const
|
|
10
|
+
export declare const OPENAI_SPEECH_DEP = "@ai-sdk/openai";
|
|
11
|
+
/**
|
|
12
|
+
* Whether `url` carries a username or password, which `fetch` refuses to
|
|
13
|
+
* send and whose error message would print them. A URL that doesn't parse
|
|
14
|
+
* has none.
|
|
15
|
+
*/
|
|
16
|
+
export declare const hasCredentials: (url: string) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* `narration.provider`: the `gateway()` or `openai()` descriptor from
|
|
19
|
+
* `blume/ai`, read with speech defaults. `reasoning` (and `openai()`'s
|
|
20
|
+
* `name`, which speech models don't read) are assistant options and are
|
|
21
|
+
* rejected here; `voice` and `instructions` are narration options and are
|
|
22
|
+
* rejected by the assistant.
|
|
23
|
+
*
|
|
24
|
+
* `openai()` is read for what narration needs, not what the assistant does:
|
|
25
|
+
* it speaks through `@ai-sdk/openai` whatever the `baseUrl`, and a custom
|
|
26
|
+
* endpoint gets only the key `apiKeyEnv` names, never `OPENAI_API_KEY` by
|
|
27
|
+
* default, so it may take none at all. A key that is named is required.
|
|
28
|
+
*/
|
|
29
|
+
export declare const narrationProviderSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
13
30
|
kind: z.ZodLiteral<"gateway">;
|
|
14
31
|
options: z.ZodObject<{
|
|
15
|
-
instructions: z.ZodOptional<z.ZodString>;
|
|
16
32
|
model: z.ZodDefault<z.ZodString>;
|
|
33
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
17
34
|
voice: z.ZodDefault<z.ZodString>;
|
|
18
35
|
apiKeyEnv: z.ZodDefault<z.ZodString>;
|
|
19
36
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -21,6 +38,77 @@ export declare const narrationProviderSchema: z.ZodObject<{
|
|
|
21
38
|
}, z.core.$strict>;
|
|
22
39
|
requiredSecrets: z.ZodArray<z.ZodString>;
|
|
23
40
|
runtimeDeps: z.ZodArray<z.ZodString>;
|
|
24
|
-
}, z.core.$strict
|
|
41
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
42
|
+
kind: z.ZodLiteral<"openai">;
|
|
43
|
+
options: z.ZodObject<{
|
|
44
|
+
apiKeyEnv: z.ZodOptional<z.ZodString>;
|
|
45
|
+
baseUrl: z.ZodOptional<z.ZodURL>;
|
|
46
|
+
model: z.ZodString;
|
|
47
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
48
|
+
voice: z.ZodDefault<z.ZodString>;
|
|
49
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
50
|
+
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodJSONSchema>>>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
requiredSecrets: z.ZodArray<z.ZodString>;
|
|
53
|
+
runtimeDeps: z.ZodArray<z.ZodString>;
|
|
54
|
+
}, z.core.$strict>], "kind">, z.ZodTransform<{
|
|
55
|
+
kind: "gateway";
|
|
56
|
+
options: {
|
|
57
|
+
model: string;
|
|
58
|
+
voice: string;
|
|
59
|
+
apiKeyEnv: string;
|
|
60
|
+
instructions?: string | undefined;
|
|
61
|
+
headers?: Record<string, string> | undefined;
|
|
62
|
+
providerOptions?: Record<string, Record<string, z.core.util.JSONType>> | undefined;
|
|
63
|
+
};
|
|
64
|
+
requiredSecrets: string[];
|
|
65
|
+
runtimeDeps: string[];
|
|
66
|
+
} | {
|
|
67
|
+
options: {
|
|
68
|
+
model: string;
|
|
69
|
+
voice: string;
|
|
70
|
+
apiKeyEnv?: string | undefined;
|
|
71
|
+
baseUrl?: string | undefined;
|
|
72
|
+
instructions?: string | undefined;
|
|
73
|
+
headers?: Record<string, string> | undefined;
|
|
74
|
+
providerOptions?: Record<string, Record<string, z.core.util.JSONType>> | undefined;
|
|
75
|
+
};
|
|
76
|
+
requiredSecrets: string[];
|
|
77
|
+
runtimeDeps: string[];
|
|
78
|
+
kind: "openai";
|
|
79
|
+
}, {
|
|
80
|
+
kind: "gateway";
|
|
81
|
+
options: {
|
|
82
|
+
model: string;
|
|
83
|
+
voice: string;
|
|
84
|
+
apiKeyEnv: string;
|
|
85
|
+
instructions?: string | undefined;
|
|
86
|
+
headers?: Record<string, string> | undefined;
|
|
87
|
+
providerOptions?: Record<string, Record<string, z.core.util.JSONType>> | undefined;
|
|
88
|
+
};
|
|
89
|
+
requiredSecrets: string[];
|
|
90
|
+
runtimeDeps: string[];
|
|
91
|
+
} | {
|
|
92
|
+
kind: "openai";
|
|
93
|
+
options: {
|
|
94
|
+
model: string;
|
|
95
|
+
voice: string;
|
|
96
|
+
apiKeyEnv?: string | undefined;
|
|
97
|
+
baseUrl?: string | undefined;
|
|
98
|
+
instructions?: string | undefined;
|
|
99
|
+
headers?: Record<string, string> | undefined;
|
|
100
|
+
providerOptions?: Record<string, Record<string, z.core.util.JSONType>> | undefined;
|
|
101
|
+
};
|
|
102
|
+
requiredSecrets: string[];
|
|
103
|
+
runtimeDeps: string[];
|
|
104
|
+
}>>;
|
|
25
105
|
/** A validated narration provider, defaults filled in. */
|
|
26
106
|
export type NarrationProvider = z.output<typeof narrationProviderSchema>;
|
|
107
|
+
/** A validated `gateway()` narration provider. */
|
|
108
|
+
export type GatewayNarrationProvider = Extract<NarrationProvider, {
|
|
109
|
+
kind: "gateway";
|
|
110
|
+
}>;
|
|
111
|
+
/** A validated `openai()` narration provider. */
|
|
112
|
+
export type OpenAINarrationProvider = Extract<NarrationProvider, {
|
|
113
|
+
kind: "openai";
|
|
114
|
+
}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ApiDocument } from "./model.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Targeted checks for spec mistakes that would otherwise render silently
|
|
4
|
+
* wrong. This is not a validator — a linter such as Spectral or oasdiff owns
|
|
5
|
+
* that — and a spec that fails one of these still renders. Each check names
|
|
6
|
+
* one mistake whose symptom on the page is quiet: a path placeholder sent
|
|
7
|
+
* as literal text, a Try it input whose value goes nowhere, an Authorization
|
|
8
|
+
* section with no scheme to describe. Each reports a warning with its own
|
|
9
|
+
* code, so a build says what's wrong instead of shipping it.
|
|
10
|
+
*/
|
|
11
|
+
/** One mistake a check found, before the source names the spec it's in. */
|
|
12
|
+
export interface SpecIssue {
|
|
13
|
+
code: string;
|
|
14
|
+
message: string;
|
|
15
|
+
suggestion: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* How a warning names an operation: `GET /pets`, or a webhook by its name
|
|
19
|
+
* (`Webhook "newPet" (POST)`), since a webhook has no path.
|
|
20
|
+
*/
|
|
21
|
+
export declare const operationLabel: (name: string, method: string, webhook: boolean) => string;
|
|
22
|
+
/**
|
|
23
|
+
* Check a parsed document for the mistakes above, and for the OpenAPI 3.2
|
|
24
|
+
* features Blume doesn't render yet. `$ref` path items are skipped: the
|
|
25
|
+
* extractor already reports them as missing from the reference.
|
|
26
|
+
*/
|
|
27
|
+
export declare const specIssues: (document: ApiDocument) => SpecIssue[];
|
|
@@ -37,6 +37,10 @@ export interface GraphqlTypeRef {
|
|
|
37
37
|
display: string;
|
|
38
38
|
name: string;
|
|
39
39
|
}
|
|
40
|
+
/** A GraphQL input value as JSON carries it in `variables` (enums by name). */
|
|
41
|
+
export type GraphqlJsonValue = string | number | boolean | null | GraphqlJsonValue[] | {
|
|
42
|
+
[key: string]: GraphqlJsonValue;
|
|
43
|
+
};
|
|
40
44
|
/** An argument or input-object field. */
|
|
41
45
|
export interface GraphqlInputValue {
|
|
42
46
|
name: string;
|
|
@@ -44,6 +48,8 @@ export interface GraphqlInputValue {
|
|
|
44
48
|
type: GraphqlTypeRef;
|
|
45
49
|
/** Default value printed as a GraphQL literal (`10`, `"asc"`, `[1, 2]`). */
|
|
46
50
|
default?: string;
|
|
51
|
+
/** The same default as JSON, for the example variables. */
|
|
52
|
+
defaultValue?: GraphqlJsonValue;
|
|
47
53
|
deprecationReason?: string;
|
|
48
54
|
}
|
|
49
55
|
/** An output field of an object or interface type (root fields included). */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Document, OperationObject } from "@scalar/openapi-types/3.
|
|
1
|
+
import type { Document, OperationObject } from "@scalar/openapi-types/3.2";
|
|
2
|
+
import type { GraphqlAuthOptions } from "../reference/options.ts";
|
|
2
3
|
import type { AsyncApiAction, AsyncApiDocument, AsyncApiSpecValue } from "./asyncapi.ts";
|
|
3
4
|
import type { GraphqlDocument, GraphqlMember } from "./graphql.ts";
|
|
4
5
|
import type { ReferenceKind } from "./references.ts";
|
|
@@ -12,10 +13,18 @@ export { slugify } from "./references.ts";
|
|
|
12
13
|
* Each operation is flattened into an {@link ApiOperationRef} with a real,
|
|
13
14
|
* per-operation route so it becomes a first-class Blume page.
|
|
14
15
|
*/
|
|
15
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* A normalized OpenAPI document, internal `$ref`s intact. Typed as 3.2, which
|
|
18
|
+
* is backward compatible with 3.1, so one type covers both the upgraded 3.1
|
|
19
|
+
* documents and the 3.2 ones read as written.
|
|
20
|
+
*/
|
|
16
21
|
export type ApiDocument = Document;
|
|
17
|
-
/**
|
|
18
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The HTTP methods an OpenAPI path item may declare, in spec order. `query`
|
|
24
|
+
* is OpenAPI 3.2's (the QUERY method: a safe request that carries a body); a
|
|
25
|
+
* 3.1 path item can't declare it, so listing it changes nothing there.
|
|
26
|
+
*/
|
|
27
|
+
export declare const HTTP_METHODS: readonly ["get", "put", "post", "delete", "options", "head", "patch", "trace", "query"];
|
|
19
28
|
export type HttpMethod = (typeof HTTP_METHODS)[number];
|
|
20
29
|
/** A stable, URL-safe key for an operation: its `operationId`, else method+path. */
|
|
21
30
|
export declare const operationKey: (method: string, path: string, operationId?: string) => string;
|
|
@@ -79,6 +88,8 @@ export interface ApiSpecData {
|
|
|
79
88
|
* (GraphQL only; OpenAPI documents carry their servers in the document).
|
|
80
89
|
*/
|
|
81
90
|
endpoint?: string;
|
|
91
|
+
/** How the GraphQL endpoint authenticates (GraphQL only). */
|
|
92
|
+
auth?: GraphqlAuthOptions;
|
|
82
93
|
/** Operations keyed by {@link ApiOperationRef.key}. */
|
|
83
94
|
operations: Record<string, ApiOperationRef>;
|
|
84
95
|
tags: ApiTagRef[];
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { AsyncApiDocument } from "./asyncapi.ts";
|
|
2
|
+
import type { SpecIssue } from "./checks.ts";
|
|
2
3
|
import type { GraphqlDocument } from "./graphql.ts";
|
|
3
4
|
import type { ApiDocument } from "./model.ts";
|
|
4
5
|
export interface ParsedSpec {
|
|
5
6
|
document: ApiDocument;
|
|
7
|
+
/** `x-codeSamples` entries whose `$ref` couldn't be inlined. */
|
|
8
|
+
issues: SpecIssue[];
|
|
6
9
|
warnings: string[];
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ResolvedConfig } from "../core/schema.ts";
|
|
2
|
+
import type { GraphqlAuthOptions } from "../reference/options.ts";
|
|
2
3
|
import type { ScalarOptions } from "../reference/scalar.ts";
|
|
3
4
|
import type { ResolvedReferenceAdapter } from "../reference/schema.ts";
|
|
4
5
|
export { normalizeRoute } from "../core/base-path.ts";
|
|
@@ -47,6 +48,12 @@ export interface ReferenceSource {
|
|
|
47
48
|
*/
|
|
48
49
|
basePath: string;
|
|
49
50
|
label: string;
|
|
51
|
+
/**
|
|
52
|
+
* The source's own `label`, when it sets one: it names the sidebar group
|
|
53
|
+
* of the source's route. An unlabeled source's group keeps the name its
|
|
54
|
+
* route gives it.
|
|
55
|
+
*/
|
|
56
|
+
groupLabel?: string;
|
|
50
57
|
/** Whether generated pages are included in llms.txt/llms-full.txt. */
|
|
51
58
|
includeInLlms: boolean;
|
|
52
59
|
/** Whether generated pages are included in site search. */
|
|
@@ -70,6 +77,8 @@ export interface ReferenceSource {
|
|
|
70
77
|
* (GraphQL only — a schema, unlike an OpenAPI document, names no server).
|
|
71
78
|
*/
|
|
72
79
|
endpoint?: string;
|
|
80
|
+
/** How the GraphQL endpoint authenticates (GraphQL only). */
|
|
81
|
+
auth?: GraphqlAuthOptions;
|
|
73
82
|
/**
|
|
74
83
|
* The `scalar()` adapter's own options (`scalar` kind only): `theme` plus
|
|
75
84
|
* any Scalar config forwarded verbatim to `<ScalarComponent>`, which takes
|
|
@@ -112,6 +121,13 @@ export declare const resolveReferences: (config: ResolvedConfig) => ReferenceSou
|
|
|
112
121
|
export declare const referenceRoutes: (config: ResolvedConfig) => string[];
|
|
113
122
|
/** Blume-rendered references (every kind but Scalar), deduped by route (first wins). */
|
|
114
123
|
export declare const blumeReferences: (config: ResolvedConfig) => BlumeReferenceSource[];
|
|
124
|
+
/**
|
|
125
|
+
* The local files every reference reads, as absolute paths: each spec and
|
|
126
|
+
* overlay that isn't an `http(s)` URL, resolved from the project root the way
|
|
127
|
+
* the parser resolves them. `blume dev` watches these, so an edit to a spec
|
|
128
|
+
* regenerates its reference like an edit to a page does.
|
|
129
|
+
*/
|
|
130
|
+
export declare const referenceSpecFiles: (config: ResolvedConfig, root: string) => string[];
|
|
115
131
|
/** Whether any reference is Scalar-rendered (gates the Scalar pages). */
|
|
116
132
|
export declare const hasScalarReferences: (config: ResolvedConfig) => boolean;
|
|
117
133
|
/**
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
/** Whether `text` ends in a colon that leads in to what follows it. */
|
|
2
|
+
export declare const endsInLeadIn: (text: string) => boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Close prose with a period unless it already ends a sentence. A colon at the
|
|
5
|
+
* end is kept and gains the period: use this when the caller has already told
|
|
6
|
+
* a lead-in apart from a literal (`tenant:` in inline code). Empty text stays
|
|
7
|
+
* empty.
|
|
8
|
+
*/
|
|
9
|
+
export declare const closeSentence: (text: string) => string;
|
|
1
10
|
/**
|
|
2
11
|
* Close a fragment of spec prose as a sentence. OpenAPI `summary` values are
|
|
3
12
|
* usually title-like ("Get a flag", no period), so prose that runs straight
|
|
4
13
|
* into the next generated sentence ("Get a flag Reference for …") needs one.
|
|
5
|
-
*
|
|
14
|
+
* A lead-in colon becomes the period rather than gaining one after it, and
|
|
15
|
+
* prose that already ended before it ("e.g.:") keeps its own mark.
|
|
6
16
|
*/
|
|
7
17
|
export declare const asSentence: (text: string) => string;
|
|
@@ -24,4 +24,4 @@ export { memory } from "./memory.ts";
|
|
|
24
24
|
export type { MemoryAdapter, RateLimitOptions } from "./memory.ts";
|
|
25
25
|
export type { RateLimitAdapter } from "./schema.ts";
|
|
26
26
|
export { upstash } from "./upstash.ts";
|
|
27
|
-
export type { UpstashAdapter } from "./upstash.ts";
|
|
27
|
+
export type { UpstashAdapter, UpstashOptions } from "./upstash.ts";
|
|
@@ -22,6 +22,8 @@ export declare const rateLimitAdapterSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
22
22
|
options: z.ZodObject<{
|
|
23
23
|
requests: z.ZodOptional<z.ZodNumber>;
|
|
24
24
|
window: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
tokenEnv: z.ZodOptional<z.ZodString>;
|
|
26
|
+
urlEnv: z.ZodOptional<z.ZodString>;
|
|
25
27
|
}, z.core.$strict>;
|
|
26
28
|
requiredSecrets: z.ZodArray<z.ZodString>;
|
|
27
29
|
runtimeDeps: z.ZodArray<z.ZodString>;
|
|
@@ -55,6 +57,8 @@ export declare const rateLimitConfigSchema: z.ZodPipe<z.ZodOptional<z.ZodUnion<r
|
|
|
55
57
|
options: z.ZodObject<{
|
|
56
58
|
requests: z.ZodOptional<z.ZodNumber>;
|
|
57
59
|
window: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
tokenEnv: z.ZodOptional<z.ZodString>;
|
|
61
|
+
urlEnv: z.ZodOptional<z.ZodString>;
|
|
58
62
|
}, z.core.$strict>;
|
|
59
63
|
requiredSecrets: z.ZodArray<z.ZodString>;
|
|
60
64
|
runtimeDeps: z.ZodArray<z.ZodString>;
|
|
@@ -80,6 +84,8 @@ export declare const rateLimitConfigSchema: z.ZodPipe<z.ZodOptional<z.ZodUnion<r
|
|
|
80
84
|
options: {
|
|
81
85
|
requests?: number | undefined;
|
|
82
86
|
window?: number | undefined;
|
|
87
|
+
tokenEnv?: string | undefined;
|
|
88
|
+
urlEnv?: string | undefined;
|
|
83
89
|
};
|
|
84
90
|
requiredSecrets: string[];
|
|
85
91
|
runtimeDeps: string[];
|
|
@@ -105,6 +111,8 @@ export declare const rateLimitConfigSchema: z.ZodPipe<z.ZodOptional<z.ZodUnion<r
|
|
|
105
111
|
options: {
|
|
106
112
|
requests?: number | undefined;
|
|
107
113
|
window?: number | undefined;
|
|
114
|
+
tokenEnv?: string | undefined;
|
|
115
|
+
urlEnv?: string | undefined;
|
|
108
116
|
};
|
|
109
117
|
requiredSecrets: string[];
|
|
110
118
|
runtimeDeps: string[];
|