mcp-adr-analysis-server 2.1.9 → 2.1.20
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 +453 -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 +22 -13
- 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
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Metrics Resource - Code metrics and quality scores
|
|
3
|
+
* URI Pattern: adr://project_metrics
|
|
4
|
+
*/
|
|
5
|
+
import { ResourceGenerationResult } from './index.js';
|
|
6
|
+
export interface ProjectMetrics {
|
|
7
|
+
codebase: {
|
|
8
|
+
totalFiles: number;
|
|
9
|
+
totalLines: number;
|
|
10
|
+
totalSize: string;
|
|
11
|
+
languages: Record<string, {
|
|
12
|
+
files: number;
|
|
13
|
+
lines: number;
|
|
14
|
+
}>;
|
|
15
|
+
largestFiles: Array<{
|
|
16
|
+
path: string;
|
|
17
|
+
lines: number;
|
|
18
|
+
size: string;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
quality: {
|
|
22
|
+
overallScore: number;
|
|
23
|
+
maintainability: number;
|
|
24
|
+
complexity: number;
|
|
25
|
+
documentation: number;
|
|
26
|
+
testing: number;
|
|
27
|
+
breakdown: {
|
|
28
|
+
typescript: {
|
|
29
|
+
errors: number;
|
|
30
|
+
warnings: number;
|
|
31
|
+
};
|
|
32
|
+
linting: {
|
|
33
|
+
errors: number;
|
|
34
|
+
warnings: number;
|
|
35
|
+
};
|
|
36
|
+
tests: {
|
|
37
|
+
total: number;
|
|
38
|
+
passed: number;
|
|
39
|
+
failed: number;
|
|
40
|
+
coverage: number;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
architecture: {
|
|
45
|
+
adrCount: number;
|
|
46
|
+
implementedDecisions: number;
|
|
47
|
+
pendingDecisions: number;
|
|
48
|
+
technologiesUsed: number;
|
|
49
|
+
patternsApplied: number;
|
|
50
|
+
architecturalDebt: {
|
|
51
|
+
score: number;
|
|
52
|
+
issues: string[];
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
dependencies: {
|
|
56
|
+
total: number;
|
|
57
|
+
direct: number;
|
|
58
|
+
dev: number;
|
|
59
|
+
outdated: number;
|
|
60
|
+
vulnerable: number;
|
|
61
|
+
healthScore: number;
|
|
62
|
+
};
|
|
63
|
+
git: {
|
|
64
|
+
totalCommits: number;
|
|
65
|
+
contributors: number;
|
|
66
|
+
branches: number;
|
|
67
|
+
lastCommit: {
|
|
68
|
+
hash: string;
|
|
69
|
+
author: string;
|
|
70
|
+
date: string;
|
|
71
|
+
message: string;
|
|
72
|
+
};
|
|
73
|
+
activity: {
|
|
74
|
+
commitsLastWeek: number;
|
|
75
|
+
commitsLastMonth: number;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
productivity: {
|
|
79
|
+
velocity: number;
|
|
80
|
+
activeContributors: number;
|
|
81
|
+
avgCommitSize: string;
|
|
82
|
+
changeFrequency: string;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Generate comprehensive project metrics resource with code quality, architecture, and productivity analysis.
|
|
87
|
+
*
|
|
88
|
+
* Performs deep analysis of the codebase, dependencies, git history, and architectural decisions
|
|
89
|
+
* to provide actionable metrics for project health and development velocity.
|
|
90
|
+
*
|
|
91
|
+
* **Performance Note:** This function performs multiple expensive operations including:
|
|
92
|
+
* - File system traversal (src, lib, tests, docs directories)
|
|
93
|
+
* - TypeScript compilation check (`npm run typecheck`)
|
|
94
|
+
* - Test execution (`npm test`)
|
|
95
|
+
* - Dependency analysis (`npm outdated`, `npm audit`)
|
|
96
|
+
* - Git history analysis (commits, contributors, branches)
|
|
97
|
+
* - ADR discovery and parsing
|
|
98
|
+
*
|
|
99
|
+
* Results are cached for 5 minutes to balance freshness with performance.
|
|
100
|
+
*
|
|
101
|
+
* @returns Promise resolving to resource generation result containing:
|
|
102
|
+
* - data: Complete project metrics including:
|
|
103
|
+
* - codebase: File counts, line counts, language breakdown, largest files
|
|
104
|
+
* - quality: Overall score, maintainability, complexity, documentation, testing
|
|
105
|
+
* - architecture: ADR count, decisions status, tech stack, architectural debt
|
|
106
|
+
* - dependencies: Package counts, outdated/vulnerable packages, health score
|
|
107
|
+
* - git: Commit history, contributors, branches, recent activity
|
|
108
|
+
* - productivity: Velocity, active contributors, change frequency
|
|
109
|
+
* - contentType: "application/json"
|
|
110
|
+
* - lastModified: ISO timestamp of generation
|
|
111
|
+
* - cacheKey: "project-metrics"
|
|
112
|
+
* - ttl: Cache duration (300 seconds / 5 minutes)
|
|
113
|
+
* - etag: Entity tag for cache validation
|
|
114
|
+
*
|
|
115
|
+
* @throws {Error} Rarely throws; gracefully handles individual metric collection failures by:
|
|
116
|
+
* - Returning zero/default values for failed metrics
|
|
117
|
+
* - Logging warnings for non-critical failures
|
|
118
|
+
* - Continuing execution even if some metrics unavailable
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* const metrics = await generateProjectMetricsResource();
|
|
123
|
+
* console.log(`Overall quality: ${metrics.data.quality.overallScore}%`);
|
|
124
|
+
* console.log(`Total files: ${metrics.data.codebase.totalFiles}`);
|
|
125
|
+
* console.log(`ADRs: ${metrics.data.architecture.adrCount}`);
|
|
126
|
+
* console.log(`Dependencies: ${metrics.data.dependencies.total} (${metrics.data.dependencies.vulnerable} vulnerable)`);
|
|
127
|
+
*
|
|
128
|
+
* // Check if cached result was returned
|
|
129
|
+
* if (metrics.etag) {
|
|
130
|
+
* console.log('Using cached metrics:', metrics.etag);
|
|
131
|
+
* }
|
|
132
|
+
*
|
|
133
|
+
* // Expected output structure:
|
|
134
|
+
* {
|
|
135
|
+
* data: {
|
|
136
|
+
* codebase: {
|
|
137
|
+
* totalFiles: 150,
|
|
138
|
+
* totalLines: 25000,
|
|
139
|
+
* totalSize: "2.5 MB",
|
|
140
|
+
* languages: { ts: { files: 120, lines: 20000 } },
|
|
141
|
+
* largestFiles: [...]
|
|
142
|
+
* },
|
|
143
|
+
* quality: {
|
|
144
|
+
* overallScore: 85,
|
|
145
|
+
* maintainability: 90,
|
|
146
|
+
* complexity: 85,
|
|
147
|
+
* documentation: 80,
|
|
148
|
+
* testing: 85,
|
|
149
|
+
* breakdown: {...}
|
|
150
|
+
* },
|
|
151
|
+
* architecture: {
|
|
152
|
+
* adrCount: 12,
|
|
153
|
+
* implementedDecisions: 10,
|
|
154
|
+
* pendingDecisions: 2,
|
|
155
|
+
* architecturalDebt: { score: 85, issues: [] }
|
|
156
|
+
* },
|
|
157
|
+
* dependencies: {
|
|
158
|
+
* total: 50,
|
|
159
|
+
* direct: 30,
|
|
160
|
+
* dev: 20,
|
|
161
|
+
* outdated: 3,
|
|
162
|
+
* vulnerable: 0,
|
|
163
|
+
* healthScore: 95
|
|
164
|
+
* },
|
|
165
|
+
* git: {...},
|
|
166
|
+
* productivity: {...}
|
|
167
|
+
* },
|
|
168
|
+
* contentType: "application/json",
|
|
169
|
+
* cacheKey: "project-metrics",
|
|
170
|
+
* ttl: 300
|
|
171
|
+
* }
|
|
172
|
+
* ```
|
|
173
|
+
*
|
|
174
|
+
* @since v2.0.0
|
|
175
|
+
* @see {@link getCodebaseStats} for codebase analysis
|
|
176
|
+
* @see {@link calculateQualityMetrics} for quality scoring
|
|
177
|
+
* @see {@link getArchitectureMetrics} for ADR analysis
|
|
178
|
+
*/
|
|
179
|
+
export declare function generateProjectMetricsResource(): Promise<ResourceGenerationResult>;
|
|
180
|
+
//# sourceMappingURL=project-metrics-resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-metrics-resource.d.ts","sourceRoot":"","sources":["../../../src/resources/project-metrics-resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAItD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAC5D,YAAY,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACpE,CAAC;IACF,OAAO,EAAE;QACP,YAAY,EAAE,MAAM,CAAC;QACrB,eAAe,EAAE,MAAM,CAAC;QACxB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE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AE;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,aAAa,EAAE,MAAM,CAAC;QACtB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAobD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AACH,wBAAsB,8BAA8B,IAAI,OAAO,CAAC,wBAAwB,CAAC,CA0CxF"}
|
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Metrics Resource - Code metrics and quality scores
|
|
3
|
+
* URI Pattern: adr://project_metrics
|
|
4
|
+
*/
|
|
5
|
+
import * as fs from 'fs/promises';
|
|
6
|
+
import * as path from 'path';
|
|
7
|
+
import { exec } from 'child_process';
|
|
8
|
+
import { promisify } from 'util';
|
|
9
|
+
import { resourceCache, generateETag } from './resource-cache.js';
|
|
10
|
+
const execAsync = promisify(exec);
|
|
11
|
+
/**
|
|
12
|
+
* Get codebase statistics
|
|
13
|
+
*/
|
|
14
|
+
async function getCodebaseStats() {
|
|
15
|
+
const projectRoot = process.cwd();
|
|
16
|
+
const languages = {};
|
|
17
|
+
let totalFiles = 0;
|
|
18
|
+
let totalLines = 0;
|
|
19
|
+
let totalSize = 0;
|
|
20
|
+
const fileStats = [];
|
|
21
|
+
// Directories to scan
|
|
22
|
+
const scanDirs = ['src', 'lib', 'tests', 'test', 'docs'];
|
|
23
|
+
async function scanDirectory(dir) {
|
|
24
|
+
try {
|
|
25
|
+
const items = await fs.readdir(dir, { withFileTypes: true });
|
|
26
|
+
for (const item of items) {
|
|
27
|
+
const fullPath = path.join(dir, item.name);
|
|
28
|
+
if (item.isDirectory() && !item.name.startsWith('.') && item.name !== 'node_modules') {
|
|
29
|
+
await scanDirectory(fullPath);
|
|
30
|
+
}
|
|
31
|
+
else if (item.isFile()) {
|
|
32
|
+
const ext = path.extname(item.name);
|
|
33
|
+
if (['.ts', '.js', '.tsx', '.jsx', '.json', '.md', '.yaml', '.yml'].includes(ext)) {
|
|
34
|
+
try {
|
|
35
|
+
const content = await fs.readFile(fullPath, 'utf-8');
|
|
36
|
+
const lines = content.split('\n').length;
|
|
37
|
+
const stats = await fs.stat(fullPath);
|
|
38
|
+
totalFiles++;
|
|
39
|
+
totalLines += lines;
|
|
40
|
+
totalSize += stats.size;
|
|
41
|
+
// Track by language
|
|
42
|
+
const lang = ext.substring(1);
|
|
43
|
+
if (!languages[lang]) {
|
|
44
|
+
languages[lang] = { files: 0, lines: 0 };
|
|
45
|
+
}
|
|
46
|
+
languages[lang].files++;
|
|
47
|
+
languages[lang].lines += lines;
|
|
48
|
+
// Track file stats for largest files
|
|
49
|
+
fileStats.push({
|
|
50
|
+
path: fullPath.replace(projectRoot + '/', ''),
|
|
51
|
+
lines,
|
|
52
|
+
size: stats.size,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
// Skip files that can't be read
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
// Directory doesn't exist or can't be read
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
for (const dir of scanDirs) {
|
|
67
|
+
const fullDir = path.join(projectRoot, dir);
|
|
68
|
+
await scanDirectory(fullDir);
|
|
69
|
+
}
|
|
70
|
+
// Get largest files
|
|
71
|
+
const largestFiles = fileStats
|
|
72
|
+
.sort((a, b) => b.lines - a.lines)
|
|
73
|
+
.slice(0, 10)
|
|
74
|
+
.map(f => ({
|
|
75
|
+
path: f.path,
|
|
76
|
+
lines: f.lines,
|
|
77
|
+
size: `${(f.size / 1024).toFixed(2)} KB`,
|
|
78
|
+
}));
|
|
79
|
+
return {
|
|
80
|
+
totalFiles,
|
|
81
|
+
totalLines,
|
|
82
|
+
totalSize: `${(totalSize / 1024 / 1024).toFixed(2)} MB`,
|
|
83
|
+
languages,
|
|
84
|
+
largestFiles,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Calculate quality metrics
|
|
89
|
+
*/
|
|
90
|
+
async function calculateQualityMetrics() {
|
|
91
|
+
let maintainability = 100;
|
|
92
|
+
let complexity = 100;
|
|
93
|
+
let documentation = 100;
|
|
94
|
+
let testing = 100;
|
|
95
|
+
const breakdown = {
|
|
96
|
+
typescript: { errors: 0, warnings: 0 },
|
|
97
|
+
linting: { errors: 0, warnings: 0 },
|
|
98
|
+
tests: { total: 0, passed: 0, failed: 0, coverage: 0 },
|
|
99
|
+
};
|
|
100
|
+
// TypeScript errors
|
|
101
|
+
try {
|
|
102
|
+
await execAsync('npm run typecheck', { timeout: 30000 });
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
const output = error.stdout + error.stderr;
|
|
106
|
+
const errorMatch = output.match(/Found (\d+) error/);
|
|
107
|
+
if (errorMatch) {
|
|
108
|
+
breakdown.typescript.errors = parseInt(errorMatch[1], 10);
|
|
109
|
+
maintainability -= Math.min(breakdown.typescript.errors * 2, 30);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Test results
|
|
113
|
+
try {
|
|
114
|
+
const testResult = await execAsync('npm test -- --passWithNoTests --json', { timeout: 120000 });
|
|
115
|
+
try {
|
|
116
|
+
const testData = JSON.parse(testResult.stdout);
|
|
117
|
+
breakdown.tests.total = testData.numTotalTests || 0;
|
|
118
|
+
breakdown.tests.passed = testData.numPassedTests || 0;
|
|
119
|
+
breakdown.tests.failed = testData.numFailedTests || 0;
|
|
120
|
+
if (breakdown.tests.total > 0) {
|
|
121
|
+
testing = Math.round((breakdown.tests.passed / breakdown.tests.total) * 100);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
// Could not parse test results
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
// Tests failed or not available
|
|
130
|
+
testing = 50;
|
|
131
|
+
}
|
|
132
|
+
// Documentation score (based on README and docs existence)
|
|
133
|
+
try {
|
|
134
|
+
await fs.access(path.join(process.cwd(), 'README.md'));
|
|
135
|
+
documentation = 80;
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
documentation = 40;
|
|
139
|
+
}
|
|
140
|
+
try {
|
|
141
|
+
await fs.access(path.join(process.cwd(), 'docs'));
|
|
142
|
+
documentation = Math.min(documentation + 20, 100);
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
// No docs directory
|
|
146
|
+
}
|
|
147
|
+
// Complexity (placeholder - would require actual complexity analysis)
|
|
148
|
+
complexity = 85;
|
|
149
|
+
const overallScore = Math.round(maintainability * 0.3 + complexity * 0.2 + documentation * 0.2 + testing * 0.3);
|
|
150
|
+
return {
|
|
151
|
+
overallScore,
|
|
152
|
+
maintainability,
|
|
153
|
+
complexity,
|
|
154
|
+
documentation,
|
|
155
|
+
testing,
|
|
156
|
+
breakdown,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Get architecture metrics
|
|
161
|
+
*/
|
|
162
|
+
async function getArchitectureMetrics() {
|
|
163
|
+
// Import ADR discovery
|
|
164
|
+
const { discoverAdrsInDirectory } = await import('../utils/adr-discovery.js');
|
|
165
|
+
const adrDirectory = path.resolve(process.cwd(), process.env['ADR_DIRECTORY'] || 'docs/adrs');
|
|
166
|
+
let adrCount = 0;
|
|
167
|
+
let implementedDecisions = 0;
|
|
168
|
+
let pendingDecisions = 0;
|
|
169
|
+
try {
|
|
170
|
+
const result = await discoverAdrsInDirectory(adrDirectory, process.cwd(), {
|
|
171
|
+
includeContent: true,
|
|
172
|
+
includeTimeline: false,
|
|
173
|
+
});
|
|
174
|
+
adrCount = result.adrs.length;
|
|
175
|
+
implementedDecisions = result.adrs.filter(a => a.status === 'accepted').length;
|
|
176
|
+
pendingDecisions = result.adrs.filter(a => a.status === 'proposed').length;
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
// No ADRs found
|
|
180
|
+
}
|
|
181
|
+
// Placeholder for technologies and patterns (would need proper implementation)
|
|
182
|
+
const technologiesUsed = 3; // TypeScript, Node.js, MCP
|
|
183
|
+
const patternsApplied = 2; // Resource Pattern, Tool Pattern
|
|
184
|
+
// Calculate architectural debt
|
|
185
|
+
const issues = [];
|
|
186
|
+
let debtScore = 100;
|
|
187
|
+
if (adrCount === 0) {
|
|
188
|
+
issues.push('No architectural decisions documented');
|
|
189
|
+
debtScore -= 40;
|
|
190
|
+
}
|
|
191
|
+
else if (adrCount < 5) {
|
|
192
|
+
issues.push('Limited architectural documentation');
|
|
193
|
+
debtScore -= 20;
|
|
194
|
+
}
|
|
195
|
+
if (pendingDecisions > implementedDecisions) {
|
|
196
|
+
issues.push('More pending decisions than implemented');
|
|
197
|
+
debtScore -= 15;
|
|
198
|
+
}
|
|
199
|
+
if (technologiesUsed < 3) {
|
|
200
|
+
issues.push('Limited technology diversity documented');
|
|
201
|
+
debtScore -= 10;
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
adrCount,
|
|
205
|
+
implementedDecisions,
|
|
206
|
+
pendingDecisions,
|
|
207
|
+
technologiesUsed,
|
|
208
|
+
patternsApplied,
|
|
209
|
+
architecturalDebt: {
|
|
210
|
+
score: Math.max(0, debtScore),
|
|
211
|
+
issues,
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Get dependency metrics
|
|
217
|
+
*/
|
|
218
|
+
async function getDependencyMetrics() {
|
|
219
|
+
let total = 0;
|
|
220
|
+
let direct = 0;
|
|
221
|
+
let dev = 0;
|
|
222
|
+
let outdated = 0;
|
|
223
|
+
let vulnerable = 0;
|
|
224
|
+
try {
|
|
225
|
+
const packagePath = path.resolve(process.cwd(), 'package.json');
|
|
226
|
+
const packageContent = await fs.readFile(packagePath, 'utf-8');
|
|
227
|
+
const packageJson = JSON.parse(packageContent);
|
|
228
|
+
direct = Object.keys(packageJson.dependencies || {}).length;
|
|
229
|
+
dev = Object.keys(packageJson.devDependencies || {}).length;
|
|
230
|
+
total = direct + dev;
|
|
231
|
+
// Check outdated
|
|
232
|
+
try {
|
|
233
|
+
const outdatedResult = await execAsync('npm outdated --json', { timeout: 30000 });
|
|
234
|
+
const outdatedData = JSON.parse(outdatedResult.stdout);
|
|
235
|
+
outdated = Object.keys(outdatedData).length;
|
|
236
|
+
}
|
|
237
|
+
catch (error) {
|
|
238
|
+
if (error.stdout) {
|
|
239
|
+
try {
|
|
240
|
+
const outdatedData = JSON.parse(error.stdout);
|
|
241
|
+
outdated = Object.keys(outdatedData).length;
|
|
242
|
+
}
|
|
243
|
+
catch {
|
|
244
|
+
// Could not parse
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
// Check vulnerabilities
|
|
249
|
+
try {
|
|
250
|
+
const auditResult = await execAsync('npm audit --json', { timeout: 30000 });
|
|
251
|
+
const auditData = JSON.parse(auditResult.stdout);
|
|
252
|
+
vulnerable = auditData.metadata?.vulnerabilities?.total || 0;
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
if (error.stdout) {
|
|
256
|
+
try {
|
|
257
|
+
const auditData = JSON.parse(error.stdout);
|
|
258
|
+
vulnerable = auditData.metadata?.vulnerabilities?.total || 0;
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
// Could not parse
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
catch {
|
|
267
|
+
// Unable to read package.json
|
|
268
|
+
}
|
|
269
|
+
// Calculate health score
|
|
270
|
+
let healthScore = 100;
|
|
271
|
+
if (vulnerable > 0)
|
|
272
|
+
healthScore -= Math.min(vulnerable * 10, 50);
|
|
273
|
+
if (outdated > 5)
|
|
274
|
+
healthScore -= Math.min((outdated - 5) * 2, 30);
|
|
275
|
+
return {
|
|
276
|
+
total,
|
|
277
|
+
direct,
|
|
278
|
+
dev,
|
|
279
|
+
outdated,
|
|
280
|
+
vulnerable,
|
|
281
|
+
healthScore: Math.max(0, healthScore),
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Get git metrics
|
|
286
|
+
*/
|
|
287
|
+
async function getGitMetrics() {
|
|
288
|
+
let totalCommits = 0;
|
|
289
|
+
let contributors = 0;
|
|
290
|
+
let branches = 0;
|
|
291
|
+
let commitsLastWeek = 0;
|
|
292
|
+
let commitsLastMonth = 0;
|
|
293
|
+
const lastCommit = {
|
|
294
|
+
hash: 'unknown',
|
|
295
|
+
author: 'unknown',
|
|
296
|
+
date: new Date().toISOString(),
|
|
297
|
+
message: 'Git information unavailable',
|
|
298
|
+
};
|
|
299
|
+
try {
|
|
300
|
+
// Total commits
|
|
301
|
+
const commitCountResult = await execAsync('git rev-list --count HEAD');
|
|
302
|
+
totalCommits = parseInt(commitCountResult.stdout.trim(), 10);
|
|
303
|
+
// Contributors
|
|
304
|
+
const contributorsResult = await execAsync('git shortlog -sn --all | wc -l');
|
|
305
|
+
contributors = parseInt(contributorsResult.stdout.trim(), 10);
|
|
306
|
+
// Branches
|
|
307
|
+
const branchesResult = await execAsync('git branch -a | wc -l');
|
|
308
|
+
branches = parseInt(branchesResult.stdout.trim(), 10);
|
|
309
|
+
// Last commit
|
|
310
|
+
const lastCommitResult = await execAsync('git log -1 --pretty=format:"%H|%an|%aI|%s"');
|
|
311
|
+
const [hash, author, date, message] = lastCommitResult.stdout.split('|');
|
|
312
|
+
if (hash && author && date && message) {
|
|
313
|
+
lastCommit.hash = hash.substring(0, 7);
|
|
314
|
+
lastCommit.author = author;
|
|
315
|
+
lastCommit.date = date;
|
|
316
|
+
lastCommit.message = message;
|
|
317
|
+
}
|
|
318
|
+
// Recent activity
|
|
319
|
+
const weekAgoResult = await execAsync('git rev-list --count --since="1 week ago" HEAD');
|
|
320
|
+
commitsLastWeek = parseInt(weekAgoResult.stdout.trim(), 10);
|
|
321
|
+
const monthAgoResult = await execAsync('git rev-list --count --since="1 month ago" HEAD');
|
|
322
|
+
commitsLastMonth = parseInt(monthAgoResult.stdout.trim(), 10);
|
|
323
|
+
}
|
|
324
|
+
catch {
|
|
325
|
+
// Git commands failed
|
|
326
|
+
}
|
|
327
|
+
return {
|
|
328
|
+
totalCommits,
|
|
329
|
+
contributors,
|
|
330
|
+
branches,
|
|
331
|
+
lastCommit,
|
|
332
|
+
activity: {
|
|
333
|
+
commitsLastWeek,
|
|
334
|
+
commitsLastMonth,
|
|
335
|
+
},
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Calculate productivity metrics
|
|
340
|
+
*/
|
|
341
|
+
function calculateProductivityMetrics(gitMetrics) {
|
|
342
|
+
const velocity = gitMetrics.activity.commitsLastWeek;
|
|
343
|
+
const activeContributors = gitMetrics.contributors;
|
|
344
|
+
const avgCommitSize = 'Medium'; // Placeholder
|
|
345
|
+
const changeFrequency = gitMetrics.activity.commitsLastMonth > 30
|
|
346
|
+
? 'High'
|
|
347
|
+
: gitMetrics.activity.commitsLastMonth > 10
|
|
348
|
+
? 'Medium'
|
|
349
|
+
: 'Low';
|
|
350
|
+
return {
|
|
351
|
+
velocity,
|
|
352
|
+
activeContributors,
|
|
353
|
+
avgCommitSize,
|
|
354
|
+
changeFrequency,
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Generate comprehensive project metrics resource with code quality, architecture, and productivity analysis.
|
|
359
|
+
*
|
|
360
|
+
* Performs deep analysis of the codebase, dependencies, git history, and architectural decisions
|
|
361
|
+
* to provide actionable metrics for project health and development velocity.
|
|
362
|
+
*
|
|
363
|
+
* **Performance Note:** This function performs multiple expensive operations including:
|
|
364
|
+
* - File system traversal (src, lib, tests, docs directories)
|
|
365
|
+
* - TypeScript compilation check (`npm run typecheck`)
|
|
366
|
+
* - Test execution (`npm test`)
|
|
367
|
+
* - Dependency analysis (`npm outdated`, `npm audit`)
|
|
368
|
+
* - Git history analysis (commits, contributors, branches)
|
|
369
|
+
* - ADR discovery and parsing
|
|
370
|
+
*
|
|
371
|
+
* Results are cached for 5 minutes to balance freshness with performance.
|
|
372
|
+
*
|
|
373
|
+
* @returns Promise resolving to resource generation result containing:
|
|
374
|
+
* - data: Complete project metrics including:
|
|
375
|
+
* - codebase: File counts, line counts, language breakdown, largest files
|
|
376
|
+
* - quality: Overall score, maintainability, complexity, documentation, testing
|
|
377
|
+
* - architecture: ADR count, decisions status, tech stack, architectural debt
|
|
378
|
+
* - dependencies: Package counts, outdated/vulnerable packages, health score
|
|
379
|
+
* - git: Commit history, contributors, branches, recent activity
|
|
380
|
+
* - productivity: Velocity, active contributors, change frequency
|
|
381
|
+
* - contentType: "application/json"
|
|
382
|
+
* - lastModified: ISO timestamp of generation
|
|
383
|
+
* - cacheKey: "project-metrics"
|
|
384
|
+
* - ttl: Cache duration (300 seconds / 5 minutes)
|
|
385
|
+
* - etag: Entity tag for cache validation
|
|
386
|
+
*
|
|
387
|
+
* @throws {Error} Rarely throws; gracefully handles individual metric collection failures by:
|
|
388
|
+
* - Returning zero/default values for failed metrics
|
|
389
|
+
* - Logging warnings for non-critical failures
|
|
390
|
+
* - Continuing execution even if some metrics unavailable
|
|
391
|
+
*
|
|
392
|
+
* @example
|
|
393
|
+
* ```typescript
|
|
394
|
+
* const metrics = await generateProjectMetricsResource();
|
|
395
|
+
* console.log(`Overall quality: ${metrics.data.quality.overallScore}%`);
|
|
396
|
+
* console.log(`Total files: ${metrics.data.codebase.totalFiles}`);
|
|
397
|
+
* console.log(`ADRs: ${metrics.data.architecture.adrCount}`);
|
|
398
|
+
* console.log(`Dependencies: ${metrics.data.dependencies.total} (${metrics.data.dependencies.vulnerable} vulnerable)`);
|
|
399
|
+
*
|
|
400
|
+
* // Check if cached result was returned
|
|
401
|
+
* if (metrics.etag) {
|
|
402
|
+
* console.log('Using cached metrics:', metrics.etag);
|
|
403
|
+
* }
|
|
404
|
+
*
|
|
405
|
+
* // Expected output structure:
|
|
406
|
+
* {
|
|
407
|
+
* data: {
|
|
408
|
+
* codebase: {
|
|
409
|
+
* totalFiles: 150,
|
|
410
|
+
* totalLines: 25000,
|
|
411
|
+
* totalSize: "2.5 MB",
|
|
412
|
+
* languages: { ts: { files: 120, lines: 20000 } },
|
|
413
|
+
* largestFiles: [...]
|
|
414
|
+
* },
|
|
415
|
+
* quality: {
|
|
416
|
+
* overallScore: 85,
|
|
417
|
+
* maintainability: 90,
|
|
418
|
+
* complexity: 85,
|
|
419
|
+
* documentation: 80,
|
|
420
|
+
* testing: 85,
|
|
421
|
+
* breakdown: {...}
|
|
422
|
+
* },
|
|
423
|
+
* architecture: {
|
|
424
|
+
* adrCount: 12,
|
|
425
|
+
* implementedDecisions: 10,
|
|
426
|
+
* pendingDecisions: 2,
|
|
427
|
+
* architecturalDebt: { score: 85, issues: [] }
|
|
428
|
+
* },
|
|
429
|
+
* dependencies: {
|
|
430
|
+
* total: 50,
|
|
431
|
+
* direct: 30,
|
|
432
|
+
* dev: 20,
|
|
433
|
+
* outdated: 3,
|
|
434
|
+
* vulnerable: 0,
|
|
435
|
+
* healthScore: 95
|
|
436
|
+
* },
|
|
437
|
+
* git: {...},
|
|
438
|
+
* productivity: {...}
|
|
439
|
+
* },
|
|
440
|
+
* contentType: "application/json",
|
|
441
|
+
* cacheKey: "project-metrics",
|
|
442
|
+
* ttl: 300
|
|
443
|
+
* }
|
|
444
|
+
* ```
|
|
445
|
+
*
|
|
446
|
+
* @since v2.0.0
|
|
447
|
+
* @see {@link getCodebaseStats} for codebase analysis
|
|
448
|
+
* @see {@link calculateQualityMetrics} for quality scoring
|
|
449
|
+
* @see {@link getArchitectureMetrics} for ADR analysis
|
|
450
|
+
*/
|
|
451
|
+
export async function generateProjectMetricsResource() {
|
|
452
|
+
const cacheKey = 'project-metrics';
|
|
453
|
+
// Check cache
|
|
454
|
+
const cached = await resourceCache.get(cacheKey);
|
|
455
|
+
if (cached) {
|
|
456
|
+
return cached;
|
|
457
|
+
}
|
|
458
|
+
// Gather metrics
|
|
459
|
+
const [codebase, quality, architecture, dependencies, git] = await Promise.all([
|
|
460
|
+
getCodebaseStats(),
|
|
461
|
+
calculateQualityMetrics(),
|
|
462
|
+
getArchitectureMetrics(),
|
|
463
|
+
getDependencyMetrics(),
|
|
464
|
+
getGitMetrics(),
|
|
465
|
+
]);
|
|
466
|
+
const productivity = calculateProductivityMetrics(git);
|
|
467
|
+
const projectMetrics = {
|
|
468
|
+
codebase,
|
|
469
|
+
quality,
|
|
470
|
+
architecture,
|
|
471
|
+
dependencies,
|
|
472
|
+
git,
|
|
473
|
+
productivity,
|
|
474
|
+
};
|
|
475
|
+
const result = {
|
|
476
|
+
data: projectMetrics,
|
|
477
|
+
contentType: 'application/json',
|
|
478
|
+
lastModified: new Date().toISOString(),
|
|
479
|
+
cacheKey,
|
|
480
|
+
ttl: 300, // 5 minutes cache
|
|
481
|
+
etag: generateETag(projectMetrics),
|
|
482
|
+
};
|
|
483
|
+
// Cache result
|
|
484
|
+
resourceCache.set(cacheKey, result, result.ttl);
|
|
485
|
+
return result;
|
|
486
|
+
}
|
|
487
|
+
//# sourceMappingURL=project-metrics-resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-metrics-resource.js","sourceRoot":"","sources":["../../../src/resources/project-metrics-resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGlE,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAgElC;;GAEG;AACH,KAAK,U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