blume 0.0.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/blume.mjs +18 -0
- package/dist/cli/index.js +12696 -0
- package/dist/cli/index.js.map +145 -0
- package/dist/types/core/bridge.d.ts +24 -0
- package/dist/types/core/config.d.ts +35 -0
- package/dist/types/core/data.d.ts +129 -0
- package/dist/types/core/define-components.d.ts +27 -0
- package/dist/types/core/define-meta.d.ts +16 -0
- package/dist/types/core/deployment-env.d.ts +9 -0
- package/dist/types/core/diagnostics.d.ts +17 -0
- package/dist/types/core/i18n-ui.d.ts +500 -0
- package/dist/types/core/load-module.d.ts +7 -0
- package/dist/types/core/package-root.d.ts +17 -0
- package/dist/types/core/project.d.ts +9 -0
- package/dist/types/core/schema.d.ts +3451 -0
- package/dist/types/core/sources/types.d.ts +107 -0
- package/dist/types/core/types.d.ts +245 -0
- package/dist/types/core/ui-packs/ar.d.ts +3 -0
- package/dist/types/core/ui-packs/bg.d.ts +3 -0
- package/dist/types/core/ui-packs/bn.d.ts +3 -0
- package/dist/types/core/ui-packs/ca.d.ts +3 -0
- package/dist/types/core/ui-packs/cs.d.ts +3 -0
- package/dist/types/core/ui-packs/da.d.ts +3 -0
- package/dist/types/core/ui-packs/de.d.ts +3 -0
- package/dist/types/core/ui-packs/el.d.ts +3 -0
- package/dist/types/core/ui-packs/es.d.ts +3 -0
- package/dist/types/core/ui-packs/fa.d.ts +3 -0
- package/dist/types/core/ui-packs/fi.d.ts +3 -0
- package/dist/types/core/ui-packs/fr.d.ts +3 -0
- package/dist/types/core/ui-packs/he.d.ts +3 -0
- package/dist/types/core/ui-packs/hi.d.ts +3 -0
- package/dist/types/core/ui-packs/hr.d.ts +3 -0
- package/dist/types/core/ui-packs/hu.d.ts +3 -0
- package/dist/types/core/ui-packs/id.d.ts +3 -0
- package/dist/types/core/ui-packs/index.d.ts +13 -0
- package/dist/types/core/ui-packs/it.d.ts +3 -0
- package/dist/types/core/ui-packs/ja.d.ts +3 -0
- package/dist/types/core/ui-packs/ko.d.ts +3 -0
- package/dist/types/core/ui-packs/nl.d.ts +3 -0
- package/dist/types/core/ui-packs/no.d.ts +3 -0
- package/dist/types/core/ui-packs/pl.d.ts +3 -0
- package/dist/types/core/ui-packs/pt-br.d.ts +3 -0
- package/dist/types/core/ui-packs/pt.d.ts +3 -0
- package/dist/types/core/ui-packs/ro.d.ts +3 -0
- package/dist/types/core/ui-packs/ru.d.ts +3 -0
- package/dist/types/core/ui-packs/sk.d.ts +3 -0
- package/dist/types/core/ui-packs/sr.d.ts +3 -0
- package/dist/types/core/ui-packs/sv.d.ts +3 -0
- package/dist/types/core/ui-packs/th.d.ts +3 -0
- package/dist/types/core/ui-packs/tr.d.ts +3 -0
- package/dist/types/core/ui-packs/uk.d.ts +3 -0
- package/dist/types/core/ui-packs/vi.d.ts +3 -0
- package/dist/types/core/ui-packs/zh-tw.d.ts +3 -0
- package/dist/types/core/ui-packs/zh.d.ts +3 -0
- package/dist/types/core/version.d.ts +8 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/migrate/mintlify/config.d.ts +2 -0
- package/dist/types/migrate/mintlify/i18n.d.ts +7 -0
- package/dist/types/theme/fonts.d.ts +163 -0
- package/docs/01-quickstart.mdx +99 -0
- package/docs/02-deployment.mdx +129 -0
- package/docs/advanced/api-reference.mdx +114 -0
- package/docs/advanced/blog.mdx +121 -0
- package/docs/advanced/changelog.mdx +113 -0
- package/docs/advanced/custom-pages.mdx +268 -0
- package/docs/advanced/meta.ts +7 -0
- package/docs/changelog/v0-1-0.mdx +12 -0
- package/docs/changelog/v0-2-0.mdx +16 -0
- package/docs/configuration/ai.mdx +228 -0
- package/docs/configuration/analytics.mdx +98 -0
- package/docs/configuration/customization.mdx +91 -0
- package/docs/configuration/export.mdx +70 -0
- package/docs/configuration/index.mdx +290 -0
- package/docs/configuration/meta.ts +15 -0
- package/docs/configuration/search.mdx +172 -0
- package/docs/configuration/seo.mdx +196 -0
- package/docs/configuration/theming.mdx +178 -0
- package/docs/content/components.mdx +651 -0
- package/docs/content/i18n.mdx +205 -0
- package/docs/content/index.mdx +161 -0
- package/docs/content/islands.mdx +94 -0
- package/docs/content/meta.mdx +119 -0
- package/docs/content/meta.ts +15 -0
- package/docs/content/navigation.mdx +168 -0
- package/docs/content/sources.mdx +216 -0
- package/docs/content/syntax.mdx +445 -0
- package/docs/index.mdx +112 -0
- package/docs/reference/cli.mdx +43 -0
- package/docs/reference/frontmatter.mdx +74 -0
- package/docs/reference/meta.ts +7 -0
- package/package.json +150 -6
- package/src/ai/ask.ts +93 -0
- package/src/ai/llms.ts +64 -0
- package/src/ai/markdown.ts +31 -0
- package/src/ai/mcp/data.ts +74 -0
- package/src/ai/mcp/discovery.ts +49 -0
- package/src/ai/mcp/server.ts +225 -0
- package/src/ai/mcp/tools.ts +47 -0
- package/src/assets/icon.png +0 -0
- package/src/astro/examples.ts +104 -0
- package/src/astro/generate.ts +1006 -0
- package/src/astro/index.ts +4 -0
- package/src/astro/integration.ts +74 -0
- package/src/astro/islands.ts +131 -0
- package/src/astro/markdown-negotiation.ts +68 -0
- package/src/astro/pages.ts +87 -0
- package/src/astro/templates.ts +1326 -0
- package/src/cli/commands/add.ts +81 -0
- package/src/cli/commands/build.ts +103 -0
- package/src/cli/commands/dev.ts +108 -0
- package/src/cli/commands/doctor.ts +74 -0
- package/src/cli/commands/eject.ts +57 -0
- package/src/cli/commands/init.ts +98 -0
- package/src/cli/commands/migrate.ts +39 -0
- package/src/cli/commands/preview.ts +39 -0
- package/src/cli/commands/sync.ts +52 -0
- package/src/cli/commands/validate.ts +61 -0
- package/src/cli/index.ts +35 -0
- package/src/cli/log.ts +37 -0
- package/src/cli/prepare.ts +80 -0
- package/src/components/Icon.astro +99 -0
- package/src/components/content/Accordion.astro +8 -0
- package/src/components/content/AccordionItem.astro +121 -0
- package/src/components/content/AutoTypeTable.astro +51 -0
- package/src/components/content/Badge.astro +124 -0
- package/src/components/content/Callout.astro +73 -0
- package/src/components/content/Card.astro +104 -0
- package/src/components/content/CardGroup.astro +14 -0
- package/src/components/content/CodeBlock.astro +28 -0
- package/src/components/content/CodeGroup.astro +13 -0
- package/src/components/content/Color.astro +15 -0
- package/src/components/content/ColorItem.astro +87 -0
- package/src/components/content/ColorRow.astro +10 -0
- package/src/components/content/Column.astro +6 -0
- package/src/components/content/Columns.astro +9 -0
- package/src/components/content/Component.astro +65 -0
- package/src/components/content/Diff.astro +44 -0
- package/src/components/content/Expandable.astro +11 -0
- package/src/components/content/FileTree.astro +8 -0
- package/src/components/content/Frame.astro +70 -0
- package/src/components/content/GithubInfo.astro +110 -0
- package/src/components/content/Math.astro +24 -0
- package/src/components/content/Panel.astro +20 -0
- package/src/components/content/Prompt.astro +129 -0
- package/src/components/content/Step.astro +34 -0
- package/src/components/content/Steps.astro +20 -0
- package/src/components/content/Tab.astro +46 -0
- package/src/components/content/Tabs.astro +273 -0
- package/src/components/content/Tile.astro +42 -0
- package/src/components/content/Tooltip.astro +68 -0
- package/src/components/content/Tree.astro +300 -0
- package/src/components/content/TreeFile.astro +15 -0
- package/src/components/content/TreeFolder.astro +62 -0
- package/src/components/content/TypeTable.astro +106 -0
- package/src/components/content/Update.astro +66 -0
- package/src/components/content/Visibility.astro +12 -0
- package/src/components/content/Warning.astro +9 -0
- package/src/components/content/auto-type-table.ts +141 -0
- package/src/components/content/diff.ts +95 -0
- package/src/components/content/github-info.ts +79 -0
- package/src/components/content/mermaid-element.ts +68 -0
- package/src/components/github-mark.ts +9 -0
- package/src/components/index.ts +14 -0
- package/src/components/islands/AskAI.astro +12 -0
- package/src/components/islands/ask-ai.tsx +156 -0
- package/src/components/layout/Analytics.astro +63 -0
- package/src/components/layout/Banner.astro +50 -0
- package/src/components/layout/Breadcrumbs.astro +31 -0
- package/src/components/layout/Favicon.astro +22 -0
- package/src/components/layout/Fonts.astro +14 -0
- package/src/components/layout/Header.astro +188 -0
- package/src/components/layout/LanguageSwitcher.astro +56 -0
- package/src/components/layout/NavTree.astro +462 -0
- package/src/components/layout/PageActions.astro +438 -0
- package/src/components/layout/PageFeedback.astro +58 -0
- package/src/components/layout/PageLayout.astro +173 -0
- package/src/components/layout/Pagination.astro +56 -0
- package/src/components/layout/ReferenceLayout.astro +107 -0
- package/src/components/layout/RootLayout.astro +537 -0
- package/src/components/layout/Search.astro +608 -0
- package/src/components/layout/TableOfContents.astro +68 -0
- package/src/components/layout/analytics-client.ts +38 -0
- package/src/components/layout/head-scripts.ts +19 -0
- package/src/components/layout/nav-utils.ts +87 -0
- package/src/components/layout/overrides.ts +32 -0
- package/src/components/layout/search/algolia.ts +43 -0
- package/src/components/layout/search/endpoint.ts +22 -0
- package/src/components/layout/search/flexsearch.ts +52 -0
- package/src/components/layout/search/orama-cloud.ts +41 -0
- package/src/components/layout/search/orama.ts +26 -0
- package/src/components/layout/search/pagefind.ts +43 -0
- package/src/components/layout/search/types.ts +163 -0
- package/src/components/layout/search/typesense.ts +60 -0
- package/src/components/layout/toc-element.ts +108 -0
- package/src/core/bridge.ts +92 -0
- package/src/core/config.ts +112 -0
- package/src/core/content.ts +50 -0
- package/src/core/data.ts +128 -0
- package/src/core/define-components.ts +34 -0
- package/src/core/define-meta.ts +20 -0
- package/src/core/deployment-env.ts +73 -0
- package/src/core/diagnostics.ts +104 -0
- package/src/core/frontmatter.ts +43 -0
- package/src/core/graph.ts +128 -0
- package/src/core/i18n-ui.ts +171 -0
- package/src/core/i18n.ts +169 -0
- package/src/core/last-modified.ts +88 -0
- package/src/core/links.ts +352 -0
- package/src/core/load-module.ts +15 -0
- package/src/core/manifest.ts +126 -0
- package/src/core/meta.ts +97 -0
- package/src/core/navigation.ts +392 -0
- package/src/core/package-root.ts +37 -0
- package/src/core/project-graph.ts +153 -0
- package/src/core/project.ts +56 -0
- package/src/core/schema.ts +1057 -0
- package/src/core/server-features.ts +23 -0
- package/src/core/sources/assets.ts +77 -0
- package/src/core/sources/cache.ts +122 -0
- package/src/core/sources/filesystem.ts +99 -0
- package/src/core/sources/mdx-remote.ts +215 -0
- package/src/core/sources/mintlify.ts +161 -0
- package/src/core/sources/normalize.ts +243 -0
- package/src/core/sources/notion.ts +440 -0
- package/src/core/sources/portable-text.ts +143 -0
- package/src/core/sources/read.ts +36 -0
- package/src/core/sources/resolve.ts +158 -0
- package/src/core/sources/sanity.ts +218 -0
- package/src/core/sources/types.ts +105 -0
- package/src/core/tsconfig-aliases.ts +201 -0
- package/src/core/types.ts +261 -0
- package/src/core/ui-packs/ar.ts +47 -0
- package/src/core/ui-packs/bg.ts +47 -0
- package/src/core/ui-packs/bn.ts +47 -0
- package/src/core/ui-packs/ca.ts +47 -0
- package/src/core/ui-packs/cs.ts +47 -0
- package/src/core/ui-packs/da.ts +47 -0
- package/src/core/ui-packs/de.ts +47 -0
- package/src/core/ui-packs/el.ts +47 -0
- package/src/core/ui-packs/es.ts +47 -0
- package/src/core/ui-packs/fa.ts +47 -0
- package/src/core/ui-packs/fi.ts +47 -0
- package/src/core/ui-packs/fr.ts +47 -0
- package/src/core/ui-packs/he.ts +47 -0
- package/src/core/ui-packs/hi.ts +47 -0
- package/src/core/ui-packs/hr.ts +47 -0
- package/src/core/ui-packs/hu.ts +47 -0
- package/src/core/ui-packs/id.ts +47 -0
- package/src/core/ui-packs/index.ts +87 -0
- package/src/core/ui-packs/it.ts +47 -0
- package/src/core/ui-packs/ja.ts +47 -0
- package/src/core/ui-packs/ko.ts +47 -0
- package/src/core/ui-packs/nl.ts +47 -0
- package/src/core/ui-packs/no.ts +47 -0
- package/src/core/ui-packs/pl.ts +47 -0
- package/src/core/ui-packs/pt-br.ts +47 -0
- package/src/core/ui-packs/pt.ts +47 -0
- package/src/core/ui-packs/ro.ts +47 -0
- package/src/core/ui-packs/ru.ts +47 -0
- package/src/core/ui-packs/sk.ts +47 -0
- package/src/core/ui-packs/sr.ts +47 -0
- package/src/core/ui-packs/sv.ts +47 -0
- package/src/core/ui-packs/th.ts +47 -0
- package/src/core/ui-packs/tr.ts +47 -0
- package/src/core/ui-packs/uk.ts +47 -0
- package/src/core/ui-packs/vi.ts +47 -0
- package/src/core/ui-packs/zh-tw.ts +47 -0
- package/src/core/ui-packs/zh.ts +47 -0
- package/src/core/version.ts +23 -0
- package/src/deploy/robots.ts +20 -0
- package/src/deploy/rss.ts +128 -0
- package/src/deploy/sitemap.ts +28 -0
- package/src/index.ts +39 -0
- package/src/markdown/code-title.ts +71 -0
- package/src/markdown/directives.ts +83 -0
- package/src/markdown/heading-anchors.ts +137 -0
- package/src/markdown/index.ts +228 -0
- package/src/markdown/inline-code.ts +108 -0
- package/src/markdown/language-icon.ts +172 -0
- package/src/markdown/math.ts +32 -0
- package/src/markdown/mdast.ts +48 -0
- package/src/markdown/mermaid.ts +37 -0
- package/src/markdown/package-commands.ts +159 -0
- package/src/markdown/package-install.ts +40 -0
- package/src/migrate/fumadocs/config.ts +155 -0
- package/src/migrate/fumadocs/content.ts +365 -0
- package/src/migrate/fumadocs/frontmatter.ts +18 -0
- package/src/migrate/fumadocs/groups.ts +230 -0
- package/src/migrate/fumadocs/index.ts +337 -0
- package/src/migrate/fumadocs/meta.ts +244 -0
- package/src/migrate/migrate.ts +53 -0
- package/src/migrate/mintlify/config.ts +1040 -0
- package/src/migrate/mintlify/content.ts +98 -0
- package/src/migrate/mintlify/frontmatter.ts +126 -0
- package/src/migrate/mintlify/i18n.ts +51 -0
- package/src/migrate/mintlify/icons.ts +128 -0
- package/src/migrate/mintlify/index.ts +266 -0
- package/src/migrate/mintlify/snippets.ts +306 -0
- package/src/migrate/mintlify/transform.ts +80 -0
- package/src/migrate/nextra/content.ts +46 -0
- package/src/migrate/nextra/frontmatter.ts +40 -0
- package/src/migrate/nextra/index.ts +374 -0
- package/src/migrate/nextra/meta.ts +266 -0
- package/src/migrate/shared.ts +720 -0
- package/src/migrate/starlight/config.ts +459 -0
- package/src/migrate/starlight/content.ts +78 -0
- package/src/migrate/starlight/frontmatter.ts +111 -0
- package/src/migrate/starlight/i18n.ts +54 -0
- package/src/migrate/starlight/index.ts +131 -0
- package/src/og/card.ts +92 -0
- package/src/og/index.ts +2 -0
- package/src/openapi/scalar.ts +246 -0
- package/src/registry/eject.ts +310 -0
- package/src/registry/registry.ts +100 -0
- package/src/registry/rewrite-imports.ts +39 -0
- package/src/runtime/index.ts +14 -0
- package/src/search/build.ts +23 -0
- package/src/search/documents.ts +164 -0
- package/src/search/orama-index.ts +66 -0
- package/src/search/providers.ts +91 -0
- package/src/search/sync/algolia.ts +30 -0
- package/src/search/sync/index.ts +50 -0
- package/src/search/sync/orama-cloud.ts +40 -0
- package/src/search/sync/typesense.ts +65 -0
- package/src/seo/jsonld.ts +113 -0
- package/src/theme/entry.ts +637 -0
- package/src/theme/fonts.ts +198 -0
- package/src/theme/icons.ts +184 -0
- package/src/theme/palette.ts +143 -0
- package/src/theme/twoslash.ts +81 -0
package/package.json
CHANGED
|
@@ -1,11 +1,155 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blume",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Documentation that's fast, AI-ready, and zero-config.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"astro",
|
|
7
|
+
"docs",
|
|
8
|
+
"documentation",
|
|
9
|
+
"markdown",
|
|
10
|
+
"mdx",
|
|
11
|
+
"vite"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/haydenbleasel/blume#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/haydenbleasel/blume/issues"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": "Hayden Bleasel",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/haydenbleasel/blume.git",
|
|
22
|
+
"directory": "packages/blume"
|
|
23
|
+
},
|
|
24
|
+
"bin": {
|
|
25
|
+
"blume": "./bin/blume.mjs"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"src",
|
|
30
|
+
"bin",
|
|
31
|
+
"docs"
|
|
32
|
+
],
|
|
33
|
+
"type": "module",
|
|
34
|
+
"types": "./dist/types/index.d.ts",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/types/index.d.ts",
|
|
38
|
+
"default": "./src/index.ts"
|
|
39
|
+
},
|
|
40
|
+
"./ai/*": "./src/ai/*",
|
|
41
|
+
"./schema": {
|
|
42
|
+
"types": "./dist/types/core/schema.d.ts",
|
|
43
|
+
"default": "./src/core/schema.ts"
|
|
44
|
+
},
|
|
45
|
+
"./runtime": "./src/runtime/index.ts",
|
|
46
|
+
"./astro": "./src/astro/index.ts",
|
|
47
|
+
"./og": "./src/og/index.ts",
|
|
48
|
+
"./markdown": "./src/markdown/index.ts",
|
|
49
|
+
"./components": "./src/components/index.ts",
|
|
50
|
+
"./components/*": "./src/components/*",
|
|
51
|
+
"./core/*": "./src/core/*",
|
|
52
|
+
"./sources/*": "./src/core/sources/*",
|
|
53
|
+
"./theme/*": "./src/theme/*",
|
|
54
|
+
"./package.json": "./package.json"
|
|
55
|
+
},
|
|
5
56
|
"scripts": {
|
|
6
|
-
"
|
|
57
|
+
"build": "bun run scripts/build.ts",
|
|
58
|
+
"bundle-docs": "node scripts/bundle-docs.mjs",
|
|
59
|
+
"prepack": "bun run scripts/build.ts && node scripts/bundle-docs.mjs",
|
|
60
|
+
"test": "bun test",
|
|
61
|
+
"test:coverage": "bun test --coverage",
|
|
62
|
+
"typecheck": "tsgo --noEmit && tsgo -p test/tsconfig.json --noEmit"
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@astrojs/markdown-satteri": "^0.3.2",
|
|
66
|
+
"@astrojs/mdx": "^7.0.0",
|
|
67
|
+
"@astrojs/node": "^11.0.0",
|
|
68
|
+
"@astrojs/react": "^6.0.0",
|
|
69
|
+
"@astrojs/vercel": "^11.0.0",
|
|
70
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
71
|
+
"@orama/orama": "^3.1.18",
|
|
72
|
+
"@pierre/diffs": "^1.2.11",
|
|
73
|
+
"@scalar/astro": "^0.4.5",
|
|
74
|
+
"@shikijs/transformers": "^4.2.0",
|
|
75
|
+
"@shikijs/twoslash": "^4.2.0",
|
|
76
|
+
"@tailwindcss/typography": "^0.5.20",
|
|
77
|
+
"@tailwindcss/vite": "^4",
|
|
78
|
+
"@takumi-rs/core": "^1.8.7",
|
|
79
|
+
"@takumi-rs/helpers": "^1.8.7",
|
|
80
|
+
"@vercel/analytics": "^2.0.1",
|
|
81
|
+
"ai": "^5.0.0",
|
|
82
|
+
"astro": "^7.0.2",
|
|
83
|
+
"citty": "^0.1.6",
|
|
84
|
+
"consola": "^3.4.0",
|
|
85
|
+
"deepmerge": "^4.3.1",
|
|
86
|
+
"epub-gen-memory": "^1.1.2",
|
|
87
|
+
"github-slugger": "^2.0.0",
|
|
88
|
+
"gray-matter": "^4.0.3",
|
|
89
|
+
"jiti": "^2.4.0",
|
|
90
|
+
"js-yaml": "^4.1.0",
|
|
91
|
+
"katex": "^0.17.0",
|
|
92
|
+
"mermaid": "^11.15.0",
|
|
93
|
+
"pagefind": "^1.3.0",
|
|
94
|
+
"pathe": "^2.0.0",
|
|
95
|
+
"react": "^19.0.0",
|
|
96
|
+
"react-dom": "^19.0.0",
|
|
97
|
+
"shiki": "^4.2.0",
|
|
98
|
+
"simple-icons": "^13.0.0",
|
|
99
|
+
"tailwindcss": "^4",
|
|
100
|
+
"tinyglobby": "^0.2.10",
|
|
101
|
+
"typescript": "^5.7.0",
|
|
102
|
+
"zod": "^3.24.0"
|
|
103
|
+
},
|
|
104
|
+
"devDependencies": {
|
|
105
|
+
"@types/js-yaml": "^4.0.9",
|
|
106
|
+
"@types/node": "^22.10.0",
|
|
107
|
+
"@types/react": "^19.0.0",
|
|
108
|
+
"@types/react-dom": "^19.0.0",
|
|
109
|
+
"@typescript/native-preview": "^7.0.0-dev.20260626.1",
|
|
110
|
+
"bun-types": "^1.3.14"
|
|
111
|
+
},
|
|
112
|
+
"peerDependencies": {
|
|
113
|
+
"@ai-sdk/openai-compatible": "^1.0.41",
|
|
114
|
+
"@mixedbread/sdk": "^0.76.0",
|
|
115
|
+
"@notionhq/client": "^2.2.15",
|
|
116
|
+
"@openrouter/ai-sdk-provider": "^1.5.4",
|
|
117
|
+
"@oramacloud/client": "^2.1.0",
|
|
118
|
+
"@sanity/client": "^6.21.0",
|
|
119
|
+
"algoliasearch": "^5.55.0",
|
|
120
|
+
"flexsearch": "^0.8.0",
|
|
121
|
+
"typesense": "^3.0.0"
|
|
122
|
+
},
|
|
123
|
+
"peerDependenciesMeta": {
|
|
124
|
+
"@ai-sdk/openai-compatible": {
|
|
125
|
+
"optional": true
|
|
126
|
+
},
|
|
127
|
+
"@mixedbread/sdk": {
|
|
128
|
+
"optional": true
|
|
129
|
+
},
|
|
130
|
+
"@openrouter/ai-sdk-provider": {
|
|
131
|
+
"optional": true
|
|
132
|
+
},
|
|
133
|
+
"@notionhq/client": {
|
|
134
|
+
"optional": true
|
|
135
|
+
},
|
|
136
|
+
"@oramacloud/client": {
|
|
137
|
+
"optional": true
|
|
138
|
+
},
|
|
139
|
+
"@sanity/client": {
|
|
140
|
+
"optional": true
|
|
141
|
+
},
|
|
142
|
+
"algoliasearch": {
|
|
143
|
+
"optional": true
|
|
144
|
+
},
|
|
145
|
+
"flexsearch": {
|
|
146
|
+
"optional": true
|
|
147
|
+
},
|
|
148
|
+
"typesense": {
|
|
149
|
+
"optional": true
|
|
150
|
+
}
|
|
7
151
|
},
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
152
|
+
"engines": {
|
|
153
|
+
"node": ">=22.12.0"
|
|
154
|
+
}
|
|
11
155
|
}
|
package/src/ai/ask.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { AskAiConfig } from "../core/schema.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The concrete backend the Ask AI endpoint is generated against. `gateway` uses
|
|
5
|
+
* the AI SDK core (`streamText({ model })`) and the Vercel AI Gateway;
|
|
6
|
+
* `openrouter` uses its dedicated provider; everything else streams through the
|
|
7
|
+
* AI SDK's OpenAI-compatible provider.
|
|
8
|
+
*/
|
|
9
|
+
export type AskBackend =
|
|
10
|
+
| { kind: "gateway"; model: string }
|
|
11
|
+
| { apiKeyEnv: string; kind: "openrouter"; model: string }
|
|
12
|
+
| {
|
|
13
|
+
apiKeyEnv: string;
|
|
14
|
+
baseUrl: string;
|
|
15
|
+
kind: "openai-compatible";
|
|
16
|
+
model: string;
|
|
17
|
+
name: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
interface AskPreset {
|
|
21
|
+
apiKeyEnv: string;
|
|
22
|
+
baseUrl?: string;
|
|
23
|
+
kind: "openai-compatible" | "openrouter";
|
|
24
|
+
name: string;
|
|
25
|
+
runtimeDep: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Connection presets for the named, non-gateway providers. OpenRouter has a
|
|
30
|
+
* dedicated AI SDK provider; LLMGateway and Inkeep are OpenAI-compatible
|
|
31
|
+
* endpoints with no dedicated provider, so they reuse `@ai-sdk/openai-compatible`.
|
|
32
|
+
*/
|
|
33
|
+
const ASK_PRESETS: Record<string, AskPreset> = {
|
|
34
|
+
inkeep: {
|
|
35
|
+
apiKeyEnv: "INKEEP_API_KEY",
|
|
36
|
+
baseUrl: "https://api.inkeep.com/v1",
|
|
37
|
+
kind: "openai-compatible",
|
|
38
|
+
name: "inkeep",
|
|
39
|
+
runtimeDep: "@ai-sdk/openai-compatible",
|
|
40
|
+
},
|
|
41
|
+
llmgateway: {
|
|
42
|
+
apiKeyEnv: "LLMGATEWAY_API_KEY",
|
|
43
|
+
baseUrl: "https://api.llmgateway.io/v1",
|
|
44
|
+
kind: "openai-compatible",
|
|
45
|
+
name: "llmgateway",
|
|
46
|
+
runtimeDep: "@ai-sdk/openai-compatible",
|
|
47
|
+
},
|
|
48
|
+
openrouter: {
|
|
49
|
+
apiKeyEnv: "OPENROUTER_API_KEY",
|
|
50
|
+
kind: "openrouter",
|
|
51
|
+
name: "openrouter",
|
|
52
|
+
runtimeDep: "@openrouter/ai-sdk-provider",
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const DEFAULT_MODEL = "openai/gpt-5.5";
|
|
57
|
+
|
|
58
|
+
/** Resolve the `ai.ask` config into the backend the endpoint is built against. */
|
|
59
|
+
export const resolveAskBackend = (ask?: AskAiConfig): AskBackend => {
|
|
60
|
+
const provider = ask?.provider ?? "gateway";
|
|
61
|
+
const model = ask?.model ?? DEFAULT_MODEL;
|
|
62
|
+
if (provider === "gateway") {
|
|
63
|
+
return { kind: "gateway", model };
|
|
64
|
+
}
|
|
65
|
+
const preset = ASK_PRESETS[provider];
|
|
66
|
+
const apiKeyEnv = ask?.apiKeyEnv ?? preset?.apiKeyEnv ?? "API_KEY";
|
|
67
|
+
if (provider === "openrouter") {
|
|
68
|
+
return { apiKeyEnv, kind: "openrouter", model };
|
|
69
|
+
}
|
|
70
|
+
// `llmgateway`, `inkeep`, and the generic `openai-compatible` provider all
|
|
71
|
+
// stream through the AI SDK's OpenAI-compatible provider. The schema requires
|
|
72
|
+
// `baseUrl` for the generic case; the named providers fall back to a preset.
|
|
73
|
+
return {
|
|
74
|
+
apiKeyEnv,
|
|
75
|
+
baseUrl: ask?.baseUrl ?? preset?.baseUrl ?? "",
|
|
76
|
+
kind: "openai-compatible",
|
|
77
|
+
model,
|
|
78
|
+
name: preset?.name ?? "openai-compatible",
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The provider SDK a project must install for the configured backend, or
|
|
84
|
+
* `undefined` for `gateway` (which only needs the core `ai` package). Declared
|
|
85
|
+
* in the generated runtime so a project pulls in exactly the backend it uses.
|
|
86
|
+
*/
|
|
87
|
+
export const askBackendRuntimeDep = (ask?: AskAiConfig): string | undefined => {
|
|
88
|
+
const provider = ask?.provider ?? "gateway";
|
|
89
|
+
if (provider === "gateway") {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
return ASK_PRESETS[provider]?.runtimeDep ?? "@ai-sdk/openai-compatible";
|
|
93
|
+
};
|
package/src/ai/llms.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import matter from "../core/frontmatter.ts";
|
|
2
|
+
import type { BlumeProject } from "../core/project-graph.ts";
|
|
3
|
+
import { readEntryText } from "../core/sources/read.ts";
|
|
4
|
+
import type { PageRecord } from "../core/types.ts";
|
|
5
|
+
|
|
6
|
+
const pageUrl = (route: string, site?: string): string => {
|
|
7
|
+
if (!site) {
|
|
8
|
+
return route;
|
|
9
|
+
}
|
|
10
|
+
return `${site.replace(/\/$/u, "")}${route}`;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const orderedPages = (project: BlumeProject): PageRecord[] =>
|
|
14
|
+
[...project.graph.pages]
|
|
15
|
+
.filter((page) => !page.meta.draft)
|
|
16
|
+
.sort((a, b) => a.route.localeCompare(b.route));
|
|
17
|
+
|
|
18
|
+
/** Build the compact `llms.txt` index: title, summary, and links per page. */
|
|
19
|
+
const buildIndex = (project: BlumeProject): string => {
|
|
20
|
+
const { config } = project;
|
|
21
|
+
const { site } = config.deployment;
|
|
22
|
+
const lines = [`# ${config.title}`];
|
|
23
|
+
if (config.description) {
|
|
24
|
+
lines.push("", `> ${config.description}`);
|
|
25
|
+
}
|
|
26
|
+
lines.push("", "## Docs", "");
|
|
27
|
+
|
|
28
|
+
for (const page of orderedPages(project)) {
|
|
29
|
+
const url = pageUrl(page.route, site);
|
|
30
|
+
const summary = page.description ? `: ${page.description}` : "";
|
|
31
|
+
lines.push(`- [${page.title}](${url})${summary}`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return `${lines.join("\n")}\n`;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** Build `llms-full.txt`: the full Markdown body of every page. */
|
|
38
|
+
const buildFull = async (project: BlumeProject): Promise<string> => {
|
|
39
|
+
const { config } = project;
|
|
40
|
+
const pages = orderedPages(project);
|
|
41
|
+
|
|
42
|
+
const sections = await Promise.all(
|
|
43
|
+
pages.map(async (page) => {
|
|
44
|
+
const raw = await readEntryText(project, page);
|
|
45
|
+
const body = matter(raw).content.trim();
|
|
46
|
+
const url = pageUrl(page.route, config.deployment.site);
|
|
47
|
+
return [`# ${page.title}`, `Source: ${url}`, "", body].join("\n");
|
|
48
|
+
})
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const header = config.description
|
|
52
|
+
? `# ${config.title}\n\n> ${config.description}\n`
|
|
53
|
+
: `# ${config.title}\n`;
|
|
54
|
+
|
|
55
|
+
return `${header}\n${sections.join("\n\n---\n\n")}\n`;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** Build both LLM text artifacts for a project. */
|
|
59
|
+
export const buildLlmsFiles = async (
|
|
60
|
+
project: BlumeProject
|
|
61
|
+
): Promise<{ index: string; full: string }> => ({
|
|
62
|
+
full: await buildFull(project),
|
|
63
|
+
index: buildIndex(project),
|
|
64
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
|
|
3
|
+
import type { BlumeProject } from "../core/project-graph.ts";
|
|
4
|
+
import { readEntryText } from "../core/sources/read.ts";
|
|
5
|
+
import type { RouteManifestEntry } from "../core/types.ts";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Map every route to its raw source Markdown. Powers the `<route>.md` and
|
|
9
|
+
* `<route>.mdx` endpoints, which serve the original source so AI tools — and
|
|
10
|
+
* readers — can fetch any page as plain Markdown.
|
|
11
|
+
*/
|
|
12
|
+
export const buildRawMarkdown = async (
|
|
13
|
+
project: BlumeProject
|
|
14
|
+
): Promise<Record<string, string>> => {
|
|
15
|
+
const pageById = new Map(project.graph.pages.map((page) => [page.id, page]));
|
|
16
|
+
|
|
17
|
+
const readRoute = async (route: RouteManifestEntry): Promise<string> => {
|
|
18
|
+
const page = pageById.get(route.id);
|
|
19
|
+
if (page) {
|
|
20
|
+
return await readEntryText(project, page);
|
|
21
|
+
}
|
|
22
|
+
return route.sourcePath ? await readFile(route.sourcePath, "utf-8") : "";
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const entries = await Promise.all(
|
|
26
|
+
project.manifest.routes.map(
|
|
27
|
+
async (route) => [route.path, await readRoute(route)] as const
|
|
28
|
+
)
|
|
29
|
+
);
|
|
30
|
+
return Object.fromEntries(entries);
|
|
31
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { BlumeProject } from "../../core/project-graph.ts";
|
|
2
|
+
import type { Navigation } from "../../core/types.ts";
|
|
3
|
+
import { buildSearchDocuments } from "../../search/documents.ts";
|
|
4
|
+
import type { OramaDoc } from "../../search/orama-index.ts";
|
|
5
|
+
import { buildRawMarkdown } from "../markdown.ts";
|
|
6
|
+
|
|
7
|
+
/** A page entry surfaced by the `list_pages` MCP tool. */
|
|
8
|
+
export interface McpRoute {
|
|
9
|
+
contentType: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
indexable: boolean;
|
|
12
|
+
lastModified: string | null;
|
|
13
|
+
route: string;
|
|
14
|
+
title: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The self-contained snapshot the generated MCP endpoint serves. Bundles the
|
|
19
|
+
* search documents, raw page Markdown, route list, and navigation so the server
|
|
20
|
+
* works regardless of the configured search provider and needs no filesystem
|
|
21
|
+
* access at request time. Serialized to `generated/mcp-data.json`.
|
|
22
|
+
*/
|
|
23
|
+
export interface McpData {
|
|
24
|
+
documents: OramaDoc[];
|
|
25
|
+
instructions?: string;
|
|
26
|
+
name: string;
|
|
27
|
+
navigation: Navigation;
|
|
28
|
+
pages: Record<string, string>;
|
|
29
|
+
routes: McpRoute[];
|
|
30
|
+
site: string | null;
|
|
31
|
+
version: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Build the MCP data snapshot from a resolved project. */
|
|
35
|
+
export const buildMcpData = async (project: BlumeProject): Promise<McpData> => {
|
|
36
|
+
const { config, graph, manifest } = project;
|
|
37
|
+
const [documents, pages] = await Promise.all([
|
|
38
|
+
// The MCP server is independent of on-page search, so index docs even when
|
|
39
|
+
// the search provider is `none`.
|
|
40
|
+
buildSearchDocuments(project, { includeWhenDisabled: true }),
|
|
41
|
+
buildRawMarkdown(project),
|
|
42
|
+
]);
|
|
43
|
+
|
|
44
|
+
const descriptionById = new Map(
|
|
45
|
+
graph.pages.map((page) => [page.id, page.description])
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const routes: McpRoute[] = manifest.routes
|
|
49
|
+
.filter((route) => !route.hidden)
|
|
50
|
+
.map((route) => ({
|
|
51
|
+
contentType: route.contentType,
|
|
52
|
+
description: descriptionById.get(route.id),
|
|
53
|
+
indexable: route.indexable,
|
|
54
|
+
lastModified: route.lastModified ?? null,
|
|
55
|
+
route: route.path,
|
|
56
|
+
title: route.title,
|
|
57
|
+
}));
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
documents: documents.map((doc) => ({
|
|
61
|
+
content: doc.content,
|
|
62
|
+
description: doc.description,
|
|
63
|
+
route: doc.route,
|
|
64
|
+
title: doc.title,
|
|
65
|
+
})),
|
|
66
|
+
instructions: config.mcp.instructions,
|
|
67
|
+
name: config.mcp.name ?? config.title,
|
|
68
|
+
navigation: graph.navigation,
|
|
69
|
+
pages,
|
|
70
|
+
routes,
|
|
71
|
+
site: config.deployment.site ?? null,
|
|
72
|
+
version: manifest.blumeVersion,
|
|
73
|
+
};
|
|
74
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { MCP_TOOLS } from "./tools.ts";
|
|
2
|
+
|
|
3
|
+
/** Inputs needed to describe the MCP server in discovery documents. */
|
|
4
|
+
export interface McpDiscoveryInput {
|
|
5
|
+
name: string;
|
|
6
|
+
route: string;
|
|
7
|
+
site: string | null;
|
|
8
|
+
version: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** The MCP server's address — absolute when a site is configured. */
|
|
12
|
+
const serverUrl = (input: McpDiscoveryInput): string =>
|
|
13
|
+
input.site ? new URL(input.route, input.site).href : input.route;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The `/.well-known/mcp.json` discovery document: the minimal pointer agents use
|
|
17
|
+
* to find the server and its transport.
|
|
18
|
+
*/
|
|
19
|
+
export const buildMcpDiscovery = (
|
|
20
|
+
input: McpDiscoveryInput
|
|
21
|
+
): Record<string, unknown> => ({
|
|
22
|
+
servers: [
|
|
23
|
+
{
|
|
24
|
+
name: input.name,
|
|
25
|
+
transport: "streamable-http",
|
|
26
|
+
url: serverUrl(input),
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The `/.well-known/mcp/server-card.json` document: richer metadata including
|
|
33
|
+
* the advertised tool set (full input schemas are served live via `tools/list`).
|
|
34
|
+
*/
|
|
35
|
+
export const buildMcpServerCard = (
|
|
36
|
+
input: McpDiscoveryInput
|
|
37
|
+
): Record<string, unknown> => ({
|
|
38
|
+
description: `Model Context Protocol server for the ${input.name} documentation.`,
|
|
39
|
+
name: input.name,
|
|
40
|
+
tools: MCP_TOOLS.map((tool) => ({
|
|
41
|
+
annotations: tool.annotations,
|
|
42
|
+
description: tool.description,
|
|
43
|
+
name: tool.name,
|
|
44
|
+
title: tool.title,
|
|
45
|
+
})),
|
|
46
|
+
transport: "streamable-http",
|
|
47
|
+
url: serverUrl(input),
|
|
48
|
+
version: input.version,
|
|
49
|
+
});
|