Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
@carbon/content
Carbon's written content: the docs site's MDX, the manufacturing glossary, and the helpers
that turn both into something apps and agents can read. Nested in the docs app so the MDX stays
colocated with the site; the docs/ Next app renders it, ERP/MES/packages import it.
Layout
docs/**,guides/**— the docs pages (Fumadocs reads them viadocs/source.config.ts).src/glossary/— term definitions for ERP/MES field help and docs<Term>popovers.src/corpus.ts— MDX → plain markdown (pure; callers bring the raw text).src/agent-kb.ts— every page, stripped and split into sections, for the in-app agent (Viteimport.meta.glob).src/links.ts—DOCS_URLanddocUrl().src/search.ts—stemInflection(), the one stemmer for docs site search, MCPsearch_toolsand the agent'ssearch_docs(zbsearch's Porter, limited to plural/-ed/-ing/-e).
Exports
import { terms, getEntry, lookupEntry, type TermId } from "@carbon/content/glossary";
import { docUrl, DOCS_URL } from "@carbon/content/links";
import { stemInflection } from "@carbon/content/search";
import { parsePage, splitSections, headingAnchor } from "@carbon/content/corpus"; // pure, any bundle
import { agentDocs } from "@carbon/content/agent-kb"; // Vite builds only (ERP)
Always
- Glossary terms are Lingui
msgdescriptors (@lingui/core/macro) for bothtermanddefinition, so extraction picks them up. One crisp sentence per definition; the full story lives behindhref. - Use
TermIdfor compile-time safety — aliases resolve at runtime vialookupEntry, never in theTermIdunion. - Stay isomorphic — no fs/Node imports outside tests;
agent-kbis reachable from ERP client bundles. - Keep
links.test.tsgreen — it checks every glossaryhref, every hardcodeddocs.carbon.ms/docs|guidesURL underapps/*/appandpackages/*/src, and every internal MDX link against real pages and heading anchors (github-slugger rules: "A — B" →a--b).
Ask First
- Adding a glossary term (it must map to a real ERP concept) or changing a term's
href.
Never
- Use
getTermText()/getDefinitionText()in ERP/MES UI — usei18n._(entry.term). - Import
./agent-kbfrom a non-Vite runtime (the docs app, Node scripts) — feed raw MDX into./corpusinstead. - Add
fsor any Node-only import to runtime code — the package is isomorphic. - Import
./agent-kbfrom@carbon/reactor other shared UI — it bundles every page.
Validation Commands
pnpm --filter @carbon/content typecheck
pnpm --filter @carbon/content test
pnpm --filter @carbon/content lint