corpus_status
Check the presence and metadata of generated documentation artifacts to verify migration analysis readiness for HeroUI v3 beta migration projects.
Instructions
Checks the presence and metadata of generated documentation artifacts.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:340-396 (handler)The implementation of the corpus_status tool, which checks for the presence of generated corpus files and computes metrics for them.
async () => { const files = await listGeneratedFiles(); const expected = [ "heroui-v2-llms-components.txt", "heroui-v2-llms-full.txt", "heroui-v2-index.json", "heroui-v3-llms-components.txt", "heroui-v3-llms-full.txt", "heroui-v3-index.json", ]; const missing = expected.filter((n) => !files.includes(n)); const indexes: Record<string, any> = {}; for (const v of ["v2", "v3"]) { const path = `heroui-${v}-index.json`; if (files.includes(path)) { try { indexes[v] = JSON.parse(await readGeneratedFile(path)); } catch { indexes[v] = null; } } } // compute basic metrics for text outputs if the index lacks them const metrics: Record<string, any> = {}; for (const v of ["v2", "v3"]) { const versionMetrics: any = {}; for (const fname of [`heroui-${v}-llms-components.txt`, `heroui-${v}-llms-full.txt`]) { if (files.includes(fname)) { try { const txt = await readGeneratedFile(fname); const pages = (txt.match(/<page\s+url=/g) || []).length; const bytes = Buffer.byteLength(txt, "utf8"); versionMetrics[fname] = { pages, bytes }; } catch { } } } metrics[v] = versionMetrics; } return { content: [ { type: "text", text: `Corpus files: ${files.join(", ")}\n` + (missing.length ? `Missing: ${missing.join(", ")}\n` : "All expected files present.\n") } ], structuredContent: { ready: missing.length === 0, missingFiles: missing, generatedFiles: files, indexes, metrics, } }; - src/server.ts:333-339 (registration)Registration of the corpus_status tool.
server.registerTool( "corpus_status", { title: "Corpus status", description: "Checks the presence and metadata of generated documentation artifacts.", inputSchema: {} },