Goal: Decompose the "God Class" DatabaseService.mjs by extracting parsing logic into dedicated, domain-intent focused classes.
Architecture:
- Create a new namespace
Neo.ai.mcp.server.knowledge_base.parser.
- Ensure all new parsers are Neo.core.Base singletons.
New Classes:
parser/TestParser.mjs:
- Intent: Extract knowledge from automated tests.
- Scope: Move the
parseTestFile logic and acorn dependency here.
parser/DocumentationParser.mjs:
- Intent: Extract knowledge from written guides and learning content.
- Scope: Move the Markdown section-splitting logic here.
parser/ApiParser.mjs:
- Intent: Extract knowledge from the codebase structure (API).
- Scope: Move the
docs/output/all.json processing logic here.
Impact:
DatabaseService.mjs should become an orchestrator that delegates to these services, significantly reducing its LOC and complexity to a manageable level.
Goal: Decompose the "God Class"
DatabaseService.mjsby extracting parsing logic into dedicated, domain-intent focused classes.Architecture:
Neo.ai.mcp.server.knowledge_base.parser.New Classes:
parser/TestParser.mjs:parseTestFilelogic andacorndependency here.parser/DocumentationParser.mjs:parser/ApiParser.mjs:docs/output/all.jsonprocessing logic here.Impact:
DatabaseService.mjsshould become an orchestrator that delegates to these services, significantly reducing its LOC and complexity to a manageable level.