import { readFile, writeFile } from "node:fs/promises" import path from "node:path" const SECTIONS = [ { file: "guide/overview.md" }, { file: "guide/installation.md" }, { file: "guide/orchestration.md" }, { file: "guide/agent-model-matching.md" }, { file: "guide/team-mode.md" }, { file: "reference/cli.md" }, { file: "reference/configuration.md" }, { file: "reference/features.md" }, { file: "manifesto.md" }, ] const DOCS_ROOT = path.resolve(process.cwd(), "..", "docs") const OUTPUT = path.resolve(process.cwd(), "lib", "docs-content.generated.ts") const sources = {} for (const s of SECTIONS) { sources[s.file] = await readFile(path.join(DOCS_ROOT, s.file), "utf8") } const out = "// Generated by scripts/generate-docs-content.mjs - DO NOT EDIT\n" + "export const DOC_SOURCES: Record = " + JSON.stringify(sources, null, 2) + "\n" await writeFile(OUTPUT, out) console.log("Generated " + OUTPUT + " with " + SECTIONS.length + " docs sources")