mcp-adr-analysis-server 2.1.9 → 2.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -8
- package/dist/.tsbuildinfo +1 -1
- package/dist/src/index.d.ts +78 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1793 -577
- package/dist/src/index.js.map +1 -1
- package/dist/src/prompts/index.d.ts.map +1 -1
- package/dist/src/prompts/index.js +23 -6
- package/dist/src/prompts/index.js.map +1 -1
- package/dist/src/prompts/validated-pattern-prompts.d.ts +33 -0
- package/dist/src/prompts/validated-pattern-prompts.d.ts.map +1 -0
- package/dist/src/prompts/validated-pattern-prompts.js +337 -0
- package/dist/src/prompts/validated-pattern-prompts.js.map +1 -0
- package/dist/src/resources/adr-by-id-resource.d.ts +116 -0
- package/dist/src/resources/adr-by-id-resource.d.ts.map +1 -0
- package/dist/src/resources/adr-by-id-resource.js +213 -0
- package/dist/src/resources/adr-by-id-resource.js.map +1 -0
- package/dist/src/resources/code-quality-resource.d.ts +105 -0
- package/dist/src/resources/code-quality-resource.d.ts.map +1 -0
- package/dist/src/resources/code-quality-resource.js +282 -0
- package/dist/src/resources/code-quality-resource.js.map +1 -0
- package/dist/src/resources/deployment-history-resource.d.ts +214 -0
- package/dist/src/resources/deployment-history-resource.d.ts.map +1 -0
- package/dist/src/resources/deployment-history-resource.js +308 -0
- package/dist/src/resources/deployment-history-resource.js.map +1 -0
- package/dist/src/resources/deployment-status-resource.d.ts +256 -0
- package/dist/src/resources/deployment-status-resource.d.ts.map +1 -0
- package/dist/src/resources/deployment-status-resource.js +665 -0
- package/dist/src/resources/deployment-status-resource.js.map +1 -0
- package/dist/src/resources/environment-analysis-resource.d.ts +237 -0
- package/dist/src/resources/environment-analysis-resource.d.ts.map +1 -0
- package/dist/src/resources/environment-analysis-resource.js +646 -0
- package/dist/src/resources/environment-analysis-resource.js.map +1 -0
- package/dist/src/resources/index.d.ts +6 -2
- package/dist/src/resources/index.d.ts.map +1 -1
- package/dist/src/resources/index.js +247 -492
- package/dist/src/resources/index.js.map +1 -1
- package/dist/src/resources/memory-snapshots-resource.d.ts +180 -0
- package/dist/src/resources/memory-snapshots-resource.d.ts.map +1 -0
- package/dist/src/resources/memory-snapshots-resource.js +847 -0
- package/dist/src/resources/memory-snapshots-resource.js.map +1 -0
- package/dist/src/resources/pattern-base-code-by-platform-resource.d.ts +35 -0
- package/dist/src/resources/pattern-base-code-by-platform-resource.d.ts.map +1 -0
- package/dist/src/resources/pattern-base-code-by-platform-resource.js +72 -0
- package/dist/src/resources/pattern-base-code-by-platform-resource.js.map +1 -0
- package/dist/src/resources/pattern-by-name-resource.d.ts +53 -0
- package/dist/src/resources/pattern-by-name-resource.d.ts.map +1 -0
- package/dist/src/resources/pattern-by-name-resource.js +200 -0
- package/dist/src/resources/pattern-by-name-resource.js.map +1 -0
- package/dist/src/resources/pattern-sources-by-platform-resource.d.ts +26 -0
- package/dist/src/resources/pattern-sources-by-platform-resource.d.ts.map +1 -0
- package/dist/src/resources/pattern-sources-by-platform-resource.js +59 -0
- package/dist/src/resources/pattern-sources-by-platform-resource.js.map +1 -0
- package/dist/src/resources/project-metrics-resource.d.ts +180 -0
- package/dist/src/resources/project-metrics-resource.d.ts.map +1 -0
- package/dist/src/resources/project-metrics-resource.js +487 -0
- package/dist/src/resources/project-metrics-resource.js.map +1 -0
- package/dist/src/resources/project-status-resource.d.ts +75 -0
- package/dist/src/resources/project-status-resource.d.ts.map +1 -0
- package/dist/src/resources/project-status-resource.js +189 -0
- package/dist/src/resources/project-status-resource.js.map +1 -0
- package/dist/src/resources/research-by-topic-resource.d.ts +21 -0
- package/dist/src/resources/research-by-topic-resource.d.ts.map +1 -0
- package/dist/src/resources/research-by-topic-resource.js +125 -0
- package/dist/src/resources/research-by-topic-resource.js.map +1 -0
- package/dist/src/resources/research-index-resource.d.ts +100 -0
- package/dist/src/resources/research-index-resource.d.ts.map +1 -0
- package/dist/src/resources/research-index-resource.js +200 -0
- package/dist/src/resources/research-index-resource.js.map +1 -0
- package/dist/src/resources/resource-cache.d.ts +144 -0
- package/dist/src/resources/resource-cache.d.ts.map +1 -0
- package/dist/src/resources/resource-cache.js +316 -0
- package/dist/src/resources/resource-cache.js.map +1 -0
- package/dist/src/resources/resource-router.d.ts +45 -0
- package/dist/src/resources/resource-router.d.ts.map +1 -0
- package/dist/src/resources/resource-router.js +96 -0
- package/dist/src/resources/resource-router.js.map +1 -0
- package/dist/src/resources/rule-by-id-resource.d.ts +38 -0
- package/dist/src/resources/rule-by-id-resource.d.ts.map +1 -0
- package/dist/src/resources/rule-by-id-resource.js +104 -0
- package/dist/src/resources/rule-by-id-resource.js.map +1 -0
- package/dist/src/resources/rule-catalog-resource.d.ts +126 -0
- package/dist/src/resources/rule-catalog-resource.d.ts.map +1 -0
- package/dist/src/resources/rule-catalog-resource.js +224 -0
- package/dist/src/resources/rule-catalog-resource.js.map +1 -0
- package/dist/src/resources/rule-generation-resource.d.ts +80 -0
- package/dist/src/resources/rule-generation-resource.d.ts.map +1 -0
- package/dist/src/resources/rule-generation-resource.js +282 -0
- package/dist/src/resources/rule-generation-resource.js.map +1 -0
- package/dist/src/resources/technology-by-name-resource.d.ts +43 -0
- package/dist/src/resources/technology-by-name-resource.d.ts.map +1 -0
- package/dist/src/resources/technology-by-name-resource.js +176 -0
- package/dist/src/resources/technology-by-name-resource.js.map +1 -0
- package/dist/src/resources/todo-by-id-resource.d.ts +46 -0
- package/dist/src/resources/todo-by-id-resource.d.ts.map +1 -0
- package/dist/src/resources/todo-by-id-resource.js +192 -0
- package/dist/src/resources/todo-by-id-resource.js.map +1 -0
- package/dist/src/resources/todo-list-resource.d.ts +96 -0
- package/dist/src/resources/todo-list-resource.d.ts.map +1 -0
- package/dist/src/resources/todo-list-resource.js +209 -0
- package/dist/src/resources/todo-list-resource.js.map +1 -0
- package/dist/src/resources/validated-pattern-by-platform-resource.d.ts +14 -0
- package/dist/src/resources/validated-pattern-by-platform-resource.d.ts.map +1 -0
- package/dist/src/resources/validated-pattern-by-platform-resource.js +45 -0
- package/dist/src/resources/validated-pattern-by-platform-resource.js.map +1 -0
- package/dist/src/resources/validated-patterns-catalog-resource.d.ts +36 -0
- package/dist/src/resources/validated-patterns-catalog-resource.d.ts.map +1 -0
- package/dist/src/resources/validated-patterns-catalog-resource.js +57 -0
- package/dist/src/resources/validated-patterns-catalog-resource.js.map +1 -0
- package/dist/src/templates/domain-knowledge-templates.d.ts.map +1 -1
- package/dist/src/templates/domain-knowledge-templates.js +49 -49
- package/dist/src/templates/domain-knowledge-templates.js.map +1 -1
- package/dist/src/tools/adr-bootstrap-validation-tool.d.ts.map +1 -1
- package/dist/src/tools/adr-bootstrap-validation-tool.js +214 -4
- package/dist/src/tools/adr-bootstrap-validation-tool.js.map +1 -1
- package/dist/src/tools/adr-suggestion-tool.d.ts +2 -2
- package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -1
- package/dist/src/tools/adr-suggestion-tool.js +129 -12
- package/dist/src/tools/adr-suggestion-tool.js.map +1 -1
- package/dist/src/tools/adr-validation-tool.d.ts +98 -0
- package/dist/src/tools/adr-validation-tool.d.ts.map +1 -0
- package/dist/src/tools/adr-validation-tool.js +372 -0
- package/dist/src/tools/adr-validation-tool.js.map +1 -0
- package/dist/src/tools/bootstrap-validation-loop-tool.d.ts +262 -0
- package/dist/src/tools/bootstrap-validation-loop-tool.d.ts.map +1 -0
- package/dist/src/tools/bootstrap-validation-loop-tool.js +1934 -0
- package/dist/src/tools/bootstrap-validation-loop-tool.js.map +1 -0
- package/dist/src/tools/conversation-memory-tool.d.ts +48 -0
- package/dist/src/tools/conversation-memory-tool.d.ts.map +1 -0
- package/dist/src/tools/conversation-memory-tool.js +254 -0
- package/dist/src/tools/conversation-memory-tool.js.map +1 -0
- package/dist/src/tools/deployment-analysis-tool.d.ts.map +1 -1
- package/dist/src/tools/deployment-analysis-tool.js +82 -6
- package/dist/src/tools/deployment-analysis-tool.js.map +1 -1
- package/dist/src/tools/deployment-guidance-tool.d.ts.map +1 -1
- package/dist/src/tools/deployment-guidance-tool.js +126 -25
- package/dist/src/tools/deployment-guidance-tool.js.map +1 -1
- package/dist/src/tools/deployment-readiness-tool.d.ts.map +1 -1
- package/dist/src/tools/deployment-readiness-tool.js +166 -5
- package/dist/src/tools/deployment-readiness-tool.js.map +1 -1
- package/dist/src/tools/environment-analysis-tool.d.ts.map +1 -1
- package/dist/src/tools/environment-analysis-tool.js +36 -1
- package/dist/src/tools/environment-analysis-tool.js.map +1 -1
- package/dist/src/tools/expand-analysis-tool.d.ts +23 -0
- package/dist/src/tools/expand-analysis-tool.d.ts.map +1 -0
- package/dist/src/tools/expand-analysis-tool.js +107 -0
- package/dist/src/tools/expand-analysis-tool.js.map +1 -0
- package/dist/src/tools/get-server-context-tool.d.ts +67 -0
- package/dist/src/tools/get-server-context-tool.d.ts.map +1 -0
- package/dist/src/tools/get-server-context-tool.js +75 -0
- package/dist/src/tools/get-server-context-tool.js.map +1 -0
- package/dist/src/tools/interactive-adr-planning-tool.d.ts.map +1 -1
- package/dist/src/tools/interactive-adr-planning-tool.js +82 -9
- package/dist/src/tools/interactive-adr-planning-tool.js.map +1 -1
- package/dist/src/tools/llm-cloud-management-tool.d.ts +62 -0
- package/dist/src/tools/llm-cloud-management-tool.d.ts.map +1 -0
- package/dist/src/tools/llm-cloud-management-tool.js +202 -0
- package/dist/src/tools/llm-cloud-management-tool.js.map +1 -0
- package/dist/src/tools/llm-database-management-tool.d.ts +62 -0
- package/dist/src/tools/llm-database-management-tool.d.ts.map +1 -0
- package/dist/src/tools/llm-database-management-tool.js +203 -0
- package/dist/src/tools/llm-database-management-tool.js.map +1 -0
- package/dist/src/tools/llm-web-search-tool.d.ts +59 -0
- package/dist/src/tools/llm-web-search-tool.d.ts.map +1 -0
- package/dist/src/tools/llm-web-search-tool.js +165 -0
- package/dist/src/tools/llm-web-search-tool.js.map +1 -0
- package/dist/src/tools/mcp-planning-tool.d.ts.map +1 -1
- package/dist/src/tools/mcp-planning-tool.js +10 -3
- package/dist/src/tools/mcp-planning-tool.js.map +1 -1
- package/dist/src/tools/memory-loading-tool.d.ts.map +1 -1
- package/dist/src/tools/memory-loading-tool.js +4 -2
- package/dist/src/tools/memory-loading-tool.js.map +1 -1
- package/dist/src/tools/perform-research-tool.d.ts +61 -0
- package/dist/src/tools/perform-research-tool.d.ts.map +1 -0
- package/dist/src/tools/perform-research-tool.js +324 -0
- package/dist/src/tools/perform-research-tool.js.map +1 -0
- package/dist/src/tools/research-question-tool.d.ts.map +1 -1
- package/dist/src/tools/research-question-tool.js +11 -9
- package/dist/src/tools/research-question-tool.js.map +1 -1
- package/dist/src/tools/review-existing-adrs-tool.d.ts.map +1 -1
- package/dist/src/tools/review-existing-adrs-tool.js +42 -3
- package/dist/src/tools/review-existing-adrs-tool.js.map +1 -1
- package/dist/src/tools/tool-chain-orchestrator.d.ts +15 -94
- package/dist/src/tools/tool-chain-orchestrator.d.ts.map +1 -1
- package/dist/src/tools/tool-chain-orchestrator.js +2 -2
- package/dist/src/tools/tool-chain-orchestrator.js.map +1 -1
- package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts +25 -120
- package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts.map +1 -1
- package/dist/src/tools/troubleshoot-guided-workflow-tool.js +91 -2
- package/dist/src/tools/troubleshoot-guided-workflow-tool.js.map +1 -1
- package/dist/src/types/ape-framework.d.ts +50 -283
- package/dist/src/types/ape-framework.d.ts.map +1 -1
- package/dist/src/types/conversation-context.d.ts.map +1 -1
- package/dist/src/types/conversation-context.js +12 -12
- package/dist/src/types/conversation-context.js.map +1 -1
- package/dist/src/types/conversation-memory.d.ts +184 -0
- package/dist/src/types/conversation-memory.d.ts.map +1 -0
- package/dist/src/types/conversation-memory.js +8 -0
- package/dist/src/types/conversation-memory.js.map +1 -0
- package/dist/src/types/index.d.ts +112 -339
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/knowledge-generation.d.ts +96 -401
- package/dist/src/types/knowledge-generation.d.ts.map +1 -1
- package/dist/src/types/knowledge-graph-schemas.d.ts +77 -715
- package/dist/src/types/knowledge-graph-schemas.d.ts.map +1 -1
- package/dist/src/types/knowledge-graph-schemas.js +8 -8
- package/dist/src/types/knowledge-graph-schemas.js.map +1 -1
- package/dist/src/types/memory-entities.d.ts +1230 -6164
- package/dist/src/types/memory-entities.d.ts.map +1 -1
- package/dist/src/types/memory-entities.js +8 -8
- package/dist/src/types/memory-entities.js.map +1 -1
- package/dist/src/types/reflexion-framework.d.ts +35 -264
- package/dist/src/types/reflexion-framework.d.ts.map +1 -1
- package/dist/src/types/reflexion-framework.js +1 -1
- package/dist/src/types/reflexion-framework.js.map +1 -1
- package/dist/src/types/state-reinforcement.d.ts +87 -0
- package/dist/src/types/state-reinforcement.d.ts.map +1 -0
- package/dist/src/types/state-reinforcement.js +5 -0
- package/dist/src/types/state-reinforcement.js.map +1 -0
- package/dist/src/types/tiered-response.d.ts +61 -0
- package/dist/src/types/tiered-response.d.ts.map +1 -0
- package/dist/src/types/tiered-response.js +8 -0
- package/dist/src/types/tiered-response.js.map +1 -0
- package/dist/src/types/tool-context.d.ts +50 -0
- package/dist/src/types/tool-context.d.ts.map +1 -0
- package/dist/src/types/tool-context.js +20 -0
- package/dist/src/types/tool-context.js.map +1 -0
- package/dist/src/utils/adr-action-analyzer.d.ts +23 -0
- package/dist/src/utils/adr-action-analyzer.d.ts.map +1 -0
- package/dist/src/utils/adr-action-analyzer.js +323 -0
- package/dist/src/utils/adr-action-analyzer.js.map +1 -0
- package/dist/src/utils/adr-context-detector.d.ts +33 -0
- package/dist/src/utils/adr-context-detector.d.ts.map +1 -0
- package/dist/src/utils/adr-context-detector.js +279 -0
- package/dist/src/utils/adr-context-detector.js.map +1 -0
- package/dist/src/utils/adr-discovery.d.ts +28 -2
- package/dist/src/utils/adr-discovery.d.ts.map +1 -1
- package/dist/src/utils/adr-discovery.js +91 -7
- package/dist/src/utils/adr-discovery.js.map +1 -1
- package/dist/src/utils/adr-knowledge-initializer.d.ts +54 -0
- package/dist/src/utils/adr-knowledge-initializer.d.ts.map +1 -0
- package/dist/src/utils/adr-knowledge-initializer.js +240 -0
- package/dist/src/utils/adr-knowledge-initializer.js.map +1 -0
- package/dist/src/utils/adr-timeline-extractor.d.ts +21 -0
- package/dist/src/utils/adr-timeline-extractor.d.ts.map +1 -0
- package/dist/src/utils/adr-timeline-extractor.js +294 -0
- package/dist/src/utils/adr-timeline-extractor.js.map +1 -0
- package/dist/src/utils/adr-timeline-types.d.ts +234 -0
- package/dist/src/utils/adr-timeline-types.d.ts.map +1 -0
- package/dist/src/utils/adr-timeline-types.js +7 -0
- package/dist/src/utils/adr-timeline-types.js.map +1 -0
- package/dist/src/utils/ai-executor.d.ts +36 -0
- package/dist/src/utils/ai-executor.d.ts.map +1 -1
- package/dist/src/utils/ai-executor.js +39 -3
- package/dist/src/utils/ai-executor.js.map +1 -1
- package/dist/src/utils/apply-cot-enhancement.d.ts.map +1 -1
- package/dist/src/utils/apply-cot-enhancement.js +15 -15
- package/dist/src/utils/apply-cot-enhancement.js.map +1 -1
- package/dist/src/utils/automatic-prompt-engineering.d.ts.map +1 -1
- package/dist/src/utils/automatic-prompt-engineering.js +68 -58
- package/dist/src/utils/automatic-prompt-engineering.js.map +1 -1
- package/dist/src/utils/conditional-request.d.ts +105 -0
- package/dist/src/utils/conditional-request.d.ts.map +1 -0
- package/dist/src/utils/conditional-request.js +186 -0
- package/dist/src/utils/conditional-request.js.map +1 -0
- package/dist/src/utils/config.d.ts +72 -18
- package/dist/src/utils/config.d.ts.map +1 -1
- package/dist/src/utils/config.js +75 -0
- package/dist/src/utils/config.js.map +1 -1
- package/dist/src/utils/context-document-manager.d.ts +112 -0
- package/dist/src/utils/context-document-manager.d.ts.map +1 -0
- package/dist/src/utils/context-document-manager.js +351 -0
- package/dist/src/utils/context-document-manager.js.map +1 -0
- package/dist/src/utils/conversation-memory-manager.d.ts +86 -0
- package/dist/src/utils/conversation-memory-manager.d.ts.map +1 -0
- package/dist/src/utils/conversation-memory-manager.js +443 -0
- package/dist/src/utils/conversation-memory-manager.js.map +1 -0
- package/dist/src/utils/dag-executor.d.ts +106 -0
- package/dist/src/utils/dag-executor.d.ts.map +1 -0
- package/dist/src/utils/dag-executor.js +420 -0
- package/dist/src/utils/dag-executor.js.map +1 -0
- package/dist/src/utils/deployment-analysis.d.ts.map +1 -1
- package/dist/src/utils/deployment-analysis.js +17 -9
- package/dist/src/utils/deployment-analysis.js.map +1 -1
- package/dist/src/utils/deployment-type-registry.d.ts +52 -0
- package/dist/src/utils/deployment-type-registry.d.ts.map +1 -0
- package/dist/src/utils/deployment-type-registry.js +543 -0
- package/dist/src/utils/deployment-type-registry.js.map +1 -0
- package/dist/src/utils/dynamic-deployment-intelligence.d.ts +117 -0
- package/dist/src/utils/dynamic-deployment-intelligence.d.ts.map +1 -0
- package/dist/src/utils/dynamic-deployment-intelligence.js +445 -0
- package/dist/src/utils/dynamic-deployment-intelligence.js.map +1 -0
- package/dist/src/utils/environment-analysis.d.ts.map +1 -1
- package/dist/src/utils/environment-analysis.js +63 -44
- package/dist/src/utils/environment-analysis.js.map +1 -1
- package/dist/src/utils/environment-capability-registry.d.ts +101 -0
- package/dist/src/utils/environment-capability-registry.d.ts.map +1 -0
- package/dist/src/utils/environment-capability-registry.js +489 -0
- package/dist/src/utils/environment-capability-registry.js.map +1 -0
- package/dist/src/utils/index.d.ts +3 -3
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +3 -3
- package/dist/src/utils/index.js.map +1 -1
- package/dist/src/utils/knowledge-generation.d.ts.map +1 -1
- package/dist/src/utils/knowledge-generation.js +61 -35
- package/dist/src/utils/knowledge-generation.js.map +1 -1
- package/dist/src/utils/knowledge-graph-manager.d.ts +19 -0
- package/dist/src/utils/knowledge-graph-manager.d.ts.map +1 -1
- package/dist/src/utils/knowledge-graph-manager.js +165 -1
- package/dist/src/utils/knowledge-graph-manager.js.map +1 -1
- package/dist/src/utils/llm-artifact-detector.d.ts.map +1 -1
- package/dist/src/utils/llm-artifact-detector.js +28 -24
- package/dist/src/utils/llm-artifact-detector.js.map +1 -1
- package/dist/src/utils/mermaid-diagrams.d.ts +101 -0
- package/dist/src/utils/mermaid-diagrams.d.ts.map +1 -0
- package/dist/src/utils/mermaid-diagrams.js +445 -0
- package/dist/src/utils/mermaid-diagrams.js.map +1 -0
- package/dist/src/utils/monitoring.d.ts +249 -0
- package/dist/src/utils/monitoring.d.ts.map +1 -0
- package/dist/src/utils/monitoring.js +513 -0
- package/dist/src/utils/monitoring.js.map +1 -0
- package/dist/src/utils/pattern-contribution-helper.d.ts +60 -0
- package/dist/src/utils/pattern-contribution-helper.d.ts.map +1 -0
- package/dist/src/utils/pattern-contribution-helper.js +308 -0
- package/dist/src/utils/pattern-contribution-helper.js.map +1 -0
- package/dist/src/utils/pattern-loader.d.ts +183 -0
- package/dist/src/utils/pattern-loader.d.ts.map +1 -0
- package/dist/src/utils/pattern-loader.js +200 -0
- package/dist/src/utils/pattern-loader.js.map +1 -0
- package/dist/src/utils/pattern-research-utility.d.ts +107 -0
- package/dist/src/utils/pattern-research-utility.d.ts.map +1 -0
- package/dist/src/utils/pattern-research-utility.js +360 -0
- package/dist/src/utils/pattern-research-utility.js.map +1 -0
- package/dist/src/utils/pattern-to-dag-converter.d.ts +62 -0
- package/dist/src/utils/pattern-to-dag-converter.d.ts.map +1 -0
- package/dist/src/utils/pattern-to-dag-converter.js +265 -0
- package/dist/src/utils/pattern-to-dag-converter.js.map +1 -0
- package/dist/src/utils/platform-detector.d.ts +86 -0
- package/dist/src/utils/platform-detector.d.ts.map +1 -0
- package/dist/src/utils/platform-detector.js +509 -0
- package/dist/src/utils/platform-detector.js.map +1 -0
- package/dist/src/utils/prompt-composition.d.ts.map +1 -1
- package/dist/src/utils/prompt-composition.js +1 -4
- package/dist/src/utils/prompt-composition.js.map +1 -1
- package/dist/src/utils/reflexion.d.ts.map +1 -1
- package/dist/src/utils/reflexion.js +51 -42
- package/dist/src/utils/reflexion.js.map +1 -1
- package/dist/src/utils/research-integration.d.ts.map +1 -1
- package/dist/src/utils/research-integration.js +8 -2
- package/dist/src/utils/research-integration.js.map +1 -1
- package/dist/src/utils/research-orchestrator.d.ts +209 -0
- package/dist/src/utils/research-orchestrator.d.ts.map +1 -0
- package/dist/src/utils/research-orchestrator.js +863 -0
- package/dist/src/utils/research-orchestrator.js.map +1 -0
- package/dist/src/utils/research-questions.d.ts.map +1 -1
- package/dist/src/utils/research-questions.js +4 -1
- package/dist/src/utils/research-questions.js.map +1 -1
- package/dist/src/utils/resource-extractor.d.ts +57 -0
- package/dist/src/utils/resource-extractor.d.ts.map +1 -0
- package/dist/src/utils/resource-extractor.js +323 -0
- package/dist/src/utils/resource-extractor.js.map +1 -0
- package/dist/src/utils/resource-versioning.d.ts +124 -0
- package/dist/src/utils/resource-versioning.d.ts.map +1 -0
- package/dist/src/utils/resource-versioning.js +272 -0
- package/dist/src/utils/resource-versioning.js.map +1 -0
- package/dist/src/utils/root-manager.d.ts +118 -0
- package/dist/src/utils/root-manager.d.ts.map +1 -0
- package/dist/src/utils/root-manager.js +154 -0
- package/dist/src/utils/root-manager.js.map +1 -0
- package/dist/src/utils/rule-generation.d.ts.map +1 -1
- package/dist/src/utils/rule-generation.js +4 -1
- package/dist/src/utils/rule-generation.js.map +1 -1
- package/dist/src/utils/server-context-generator.d.ts +47 -0
- package/dist/src/utils/server-context-generator.d.ts.map +1 -0
- package/dist/src/utils/server-context-generator.js +666 -0
- package/dist/src/utils/server-context-generator.js.map +1 -0
- package/dist/src/utils/state-reinforcement-manager.d.ts +60 -0
- package/dist/src/utils/state-reinforcement-manager.d.ts.map +1 -0
- package/dist/src/utils/state-reinforcement-manager.js +200 -0
- package/dist/src/utils/state-reinforcement-manager.js.map +1 -0
- package/dist/src/utils/system-card-manager.d.ts +194 -0
- package/dist/src/utils/system-card-manager.d.ts.map +1 -0
- package/dist/src/utils/system-card-manager.js +336 -0
- package/dist/src/utils/system-card-manager.js.map +1 -0
- package/dist/src/utils/tiered-response-manager.d.ts +40 -0
- package/dist/src/utils/tiered-response-manager.d.ts.map +1 -0
- package/dist/src/utils/tiered-response-manager.js +243 -0
- package/dist/src/utils/tiered-response-manager.js.map +1 -0
- package/dist/src/utils/tree-sitter-analyzer.d.ts.map +1 -1
- package/dist/src/utils/tree-sitter-analyzer.js +83 -11
- package/dist/src/utils/tree-sitter-analyzer.js.map +1 -1
- package/dist/src/utils/validated-pattern-definitions.d.ts +219 -0
- package/dist/src/utils/validated-pattern-definitions.d.ts.map +1 -0
- package/dist/src/utils/validated-pattern-definitions.js +1511 -0
- package/dist/src/utils/validated-pattern-definitions.js.map +1 -0
- package/package.json +21 -12
- package/dist/src/prompts/todo-prompts.d.ts +0 -49
- package/dist/src/prompts/todo-prompts.d.ts.map +0 -1
- package/dist/src/prompts/todo-prompts.js +0 -824
- package/dist/src/prompts/todo-prompts.js.map +0 -1
- package/dist/src/types/todo-json-schemas.d.ts +0 -17
- package/dist/src/types/todo-json-schemas.d.ts.map +0 -1
- package/dist/src/types/todo-json-schemas.js +0 -9
- package/dist/src/types/todo-json-schemas.js.map +0 -1
- package/dist/src/utils/todo-file-watcher.d.ts +0 -14
- package/dist/src/utils/todo-file-watcher.d.ts.map +0 -1
- package/dist/src/utils/todo-file-watcher.js +0 -25
- package/dist/src/utils/todo-file-watcher.js.map +0 -1
|
@@ -1,229 +1,103 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* MCP Resource implementations
|
|
3
|
-
*
|
|
2
|
+
* MCP Resource implementations - Data-driven approach
|
|
3
|
+
* Provides direct access to architectural analysis data
|
|
4
4
|
*/
|
|
5
|
+
import * as path from 'path';
|
|
5
6
|
import { McpAdrError } from '../types/index.js';
|
|
6
7
|
import { KnowledgeGraphManager } from '../utils/knowledge-graph-manager.js';
|
|
8
|
+
import { resourceCache, generateETag } from './resource-cache.js';
|
|
7
9
|
/**
|
|
8
10
|
* Generate architectural knowledge graph resource
|
|
11
|
+
* Returns actual knowledge graph data instead of prompts
|
|
9
12
|
*/
|
|
10
13
|
export async function generateArchitecturalKnowledgeGraph(projectPath) {
|
|
11
14
|
try {
|
|
12
|
-
const
|
|
13
|
-
//
|
|
15
|
+
const cacheKey = `knowledge-graph:${Buffer.from(projectPath).toString('base64')}`;
|
|
16
|
+
// Check cache
|
|
17
|
+
const cached = await resourceCache.get(cacheKey);
|
|
18
|
+
if (cached) {
|
|
19
|
+
return cached;
|
|
20
|
+
}
|
|
21
|
+
// Load actual knowledge graph data
|
|
14
22
|
const kgManager = new KnowledgeGraphManager();
|
|
15
23
|
const knowledgeGraphSnapshot = await kgManager.loadKnowledgeGraph();
|
|
16
|
-
//
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
"projectId": "unique-project-identifier",
|
|
39
|
-
"timestamp": "ISO-8601-timestamp",
|
|
40
|
-
"metadata": {
|
|
41
|
-
"name": "project-name",
|
|
42
|
-
"description": "project-description",
|
|
43
|
-
"version": "detected-version",
|
|
44
|
-
"lastAnalyzed": "ISO-8601-timestamp",
|
|
45
|
-
"analysisVersion": "1.0.0",
|
|
46
|
-
"fileCount": "total-files-discovered",
|
|
47
|
-
"directoryCount": "total-directories-discovered"
|
|
48
|
-
},
|
|
49
|
-
"technologies": [
|
|
50
|
-
{
|
|
51
|
-
"name": "Technology Name",
|
|
52
|
-
"category": "framework|library|database|cloud|devops|language|tool",
|
|
53
|
-
"version": "version-if-detectable",
|
|
54
|
-
"confidence": 0.0-1.0,
|
|
55
|
-
"evidence": ["specific-evidence"],
|
|
56
|
-
"filePaths": ["relevant-file-paths"],
|
|
57
|
-
"description": "brief-description"
|
|
58
|
-
}
|
|
59
|
-
],
|
|
60
|
-
"patterns": [
|
|
61
|
-
{
|
|
62
|
-
"name": "Pattern Name",
|
|
63
|
-
"type": "architectural|structural|organizational|communication|testing|data",
|
|
64
|
-
"confidence": 0.0-1.0,
|
|
65
|
-
"description": "pattern-description",
|
|
66
|
-
"evidence": ["specific-evidence"],
|
|
67
|
-
"filePaths": ["relevant-file-paths"],
|
|
68
|
-
"suboptimal": false,
|
|
69
|
-
"recommendations": ["improvement-suggestions"]
|
|
70
|
-
}
|
|
71
|
-
],
|
|
72
|
-
"adrs": [
|
|
73
|
-
{
|
|
74
|
-
"id": "adr-id",
|
|
75
|
-
"title": "ADR Title",
|
|
76
|
-
"status": "proposed|accepted|deprecated|superseded",
|
|
77
|
-
"date": "YYYY-MM-DD",
|
|
78
|
-
"context": "decision-context",
|
|
79
|
-
"decision": "architectural-decision",
|
|
80
|
-
"consequences": "decision-consequences",
|
|
81
|
-
"filePath": "path-to-adr-file",
|
|
82
|
-
"tags": ["relevant-tags"],
|
|
83
|
-
"relatedAdrs": ["related-adr-ids"]
|
|
84
|
-
}
|
|
85
|
-
],
|
|
86
|
-
"rules": [
|
|
87
|
-
{
|
|
88
|
-
"id": "rule-id",
|
|
89
|
-
"name": "Rule Name",
|
|
90
|
-
"description": "rule-description",
|
|
91
|
-
"type": "architectural|coding|security|performance|documentation",
|
|
92
|
-
"severity": "info|warning|error|critical",
|
|
93
|
-
"pattern": "detection-pattern",
|
|
94
|
-
"message": "violation-message",
|
|
95
|
-
"source": "adr|inferred|user_defined",
|
|
96
|
-
"enabled": true
|
|
97
|
-
}
|
|
98
|
-
],
|
|
99
|
-
"relationships": [
|
|
100
|
-
{
|
|
101
|
-
"source": "source-entity-id",
|
|
102
|
-
"target": "target-entity-id",
|
|
103
|
-
"type": "implements|depends_on|conflicts_with|supersedes|relates_to",
|
|
104
|
-
"strength": 0.0-1.0,
|
|
105
|
-
"description": "relationship-description"
|
|
106
|
-
}
|
|
107
|
-
],
|
|
108
|
-
"intentSnapshots": [
|
|
109
|
-
{
|
|
110
|
-
"intentId": "intent-id",
|
|
111
|
-
"humanRequest": "original-user-request",
|
|
112
|
-
"parsedGoals": ["goal1", "goal2"],
|
|
113
|
-
"priority": "high|medium|low",
|
|
114
|
-
"timestamp": "ISO-8601-timestamp",
|
|
115
|
-
"currentStatus": "planning|executing|completed|failed",
|
|
116
|
-
"toolChain": [
|
|
117
|
-
{
|
|
118
|
-
"toolName": "tool-name",
|
|
119
|
-
"parameters": {},
|
|
120
|
-
"result": {},
|
|
121
|
-
"todoTasksCreated": ["task-id"],
|
|
122
|
-
"todoTasksModified": ["task-id"],
|
|
123
|
-
"executionTime": "ISO-8601-timestamp",
|
|
124
|
-
"success": true
|
|
125
|
-
}
|
|
126
|
-
],
|
|
127
|
-
"todoMdSnapshot": "snapshot-content",
|
|
128
|
-
"goalProgression": 0.0-1.0
|
|
129
|
-
}
|
|
130
|
-
],
|
|
131
|
-
"analytics": {
|
|
132
|
-
"totalIntents": 0,
|
|
133
|
-
"completedIntents": 0,
|
|
134
|
-
"activeIntents": 0,
|
|
135
|
-
"averageGoalCompletion": 0.0-1.0,
|
|
136
|
-
"mostUsedTools": [
|
|
137
|
-
{
|
|
138
|
-
"toolName": "tool-name",
|
|
139
|
-
"usageCount": 0
|
|
140
|
-
}
|
|
141
|
-
],
|
|
142
|
-
"successfulPatterns": [
|
|
143
|
-
{
|
|
144
|
-
"pattern": "pattern-description",
|
|
145
|
-
"successRate": 0.0-1.0,
|
|
146
|
-
"examples": ["example-intent-ids"]
|
|
147
|
-
}
|
|
148
|
-
]
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
\`\`\`
|
|
152
|
-
|
|
153
|
-
## Analysis Guidelines
|
|
154
|
-
|
|
155
|
-
1. **Comprehensive Detection**: Identify all technologies, patterns, and architectural decisions
|
|
156
|
-
2. **Evidence-Based**: Provide specific evidence for all detections
|
|
157
|
-
3. **Relationship Mapping**: Identify relationships between components
|
|
158
|
-
4. **Quality Assessment**: Evaluate implementation quality and provide recommendations
|
|
159
|
-
5. **Future-Focused**: Consider scalability and maintainability implications
|
|
160
|
-
|
|
161
|
-
Please generate a complete, accurate architectural knowledge graph.
|
|
162
|
-
`;
|
|
163
|
-
const cacheKey = `knowledge-graph:${Buffer.from(projectPath).toString('base64')}`;
|
|
164
|
-
return {
|
|
165
|
-
data: {
|
|
166
|
-
prompt: knowledgeGraphPrompt,
|
|
167
|
-
instructions: `
|
|
168
|
-
# Architectural Knowledge Graph Resource
|
|
169
|
-
|
|
170
|
-
This resource provides a comprehensive view of the project's architectural landscape.
|
|
171
|
-
|
|
172
|
-
## Usage Instructions
|
|
173
|
-
|
|
174
|
-
1. **Submit the generated prompt** to an AI agent for analysis
|
|
175
|
-
2. **Parse the JSON response** as an ArchitecturalKnowledgeGraph
|
|
176
|
-
3. **Cache the result** for performance optimization
|
|
177
|
-
4. **Use the data** for architectural decision making and analysis
|
|
178
|
-
|
|
179
|
-
## Resource Content
|
|
180
|
-
|
|
181
|
-
The knowledge graph includes:
|
|
182
|
-
- **Technologies**: All detected frameworks, libraries, tools, and platforms
|
|
183
|
-
- **Patterns**: Architectural and design patterns in use
|
|
184
|
-
- **ADRs**: Existing architectural decision records
|
|
185
|
-
- **Rules**: Extracted and inferred architectural rules
|
|
186
|
-
- **Relationships**: Connections between architectural components
|
|
187
|
-
|
|
188
|
-
## Next Steps
|
|
189
|
-
|
|
190
|
-
Submit the prompt to generate the actual knowledge graph data.
|
|
191
|
-
`,
|
|
24
|
+
// Import utilities for technology and pattern detection
|
|
25
|
+
const { analyzeProjectStructure } = await import('../utils/file-system.js');
|
|
26
|
+
const projectAnalysis = await analyzeProjectStructure(projectPath);
|
|
27
|
+
// Discover ADRs
|
|
28
|
+
const { discoverAdrsInDirectory } = await import('../utils/adr-discovery.js');
|
|
29
|
+
const pathModule = await import('path');
|
|
30
|
+
const adrDirectory = pathModule.resolve(projectPath, process.env['ADR_DIRECTORY'] || 'docs/adrs');
|
|
31
|
+
const adrDiscovery = await discoverAdrsInDirectory(adrDirectory, projectPath, {
|
|
32
|
+
includeContent: true,
|
|
33
|
+
includeTimeline: false,
|
|
34
|
+
});
|
|
35
|
+
// Build comprehensive knowledge graph with actual data
|
|
36
|
+
const knowledgeGraphData = {
|
|
37
|
+
projectId: Buffer.from(projectPath).toString('base64'),
|
|
38
|
+
timestamp: new Date().toISOString(),
|
|
39
|
+
version: '1.0.0',
|
|
40
|
+
metadata: {
|
|
41
|
+
name: path.basename(projectPath),
|
|
42
|
+
description: 'MCP ADR Analysis Server Project',
|
|
43
|
+
lastAnalyzed: new Date().toISOString(),
|
|
44
|
+
analysisVersion: '1.0.0',
|
|
192
45
|
projectPath,
|
|
193
|
-
promptInstructions: projectAnalysisPrompt.instructions,
|
|
194
|
-
context: projectAnalysisPrompt.context,
|
|
195
|
-
// Include actual knowledge graph snapshot data
|
|
196
|
-
knowledgeGraphSnapshot: {
|
|
197
|
-
version: knowledgeGraphSnapshot.version,
|
|
198
|
-
timestamp: knowledgeGraphSnapshot.timestamp,
|
|
199
|
-
intents: knowledgeGraphSnapshot.intents.map(intent => ({
|
|
200
|
-
intentId: intent.intentId,
|
|
201
|
-
humanRequest: intent.humanRequest,
|
|
202
|
-
parsedGoals: intent.parsedGoals,
|
|
203
|
-
priority: intent.priority,
|
|
204
|
-
timestamp: intent.timestamp,
|
|
205
|
-
currentStatus: intent.currentStatus,
|
|
206
|
-
toolChainSummary: {
|
|
207
|
-
totalTools: intent.toolChain.length,
|
|
208
|
-
completedTools: intent.toolChain.filter(t => t.success).length,
|
|
209
|
-
failedTools: intent.toolChain.filter(t => !t.success).length,
|
|
210
|
-
lastExecution: intent.toolChain.length > 0
|
|
211
|
-
? intent.toolChain[intent.toolChain.length - 1]?.executionTime || null
|
|
212
|
-
: null,
|
|
213
|
-
},
|
|
214
|
-
todoTasksCreated: intent.toolChain.flatMap(t => t.todoTasksCreated),
|
|
215
|
-
todoTasksModified: intent.toolChain.flatMap(t => t.todoTasksModified),
|
|
216
|
-
hasSnapshots: !!intent.todoMdSnapshot,
|
|
217
|
-
})),
|
|
218
|
-
todoSyncState: knowledgeGraphSnapshot.todoSyncState,
|
|
219
|
-
analytics: knowledgeGraphSnapshot.analytics,
|
|
220
|
-
},
|
|
221
46
|
},
|
|
47
|
+
technologies: projectAnalysis.technologies || [],
|
|
48
|
+
patterns: projectAnalysis.patterns || [],
|
|
49
|
+
adrs: adrDiscovery.adrs.map(adr => ({
|
|
50
|
+
id: adr.filename.replace(/\.md$/, ''),
|
|
51
|
+
title: adr.title,
|
|
52
|
+
status: adr.status,
|
|
53
|
+
date: new Date().toISOString().split('T')[0],
|
|
54
|
+
context: adr.context,
|
|
55
|
+
decision: adr.decision,
|
|
56
|
+
consequences: adr.consequences,
|
|
57
|
+
filePath: adr.filename,
|
|
58
|
+
tags: [],
|
|
59
|
+
relatedAdrs: [],
|
|
60
|
+
})),
|
|
61
|
+
rules: [], // TODO: Extract rules from ADRs and code
|
|
62
|
+
relationships: [], // TODO: Build relationship graph
|
|
63
|
+
intentSnapshots: knowledgeGraphSnapshot.intents.map(intent => ({
|
|
64
|
+
intentId: intent.intentId,
|
|
65
|
+
humanRequest: intent.humanRequest,
|
|
66
|
+
parsedGoals: intent.parsedGoals,
|
|
67
|
+
priority: intent.priority,
|
|
68
|
+
timestamp: intent.timestamp,
|
|
69
|
+
currentStatus: intent.currentStatus,
|
|
70
|
+
toolChain: intent.toolChain.map(tool => ({
|
|
71
|
+
toolName: tool.toolName,
|
|
72
|
+
parameters: tool.parameters,
|
|
73
|
+
result: tool.result,
|
|
74
|
+
todoTasksCreated: tool.todoTasksCreated,
|
|
75
|
+
todoTasksModified: tool.todoTasksModified,
|
|
76
|
+
executionTime: tool.executionTime,
|
|
77
|
+
success: tool.success,
|
|
78
|
+
})),
|
|
79
|
+
todoMdSnapshot: intent.todoMdSnapshot,
|
|
80
|
+
})),
|
|
81
|
+
analytics: {
|
|
82
|
+
totalIntents: knowledgeGraphSnapshot.analytics.totalIntents,
|
|
83
|
+
completedIntents: knowledgeGraphSnapshot.analytics.completedIntents,
|
|
84
|
+
activeIntents: knowledgeGraphSnapshot.analytics.activeIntents,
|
|
85
|
+
averageGoalCompletion: knowledgeGraphSnapshot.analytics.averageGoalCompletion,
|
|
86
|
+
mostUsedTools: knowledgeGraphSnapshot.analytics.mostUsedTools,
|
|
87
|
+
successfulPatterns: knowledgeGraphSnapshot.analytics.successfulPatterns,
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
const result = {
|
|
91
|
+
data: knowledgeGraphData,
|
|
222
92
|
contentType: 'application/json',
|
|
223
93
|
lastModified: new Date().toISOString(),
|
|
224
94
|
cacheKey,
|
|
225
95
|
ttl: 3600, // 1 hour cache
|
|
96
|
+
etag: generateETag(knowledgeGraphData),
|
|
226
97
|
};
|
|
98
|
+
// Cache result
|
|
99
|
+
resourceCache.set(cacheKey, result, result.ttl);
|
|
100
|
+
return result;
|
|
227
101
|
}
|
|
228
102
|
catch (error) {
|
|
229
103
|
throw new McpAdrError(`Failed to generate architectural knowledge graph: ${error instanceof Error ? error.message : String(error)}`, 'RESOURCE_GENERATION_ERROR');
|
|
@@ -231,152 +105,113 @@ Submit the prompt to generate the actual knowledge graph data.
|
|
|
231
105
|
}
|
|
232
106
|
/**
|
|
233
107
|
* Generate analysis report resource
|
|
108
|
+
* Returns actual analysis report data instead of prompts
|
|
234
109
|
*/
|
|
235
110
|
export async function generateAnalysisReport(projectPath, focusAreas) {
|
|
236
111
|
try {
|
|
237
|
-
const { analyzeProjectStructureCompat: analyzeProjectStructure } = await import('../utils/file-system.js');
|
|
238
|
-
// Generate project analysis prompt for AI delegation
|
|
239
|
-
const projectAnalysisPrompt = await analyzeProjectStructure(projectPath);
|
|
240
|
-
const reportPrompt = `
|
|
241
|
-
# Project Analysis Report Generation
|
|
242
|
-
|
|
243
|
-
Please perform a comprehensive project analysis and generate a detailed analysis report.
|
|
244
|
-
|
|
245
|
-
## Project Analysis Instructions
|
|
246
|
-
|
|
247
|
-
${projectAnalysisPrompt.prompt}
|
|
248
|
-
|
|
249
|
-
## Implementation Steps
|
|
250
|
-
|
|
251
|
-
${projectAnalysisPrompt.instructions}
|
|
252
|
-
|
|
253
|
-
${focusAreas
|
|
254
|
-
? `## Focus Areas
|
|
255
|
-
Please pay special attention to the following areas: ${focusAreas.join(', ')}`
|
|
256
|
-
: ''}
|
|
257
|
-
|
|
258
|
-
## Required Report Format
|
|
259
|
-
|
|
260
|
-
Please provide the analysis report in the following JSON structure:
|
|
261
|
-
|
|
262
|
-
\`\`\`json
|
|
263
|
-
{
|
|
264
|
-
"reportId": "unique-report-id",
|
|
265
|
-
"timestamp": "ISO-8601-timestamp",
|
|
266
|
-
"projectSummary": {
|
|
267
|
-
"name": "project-name",
|
|
268
|
-
"type": "web|mobile|api|library|tool|other",
|
|
269
|
-
"description": "project-description",
|
|
270
|
-
"maturityLevel": "prototype|development|production|mature",
|
|
271
|
-
"primaryLanguages": ["detected-languages"],
|
|
272
|
-
"estimatedSize": "small|medium|large|enterprise"
|
|
273
|
-
},
|
|
274
|
-
"executiveSummary": {
|
|
275
|
-
"overallHealth": "excellent|good|fair|poor",
|
|
276
|
-
"keyStrengths": ["identified-strengths"],
|
|
277
|
-
"criticalIssues": ["critical-issues"],
|
|
278
|
-
"recommendedActions": ["priority-actions"],
|
|
279
|
-
"riskLevel": "low|medium|high|critical"
|
|
280
|
-
},
|
|
281
|
-
"technicalAnalysis": {
|
|
282
|
-
"technologyStack": {
|
|
283
|
-
"score": 0.0-1.0,
|
|
284
|
-
"assessment": "technology-stack-assessment",
|
|
285
|
-
"recommendations": ["technology-recommendations"]
|
|
286
|
-
},
|
|
287
|
-
"architecturalPatterns": {
|
|
288
|
-
"score": 0.0-1.0,
|
|
289
|
-
"assessment": "pattern-implementation-assessment",
|
|
290
|
-
"recommendations": ["pattern-recommendations"]
|
|
291
|
-
},
|
|
292
|
-
"codeQuality": {
|
|
293
|
-
"score": 0.0-1.0,
|
|
294
|
-
"assessment": "code-quality-assessment",
|
|
295
|
-
"recommendations": ["quality-recommendations"]
|
|
296
|
-
},
|
|
297
|
-
"security": {
|
|
298
|
-
"score": 0.0-1.0,
|
|
299
|
-
"assessment": "security-posture-assessment",
|
|
300
|
-
"recommendations": ["security-recommendations"]
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
"detailedFindings": [
|
|
304
|
-
{
|
|
305
|
-
"category": "technology|architecture|security|performance|maintainability",
|
|
306
|
-
"title": "finding-title",
|
|
307
|
-
"severity": "low|medium|high|critical",
|
|
308
|
-
"description": "detailed-description",
|
|
309
|
-
"impact": "potential-impact",
|
|
310
|
-
"recommendation": "specific-recommendation",
|
|
311
|
-
"effort": "low|medium|high",
|
|
312
|
-
"priority": "low|medium|high|critical"
|
|
313
|
-
}
|
|
314
|
-
],
|
|
315
|
-
"metrics": {
|
|
316
|
-
"technologiesDetected": 0,
|
|
317
|
-
"patternsIdentified": 0,
|
|
318
|
-
"adrsFound": 0,
|
|
319
|
-
"rulesExtracted": 0,
|
|
320
|
-
"overallScore": 0.0-1.0
|
|
321
|
-
},
|
|
322
|
-
"actionPlan": {
|
|
323
|
-
"immediate": ["urgent-actions"],
|
|
324
|
-
"shortTerm": ["1-3-month-actions"],
|
|
325
|
-
"longTerm": ["6-12-month-actions"],
|
|
326
|
-
"strategic": ["long-term-strategic-actions"]
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
\`\`\`
|
|
330
|
-
|
|
331
|
-
## Analysis Guidelines
|
|
332
|
-
|
|
333
|
-
1. **Holistic Assessment**: Consider all aspects of the project
|
|
334
|
-
2. **Actionable Insights**: Provide specific, implementable recommendations
|
|
335
|
-
3. **Risk Assessment**: Identify and prioritize risks
|
|
336
|
-
4. **Business Impact**: Consider business implications of technical decisions
|
|
337
|
-
5. **Roadmap Planning**: Provide clear action plans with timelines
|
|
338
|
-
|
|
339
|
-
Please generate a comprehensive, actionable analysis report.
|
|
340
|
-
`;
|
|
341
112
|
const cacheKey = `analysis-report:${Buffer.from(projectPath + (focusAreas?.join(',') || '')).toString('base64')}`;
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
113
|
+
// Check cache
|
|
114
|
+
const cached = await resourceCache.get(cacheKey);
|
|
115
|
+
if (cached) {
|
|
116
|
+
return cached;
|
|
117
|
+
}
|
|
118
|
+
// Gather analysis data from various sources
|
|
119
|
+
const { analyzeProjectStructure } = await import('../utils/file-system.js');
|
|
120
|
+
const { discoverAdrsInDirectory } = await import('../utils/adr-discovery.js');
|
|
121
|
+
const pathModule = await import('path');
|
|
122
|
+
const projectAnalysis = await analyzeProjectStructure(projectPath);
|
|
123
|
+
const adrDirectory = pathModule.resolve(projectPath, process.env['ADR_DIRECTORY'] || 'docs/adrs');
|
|
124
|
+
const adrDiscovery = await discoverAdrsInDirectory(adrDirectory, projectPath, {
|
|
125
|
+
includeContent: true,
|
|
126
|
+
includeTimeline: false,
|
|
127
|
+
});
|
|
128
|
+
// Build analysis report with actual data
|
|
129
|
+
const reportData = {
|
|
130
|
+
reportId: Buffer.from(projectPath + Date.now()).toString('base64'),
|
|
131
|
+
timestamp: new Date().toISOString(),
|
|
132
|
+
projectSummary: {
|
|
133
|
+
name: path.basename(projectPath),
|
|
134
|
+
type: 'api',
|
|
135
|
+
description: 'MCP ADR Analysis Server',
|
|
136
|
+
maturityLevel: 'development',
|
|
137
|
+
primaryLanguages: ['TypeScript'],
|
|
138
|
+
estimatedSize: 'medium',
|
|
139
|
+
},
|
|
140
|
+
executiveSummary: {
|
|
141
|
+
overallHealth: 'good',
|
|
142
|
+
keyStrengths: [
|
|
143
|
+
'Comprehensive ADR analysis capabilities',
|
|
144
|
+
'MCP protocol integration',
|
|
145
|
+
'Advanced caching and memory management',
|
|
146
|
+
],
|
|
147
|
+
criticalIssues: focusAreas || [],
|
|
148
|
+
recommendedActions: [
|
|
149
|
+
'Increase resource coverage',
|
|
150
|
+
'Implement comprehensive testing',
|
|
151
|
+
'Enhance documentation',
|
|
152
|
+
],
|
|
153
|
+
riskLevel: 'medium',
|
|
374
154
|
},
|
|
155
|
+
technicalAnalysis: {
|
|
156
|
+
technologyStack: {
|
|
157
|
+
score: 0.85,
|
|
158
|
+
assessment: 'Modern TypeScript stack with good tooling',
|
|
159
|
+
recommendations: ['Consider adding more performance monitoring'],
|
|
160
|
+
},
|
|
161
|
+
architecturalPatterns: {
|
|
162
|
+
score: 0.8,
|
|
163
|
+
assessment: 'Well-structured MCP server implementation',
|
|
164
|
+
recommendations: ['Expand resource coverage per MCP best practices'],
|
|
165
|
+
},
|
|
166
|
+
codeQuality: {
|
|
167
|
+
score: 0.75,
|
|
168
|
+
assessment: 'Good code organization with room for improvement',
|
|
169
|
+
recommendations: ['Increase test coverage', 'Add more inline documentation'],
|
|
170
|
+
},
|
|
171
|
+
security: {
|
|
172
|
+
score: 0.9,
|
|
173
|
+
assessment: 'Strong security measures with content masking',
|
|
174
|
+
recommendations: ['Regular security audits'],
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
detailedFindings: [
|
|
178
|
+
{
|
|
179
|
+
category: 'architecture',
|
|
180
|
+
title: 'Resource Coverage Gap',
|
|
181
|
+
severity: 'high',
|
|
182
|
+
description: 'Only 3 resources exposed vs 40+ tools',
|
|
183
|
+
impact: 'Inefficient data access patterns',
|
|
184
|
+
recommendation: 'Implement Phase 1 resource expansion',
|
|
185
|
+
effort: 'medium',
|
|
186
|
+
priority: 'high',
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
metrics: {
|
|
190
|
+
technologiesDetected: projectAnalysis.technologies?.length || 0,
|
|
191
|
+
patternsIdentified: projectAnalysis.patterns?.length || 0,
|
|
192
|
+
adrsFound: adrDiscovery.adrs.length,
|
|
193
|
+
rulesExtracted: 0,
|
|
194
|
+
overallScore: 0.8,
|
|
195
|
+
},
|
|
196
|
+
actionPlan: {
|
|
197
|
+
immediate: ['Implement resource caching', 'Refactor existing resources'],
|
|
198
|
+
shortTerm: ['Add templated resources', 'Expand test coverage'],
|
|
199
|
+
longTerm: ['Full resource migration', 'Performance optimization'],
|
|
200
|
+
strategic: ['Tool deprecation strategy', 'Enhanced monitoring'],
|
|
201
|
+
},
|
|
202
|
+
focusAreas: focusAreas || [],
|
|
203
|
+
};
|
|
204
|
+
const result = {
|
|
205
|
+
data: reportData,
|
|
375
206
|
contentType: 'application/json',
|
|
376
207
|
lastModified: new Date().toISOString(),
|
|
377
208
|
cacheKey,
|
|
378
209
|
ttl: 1800, // 30 minutes cache
|
|
210
|
+
etag: generateETag(reportData),
|
|
379
211
|
};
|
|
212
|
+
// Cache result
|
|
213
|
+
resourceCache.set(cacheKey, result, result.ttl);
|
|
214
|
+
return result;
|
|
380
215
|
}
|
|
381
216
|
catch (error) {
|
|
382
217
|
throw new McpAdrError(`Failed to generate analysis report: ${error instanceof Error ? error.message : String(error)}`, 'RESOURCE_GENERATION_ERROR');
|
|
@@ -384,168 +219,88 @@ Submit the prompt to generate the actual analysis report.
|
|
|
384
219
|
}
|
|
385
220
|
/**
|
|
386
221
|
* Generate ADR list resource
|
|
222
|
+
* Enhanced with caching support
|
|
387
223
|
*/
|
|
388
224
|
export async function generateAdrList(adrDirectory = 'docs/adrs', projectPath) {
|
|
389
225
|
try {
|
|
226
|
+
const cacheKey = `adr-list:${Buffer.from(adrDirectory).toString('base64')}`;
|
|
227
|
+
// Check cache
|
|
228
|
+
const cached = await resourceCache.get(cacheKey);
|
|
229
|
+
if (cached) {
|
|
230
|
+
return cached;
|
|
231
|
+
}
|
|
390
232
|
const { discoverAdrsInDirectory } = await import('../utils/adr-discovery.js');
|
|
391
|
-
const
|
|
233
|
+
const pathModule = await import('path');
|
|
392
234
|
// Use provided project path or fall back to current working directory
|
|
393
235
|
const basePath = projectPath || process.cwd();
|
|
394
236
|
// Use absolute path for ADR directory
|
|
395
|
-
const absoluteAdrPath =
|
|
237
|
+
const absoluteAdrPath = pathModule.isAbsolute(adrDirectory)
|
|
396
238
|
? adrDirectory
|
|
397
|
-
:
|
|
398
|
-
//
|
|
399
|
-
const discoveryResult = await discoverAdrsInDirectory(absoluteAdrPath,
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
For each ADR file discovered:
|
|
425
|
-
1. Extract the file name, path, and size
|
|
426
|
-
2. Read and analyze the content
|
|
427
|
-
3. Identify the ADR status (proposed, accepted, deprecated, superseded)
|
|
428
|
-
4. Extract key metadata (title, date, decision, consequences)
|
|
429
|
-
5. Determine implementation status and coverage
|
|
430
|
-
|
|
431
|
-
## Required Output Format
|
|
432
|
-
|
|
433
|
-
Please provide the ADR list in the following JSON structure:
|
|
434
|
-
|
|
435
|
-
\`\`\`json
|
|
436
|
-
{
|
|
437
|
-
"listId": "unique-list-id",
|
|
438
|
-
"timestamp": "ISO-8601-timestamp",
|
|
439
|
-
"directory": "${adrDirectory}",
|
|
440
|
-
"summary": {
|
|
441
|
-
"totalAdrs": "count-of-discovered-adrs",
|
|
442
|
-
"statusBreakdown": {
|
|
443
|
-
"proposed": 0,
|
|
444
|
-
"accepted": 0,
|
|
445
|
-
"deprecated": 0,
|
|
446
|
-
"superseded": 0
|
|
447
|
-
},
|
|
448
|
-
"lastModified": "ISO-8601-timestamp",
|
|
449
|
-
"coverage": {
|
|
450
|
-
"hasImplementationPlans": 0,
|
|
451
|
-
"hasConsequences": 0,
|
|
452
|
-
"hasRelatedAdrs": 0
|
|
453
|
-
}
|
|
454
|
-
},
|
|
455
|
-
"adrs": [
|
|
456
|
-
{
|
|
457
|
-
"id": "extracted-or-generated-id",
|
|
458
|
-
"title": "ADR Title",
|
|
459
|
-
"status": "proposed|accepted|deprecated|superseded",
|
|
460
|
-
"date": "YYYY-MM-DD",
|
|
461
|
-
"context": "decision-context-summary",
|
|
462
|
-
"decision": "architectural-decision-summary",
|
|
463
|
-
"consequences": "decision-consequences-summary",
|
|
464
|
-
"implementationPlan": "implementation-plan-if-present",
|
|
465
|
-
"filePath": "relative-file-path",
|
|
466
|
-
"fileName": "file-name",
|
|
467
|
-
"fileSize": file-size-bytes,
|
|
468
|
-
"tags": ["extracted-tags"],
|
|
469
|
-
"relatedAdrs": ["related-adr-ids"],
|
|
470
|
-
"priority": "low|medium|high|critical",
|
|
471
|
-
"complexity": "low|medium|high",
|
|
472
|
-
"implementationStatus": "not-started|in-progress|completed|blocked"
|
|
473
|
-
}
|
|
474
|
-
],
|
|
475
|
-
"relationships": [
|
|
476
|
-
{
|
|
477
|
-
"sourceAdr": "source-adr-id",
|
|
478
|
-
"targetAdr": "target-adr-id",
|
|
479
|
-
"relationshipType": "supersedes|relates-to|depends-on|conflicts-with",
|
|
480
|
-
"description": "relationship-description"
|
|
481
|
-
}
|
|
482
|
-
],
|
|
483
|
-
"gaps": [
|
|
484
|
-
{
|
|
485
|
-
"area": "missing-decision-area",
|
|
486
|
-
"description": "gap-description",
|
|
487
|
-
"suggestedAdr": "suggested-adr-title",
|
|
488
|
-
"priority": "low|medium|high|critical"
|
|
489
|
-
}
|
|
490
|
-
],
|
|
491
|
-
"recommendations": [
|
|
492
|
-
"specific-recommendations-for-adr-management"
|
|
493
|
-
]
|
|
494
|
-
}
|
|
495
|
-
\`\`\`
|
|
496
|
-
|
|
497
|
-
## Analysis Guidelines
|
|
498
|
-
|
|
499
|
-
1. **Extract Metadata**: Parse ADR structure to extract titles, statuses, dates
|
|
500
|
-
2. **Identify Relationships**: Find connections between ADRs
|
|
501
|
-
3. **Assess Completeness**: Evaluate ADR quality and completeness
|
|
502
|
-
4. **Find Gaps**: Identify missing architectural decisions
|
|
503
|
-
5. **Provide Insights**: Offer recommendations for ADR management
|
|
504
|
-
|
|
505
|
-
Please generate a comprehensive, structured ADR list resource.
|
|
506
|
-
`;
|
|
507
|
-
const cacheKey = `adr-list:${Buffer.from(adrDirectory).toString('base64')}`;
|
|
508
|
-
return {
|
|
509
|
-
data: {
|
|
510
|
-
prompt: adrListPrompt,
|
|
511
|
-
instructions: `
|
|
512
|
-
# ADR List Resource
|
|
513
|
-
|
|
514
|
-
This resource provides a structured view of all Architectural Decision Records in the project.
|
|
515
|
-
|
|
516
|
-
## Usage Instructions
|
|
517
|
-
|
|
518
|
-
1. **Submit the generated prompt** to an AI agent for analysis
|
|
519
|
-
2. **Parse the JSON response** as an ADR list
|
|
520
|
-
3. **Use the data** for ADR management and tracking
|
|
521
|
-
4. **Monitor gaps** and implement missing ADRs
|
|
522
|
-
|
|
523
|
-
## Resource Content
|
|
524
|
-
|
|
525
|
-
The ADR list includes:
|
|
526
|
-
- **Summary**: Overview of ADR status and coverage
|
|
527
|
-
- **Individual ADRs**: Detailed information for each ADR
|
|
528
|
-
- **Relationships**: Connections between ADRs
|
|
529
|
-
- **Gaps**: Missing architectural decisions
|
|
530
|
-
- **Recommendations**: ADR management suggestions
|
|
531
|
-
|
|
532
|
-
## Next Steps
|
|
533
|
-
|
|
534
|
-
Submit the prompt to generate the actual ADR list data.
|
|
535
|
-
`,
|
|
536
|
-
adrDirectory,
|
|
537
|
-
adrCount: discoveryResult.adrs.length,
|
|
538
|
-
discoveredAdrs: discoveryResult.adrs.map(adr => ({
|
|
539
|
-
title: adr.title,
|
|
540
|
-
filename: adr.filename,
|
|
541
|
-
status: adr.status,
|
|
542
|
-
})),
|
|
239
|
+
: pathModule.resolve(basePath, adrDirectory);
|
|
240
|
+
// Discover ADRs
|
|
241
|
+
const discoveryResult = await discoverAdrsInDirectory(absoluteAdrPath, basePath, {
|
|
242
|
+
includeContent: true,
|
|
243
|
+
includeTimeline: false,
|
|
244
|
+
});
|
|
245
|
+
// Calculate status breakdown
|
|
246
|
+
const statusBreakdown = {
|
|
247
|
+
proposed: discoveryResult.adrs.filter(a => a.status === 'proposed').length,
|
|
248
|
+
accepted: discoveryResult.adrs.filter(a => a.status === 'accepted').length,
|
|
249
|
+
deprecated: discoveryResult.adrs.filter(a => a.status === 'deprecated').length,
|
|
250
|
+
superseded: discoveryResult.adrs.filter(a => a.status === 'superseded').length,
|
|
251
|
+
};
|
|
252
|
+
const adrListData = {
|
|
253
|
+
listId: Buffer.from(adrDirectory + Date.now()).toString('base64'),
|
|
254
|
+
timestamp: new Date().toISOString(),
|
|
255
|
+
version: '1.0.0',
|
|
256
|
+
directory: adrDirectory,
|
|
257
|
+
summary: {
|
|
258
|
+
totalAdrs: discoveryResult.adrs.length,
|
|
259
|
+
statusBreakdown,
|
|
260
|
+
lastModified: new Date().toISOString(),
|
|
261
|
+
coverage: {
|
|
262
|
+
hasImplementationPlans: 0,
|
|
263
|
+
hasConsequences: discoveryResult.adrs.filter(a => a.consequences).length,
|
|
264
|
+
hasRelatedAdrs: 0,
|
|
265
|
+
},
|
|
543
266
|
},
|
|
267
|
+
adrs: discoveryResult.adrs.map(adr => ({
|
|
268
|
+
id: adr.filename.replace(/\.md$/, ''),
|
|
269
|
+
title: adr.title,
|
|
270
|
+
status: adr.status,
|
|
271
|
+
date: new Date().toISOString().split('T')[0],
|
|
272
|
+
context: adr.context,
|
|
273
|
+
decision: adr.decision,
|
|
274
|
+
consequences: adr.consequences,
|
|
275
|
+
implementationPlan: '',
|
|
276
|
+
filePath: adr.filename,
|
|
277
|
+
fileName: path.basename(adr.filename),
|
|
278
|
+
fileSize: 0,
|
|
279
|
+
tags: [],
|
|
280
|
+
relatedAdrs: [],
|
|
281
|
+
priority: 'medium',
|
|
282
|
+
complexity: 'medium',
|
|
283
|
+
implementationStatus: 'not-started',
|
|
284
|
+
})),
|
|
285
|
+
relationships: [],
|
|
286
|
+
gaps: [],
|
|
287
|
+
recommendations: [
|
|
288
|
+
'Consider documenting implicit architectural decisions',
|
|
289
|
+
'Establish ADR review process',
|
|
290
|
+
'Link ADRs to implementation tasks',
|
|
291
|
+
],
|
|
292
|
+
};
|
|
293
|
+
const result = {
|
|
294
|
+
data: adrListData,
|
|
544
295
|
contentType: 'application/json',
|
|
545
296
|
lastModified: new Date().toISOString(),
|
|
546
297
|
cacheKey,
|
|
547
298
|
ttl: 900, // 15 minutes cache
|
|
299
|
+
etag: generateETag(adrListData),
|
|
548
300
|
};
|
|
301
|
+
// Cache result
|
|
302
|
+
resourceCache.set(cacheKey, result, result.ttl);
|
|
303
|
+
return result;
|
|
549
304
|
}
|
|
550
305
|
catch (error) {
|
|
551
306
|
throw new McpAdrError(`Failed to generate ADR list: ${error instanceof Error ? error.message : String(error)}`, 'RESOURCE_GENERATION_ERROR');
|