-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastro.config.mjs
More file actions
159 lines (156 loc) · 6.77 KB
/
Copy pathastro.config.mjs
File metadata and controls
159 lines (156 loc) · 6.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import starlightLinksValidator from "starlight-links-validator";
import starlightLlmsTxt from "starlight-llms-txt";
import starlightPageActions from "starlight-page-actions";
import rehypeMermaid from "rehype-mermaid";
// https://astro.build/config
export default defineConfig({
site: "https://theagenticguy.github.io",
base: "/opencodehub",
// Mermaid: render ```mermaid ``` fences to inline SVG at build time.
// excludeLangs is critical — without it, Shiki grabs the mermaid fence
// first and rehype-mermaid never sees it.
markdown: {
syntaxHighlight: { type: "shiki", excludeLangs: ["mermaid"] },
rehypePlugins: [[rehypeMermaid, { strategy: "img-svg", dark: true }]],
},
integrations: [
starlight({
title: "OpenCodeHub",
description:
"Apache-2.0 code intelligence graph + MCP server for AI coding agents. 29 tools, 15 GA languages, single-file SQLite storage, WASM-only parsing, deterministic, offline-capable.",
logo: {
src: "./src/assets/logo.svg",
replacesTitle: false,
},
favicon: "/favicon.svg",
social: [
{
icon: "github",
label: "GitHub",
href: "https://github.com/theagenticguy/opencodehub",
},
],
editLink: {
baseUrl:
"https://github.com/theagenticguy/opencodehub/edit/main/packages/docs/",
},
lastUpdated: true,
credits: true,
plugins: [
// 1) LLM-crawlable bundles. Emits /llms.txt, /llms-full.txt,
// /llms-small.txt at build time. Must run first so page-actions
// sees it already registered.
starlightLlmsTxt({
projectName: "OpenCodeHub",
description:
"Apache-2.0 code intelligence graph + MCP server for AI coding agents. Gives agents callers, callees, processes, and blast radius in one MCP tool call — local, offline-capable, deterministic.",
details:
"OpenCodeHub indexes a repository into a hybrid structural + semantic knowledge graph and exposes it over the Model Context Protocol (MCP) to AI coding agents. The MCP server registers 29 tools across five families — exploration (list_repos, query, context, impact, detect_changes, sql, signature), group / federation (group_list, group_query, group_status, group_contracts, group_cross_repo_links, group_sync), scan / findings / verdict (scan, list_findings, list_findings_delta, list_dead_code, license_audit, verdict, change_pack, risk_trends), HTTP / routing (route_map, api_impact, shape_check, tool_map), and meta (project_profile, dependencies, owners, pack_codebase). The CLI binary is `codehub`. Runtime: Node 24.15+, pnpm 11, a single-file SQLite store (`<repo>/.codehub/store.sqlite`, via Node's built-in node:sqlite) that backs graph nodes, edges, embeddings, and the temporal tables — zero native storage bindings (ADR 0019), web-tree-sitter (WASM) is the only parse runtime with all 15 grammar `.wasm` blobs vendored at packages/ingestion/vendor/wasms/, 15 GA languages, SCIP indexers for TypeScript / TSX / JavaScript / Python / Go / Rust / Java / C# / C / C++ / Kotlin / Ruby. 19-scanner inventory. Apache-2.0 end to end. Repos are first-class graph nodes (`repo_uri`); the cross-repo `group_*` family fans out over named groups; AMBIGUOUS_REPO error envelope returns `choices[]` so a caller can retry deterministically.",
promote: [
"start-here/**",
"agents/**",
"guides/**",
"mcp/**",
],
demote: [
"architecture/**",
"contributing/**",
],
// Keep llms-small.txt tight by dropping internals-y prose.
exclude: [],
minify: {
note: true,
tip: true,
details: true,
whitespace: true,
caution: false,
danger: false,
},
customSets: [
{
label: "user-guide",
paths: ["start-here/**", "guides/**"],
description:
"User-facing pages only: install, quick-start, editor integration guides, group and indexing guides.",
},
{
label: "agents",
paths: ["agents/**", "mcp/**"],
description:
"Agent-side reference: per-editor MCP setup, the 29-tool catalog, tool decision matrix, idiomatic prompts.",
},
{
label: "mcp",
paths: ["mcp/**", "reference/**"],
description:
"MCP surface: server tools, resources, CLI reference, error codes, language matrix, .docmeta.json schema.",
},
{
label: "contributing",
paths: ["contributing/**", "architecture/**"],
description:
"Developer and architecture docs: dev loop, release flow, ADRs, determinism, supply-chain, storage backend, cross-repo federation.",
},
],
}),
// 2) Per-page "Copy as Markdown" + "Open in ChatGPT" + "Open in
// Claude" + Share. IMPORTANT: do NOT set `baseUrl`, or this
// plugin will try to own /llms.txt too and collide with
// starlight-llms-txt. Leave llms generation to plugin #1.
starlightPageActions({
actions: {
markdown: true,
chatgpt: true,
claude: true,
t3chat: false,
v0: false,
},
share: true,
}),
// 3) Build-time broken-link check. Runs after content is built
// but before deploy, so llms-full.txt never ships dead links.
starlightLinksValidator({
errorOnFallbackPages: false,
errorOnInconsistentLocale: false,
}),
],
sidebar: [
{
label: "Start here",
items: [{ autogenerate: { directory: "start-here" } }],
},
{
label: "Agents",
items: [{ autogenerate: { directory: "agents" } }],
},
{
label: "MCP",
items: [{ autogenerate: { directory: "mcp" } }],
},
{
label: "Reference",
items: [{ autogenerate: { directory: "reference" } }],
},
{
label: "Guides",
items: [{ autogenerate: { directory: "guides" } }],
},
{
label: "Architecture",
items: [{ autogenerate: { directory: "architecture" } }],
},
{
label: "Skills",
items: [{ autogenerate: { directory: "skills" } }],
},
{
label: "Contributing",
items: [{ autogenerate: { directory: "contributing" } }],
},
],
customCss: ["./src/styles/custom.css"],
}),
],
});