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
|
@@ -0,0 +1,665 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deployment Status Resource - Current deployment state
|
|
3
|
+
* URI Pattern: adr://deployment_status
|
|
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 current git information
|
|
13
|
+
*/
|
|
14
|
+
async function getGitInfo() {
|
|
15
|
+
try {
|
|
16
|
+
const [branchResult, commitResult, messageResult] = await Promise.all([
|
|
17
|
+
execAsync('git rev-parse --abbrev-ref HEAD'),
|
|
18
|
+
execAsync('git rev-parse --short HEAD'),
|
|
19
|
+
execAsync('git log -1 --pretty=%B'),
|
|
20
|
+
]);
|
|
21
|
+
return {
|
|
22
|
+
branch: branchResult.stdout.trim(),
|
|
23
|
+
commit: commitResult.stdout.trim(),
|
|
24
|
+
commitMessage: messageResult.stdout.trim(),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return {
|
|
29
|
+
branch: 'unknown',
|
|
30
|
+
commit: 'unknown',
|
|
31
|
+
commitMessage: 'Git information unavailable',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get package version from package.json
|
|
37
|
+
*/
|
|
38
|
+
async function getPackageVersion() {
|
|
39
|
+
try {
|
|
40
|
+
const packagePath = path.resolve(process.cwd(), 'package.json');
|
|
41
|
+
const packageContent = await fs.readFile(packagePath, 'utf-8');
|
|
42
|
+
const packageJson = JSON.parse(packageContent);
|
|
43
|
+
return packageJson.version || '0.0.0';
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return '0.0.0';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Run deployment checks
|
|
51
|
+
*/
|
|
52
|
+
async function runDeploymentChecks() {
|
|
53
|
+
const checks = [];
|
|
54
|
+
const timestamp = new Date().toISOString();
|
|
55
|
+
// Check 1: TypeScript compilation
|
|
56
|
+
try {
|
|
57
|
+
await execAsync('npm run typecheck', { timeout: 30000 });
|
|
58
|
+
checks.push({
|
|
59
|
+
name: 'TypeScript Compilation',
|
|
60
|
+
status: 'passed',
|
|
61
|
+
message: 'All type checks passed',
|
|
62
|
+
timestamp,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
checks.push({
|
|
67
|
+
name: 'TypeScript Compilation',
|
|
68
|
+
status: 'failed',
|
|
69
|
+
message: 'Type check failures detected',
|
|
70
|
+
timestamp,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
// Check 2: Build status
|
|
74
|
+
try {
|
|
75
|
+
await execAsync('npm run build', { timeout: 60000 });
|
|
76
|
+
checks.push({
|
|
77
|
+
name: 'Build Process',
|
|
78
|
+
status: 'passed',
|
|
79
|
+
message: 'Build completed successfully',
|
|
80
|
+
timestamp,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
checks.push({
|
|
85
|
+
name: 'Build Process',
|
|
86
|
+
status: 'failed',
|
|
87
|
+
message: 'Build failed',
|
|
88
|
+
timestamp,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
// Check 3: Test suite
|
|
92
|
+
try {
|
|
93
|
+
await execAsync('npm test -- --passWithNoTests', { timeout: 120000 });
|
|
94
|
+
checks.push({
|
|
95
|
+
name: 'Test Suite',
|
|
96
|
+
status: 'passed',
|
|
97
|
+
message: 'All tests passed',
|
|
98
|
+
timestamp,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
checks.push({
|
|
103
|
+
name: 'Test Suite',
|
|
104
|
+
status: 'warning',
|
|
105
|
+
message: 'Some tests failed or no tests found',
|
|
106
|
+
timestamp,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return checks;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Check dependency status
|
|
113
|
+
*/
|
|
114
|
+
async function checkDependencies() {
|
|
115
|
+
let total = 0;
|
|
116
|
+
let outdated = 0;
|
|
117
|
+
let vulnerable = 0;
|
|
118
|
+
try {
|
|
119
|
+
const packagePath = path.resolve(process.cwd(), 'package.json');
|
|
120
|
+
const packageContent = await fs.readFile(packagePath, 'utf-8');
|
|
121
|
+
const packageJson = JSON.parse(packageContent);
|
|
122
|
+
total = Object.keys(packageJson.dependencies || {}).length;
|
|
123
|
+
// Check for outdated packages
|
|
124
|
+
try {
|
|
125
|
+
const outdatedResult = await execAsync('npm outdated --json', { timeout: 30000 });
|
|
126
|
+
const outdatedData = JSON.parse(outdatedResult.stdout);
|
|
127
|
+
outdated = Object.keys(outdatedData).length;
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
// npm outdated returns exit code 1 when there are outdated packages
|
|
131
|
+
if (error.stdout) {
|
|
132
|
+
try {
|
|
133
|
+
const outdatedData = JSON.parse(error.stdout);
|
|
134
|
+
outdated = Object.keys(outdatedData).length;
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
outdated = 0;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// Check for vulnerabilities
|
|
142
|
+
try {
|
|
143
|
+
const auditResult = await execAsync('npm audit --json', { timeout: 30000 });
|
|
144
|
+
const auditData = JSON.parse(auditResult.stdout);
|
|
145
|
+
vulnerable = auditData.metadata?.vulnerabilities?.total || 0;
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
if (error.stdout) {
|
|
149
|
+
try {
|
|
150
|
+
const auditData = JSON.parse(error.stdout);
|
|
151
|
+
vulnerable = auditData.metadata?.vulnerabilities?.total || 0;
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
vulnerable = 0;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
// Unable to check dependencies
|
|
161
|
+
}
|
|
162
|
+
return { total, outdated, vulnerable };
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Get build information
|
|
166
|
+
*/
|
|
167
|
+
async function getBuildInfo() {
|
|
168
|
+
try {
|
|
169
|
+
const distPath = path.resolve(process.cwd(), 'dist');
|
|
170
|
+
const stats = await fs.stat(distPath);
|
|
171
|
+
return {
|
|
172
|
+
lastBuild: stats.mtime.toISOString(),
|
|
173
|
+
buildStatus: 'success',
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
return {
|
|
178
|
+
lastBuild: 'Never',
|
|
179
|
+
buildStatus: 'unknown',
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Calculate deployment readiness
|
|
185
|
+
*/
|
|
186
|
+
function calculateDeploymentReadiness(checks, dependencies) {
|
|
187
|
+
const blockers = [];
|
|
188
|
+
const warnings = [];
|
|
189
|
+
const recommendations = [];
|
|
190
|
+
let score = 100;
|
|
191
|
+
// Failed checks are blockers
|
|
192
|
+
const failedChecks = checks.filter(c => c.status === 'failed');
|
|
193
|
+
if (failedChecks.length > 0) {
|
|
194
|
+
blockers.push(...failedChecks.map(c => `${c.name}: ${c.message}`));
|
|
195
|
+
score -= failedChecks.length * 30;
|
|
196
|
+
}
|
|
197
|
+
// Warning checks
|
|
198
|
+
const warningChecks = checks.filter(c => c.status === 'warning');
|
|
199
|
+
if (warningChecks.length > 0) {
|
|
200
|
+
warnings.push(...warningChecks.map(c => `${c.name}: ${c.message}`));
|
|
201
|
+
score -= warningChecks.length * 10;
|
|
202
|
+
}
|
|
203
|
+
// Vulnerable dependencies are blockers
|
|
204
|
+
if (dependencies.vulnerable > 0) {
|
|
205
|
+
blockers.push(`${dependencies.vulnerable} vulnerable dependencies detected`);
|
|
206
|
+
score -= Math.min(dependencies.vulnerable * 5, 30);
|
|
207
|
+
}
|
|
208
|
+
// Outdated dependencies are warnings
|
|
209
|
+
if (dependencies.outdated > 5) {
|
|
210
|
+
warnings.push(`${dependencies.outdated} outdated dependencies`);
|
|
211
|
+
score -= Math.min(dependencies.outdated, 20);
|
|
212
|
+
}
|
|
213
|
+
// Recommendations
|
|
214
|
+
if (dependencies.outdated > 0) {
|
|
215
|
+
recommendations.push('Update outdated dependencies');
|
|
216
|
+
}
|
|
217
|
+
if (score < 80) {
|
|
218
|
+
recommendations.push('Address all blockers and warnings before deployment');
|
|
219
|
+
}
|
|
220
|
+
if (blockers.length === 0 && warnings.length === 0) {
|
|
221
|
+
recommendations.push('System is ready for deployment');
|
|
222
|
+
}
|
|
223
|
+
return {
|
|
224
|
+
score: Math.max(0, score),
|
|
225
|
+
blockers,
|
|
226
|
+
warnings,
|
|
227
|
+
recommendations,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Extract structured data from deployment-readiness-tool output
|
|
232
|
+
*/
|
|
233
|
+
function extractDeploymentDataFromToolOutput(toolOutput) {
|
|
234
|
+
const extracted = {};
|
|
235
|
+
// Extract code quality analysis
|
|
236
|
+
if (toolOutput.includes('Code Quality') || toolOutput.includes('quality')) {
|
|
237
|
+
const scoreMatch = toolOutput.match(/(?:quality|overall)[\s\S]*?score[:\s]+(\d+)/i);
|
|
238
|
+
const productionMatch = toolOutput.match(/production[\s\S]*?code[:\s]+(\d+)/i);
|
|
239
|
+
const mockMatch = toolOutput.match(/mock[:\s]+(\d+)/i);
|
|
240
|
+
if (scoreMatch || productionMatch) {
|
|
241
|
+
extracted.codeQualityAnalysis = {
|
|
242
|
+
overallScore: scoreMatch && scoreMatch[1] ? parseInt(scoreMatch[1]) : 0,
|
|
243
|
+
productionCodeScore: productionMatch && productionMatch[1] ? parseInt(productionMatch[1]) : 0,
|
|
244
|
+
mockCodeIndicators: mockMatch && mockMatch[1] ? parseInt(mockMatch[1]) : 0,
|
|
245
|
+
productionCodeThreshold: 80,
|
|
246
|
+
qualityGates: [],
|
|
247
|
+
};
|
|
248
|
+
// Extract quality gates
|
|
249
|
+
const gateMatches = toolOutput.matchAll(/(?:gate|check)[:\s]+([\w\s]+)[\s-]+(passed|failed)/gi);
|
|
250
|
+
for (const match of gateMatches) {
|
|
251
|
+
if (extracted.codeQualityAnalysis && match[1] && match[2]) {
|
|
252
|
+
extracted.codeQualityAnalysis.qualityGates.push({
|
|
253
|
+
gate: match[1].trim(),
|
|
254
|
+
passed: match[2].toLowerCase() === 'passed',
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
// Extract test validation
|
|
261
|
+
if (toolOutput.includes('test') || toolOutput.includes('Test')) {
|
|
262
|
+
const totalMatch = toolOutput.match(/(\d+)\s+total[\s\S]*?tests?/i);
|
|
263
|
+
const passedMatch = toolOutput.match(/(\d+)\s+passed/i);
|
|
264
|
+
const failedMatch = toolOutput.match(/(\d+)\s+failed/i);
|
|
265
|
+
const coverageMatch = toolOutput.match(/coverage[:\s]+(\d+)%/i);
|
|
266
|
+
const totalTests = totalMatch && totalMatch[1] ? parseInt(totalMatch[1]) : 0;
|
|
267
|
+
const passedTests = passedMatch && passedMatch[1] ? parseInt(passedMatch[1]) : 0;
|
|
268
|
+
const failedTests = failedMatch && failedMatch[1] ? parseInt(failedMatch[1]) : 0;
|
|
269
|
+
extracted.testValidation = {
|
|
270
|
+
testExecutionResult: failedTests > 0 ? 'failed' : passedTests > 0 ? 'passed' : 'unknown',
|
|
271
|
+
totalTests,
|
|
272
|
+
passedTests,
|
|
273
|
+
failedTests,
|
|
274
|
+
skippedTests: totalTests - passedTests - failedTests,
|
|
275
|
+
coverage: coverageMatch && coverageMatch[1] ? parseInt(coverageMatch[1]) : 0,
|
|
276
|
+
zeroToleranceEnforced: toolOutput.includes('zero tolerance') || toolOutput.includes('strict'),
|
|
277
|
+
failureDetails: [],
|
|
278
|
+
};
|
|
279
|
+
// Extract test failures
|
|
280
|
+
const failureMatches = toolOutput.matchAll(/(?:FAIL|failed)[:\s]+([\w/.-]+)\s*(?:›\s*)?(.*)/gi);
|
|
281
|
+
for (const match of failureMatches) {
|
|
282
|
+
if (extracted.testValidation && match[1]) {
|
|
283
|
+
extracted.testValidation.failureDetails.push({
|
|
284
|
+
suite: match[1].trim(),
|
|
285
|
+
test: match[2] ? match[2].trim() : 'Test failed',
|
|
286
|
+
error: 'Test execution failed',
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
// Extract deployment history
|
|
292
|
+
if (toolOutput.includes('deployment') &&
|
|
293
|
+
(toolOutput.includes('history') || toolOutput.includes('previous'))) {
|
|
294
|
+
const totalMatch = toolOutput.match(/(\d+)\s+(?:total\s+)?deployments?/i);
|
|
295
|
+
const successMatch = toolOutput.match(/(\d+)\s+successful/i);
|
|
296
|
+
const failedMatch = toolOutput.match(/(\d+)\s+failed/i);
|
|
297
|
+
const successRateMatch = toolOutput.match(/success\s+rate[:\s]+(\d+)%/i);
|
|
298
|
+
const rollbackMatch = toolOutput.match(/(\d+)\s+rollbacks?/i);
|
|
299
|
+
const totalDeployments = totalMatch && totalMatch[1] ? parseInt(totalMatch[1]) : 0;
|
|
300
|
+
const successfulDeployments = successMatch && successMatch[1] ? parseInt(successMatch[1]) : 0;
|
|
301
|
+
const failedDeployments = failedMatch && failedMatch[1] ? parseInt(failedMatch[1]) : 0;
|
|
302
|
+
extracted.deploymentHistory = {
|
|
303
|
+
totalDeployments,
|
|
304
|
+
successfulDeployments,
|
|
305
|
+
failedDeployments,
|
|
306
|
+
successRate: successRateMatch && successRateMatch[1]
|
|
307
|
+
? parseInt(successRateMatch[1])
|
|
308
|
+
: totalDeployments > 0
|
|
309
|
+
? Math.round((successfulDeployments / totalDeployments) * 100)
|
|
310
|
+
: 0,
|
|
311
|
+
recentFailures: failedMatch && failedMatch[1] ? parseInt(failedMatch[1]) : 0,
|
|
312
|
+
rollbackFrequency: rollbackMatch && rollbackMatch[1] ? parseInt(rollbackMatch[1]) : 0,
|
|
313
|
+
averageDeploymentTime: '5 minutes',
|
|
314
|
+
trends: [],
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
// Extract ADR compliance
|
|
318
|
+
if (toolOutput.includes('ADR') || toolOutput.includes('compliance')) {
|
|
319
|
+
const totalReqMatch = toolOutput.match(/(\d+)\s+(?:total\s+)?requirements?/i);
|
|
320
|
+
const metMatch = toolOutput.match(/(\d+)\s+met/i);
|
|
321
|
+
const complianceMatch = toolOutput.match(/compliance[:\s]+(\d+)%/i);
|
|
322
|
+
const totalRequirements = totalReqMatch && totalReqMatch[1] ? parseInt(totalReqMatch[1]) : 0;
|
|
323
|
+
const metRequirements = metMatch && metMatch[1] ? parseInt(metMatch[1]) : 0;
|
|
324
|
+
extracted.adrCompliance = {
|
|
325
|
+
totalRequirements,
|
|
326
|
+
metRequirements,
|
|
327
|
+
unmetRequirements: totalRequirements - metRequirements,
|
|
328
|
+
complianceScore: complianceMatch && complianceMatch[1]
|
|
329
|
+
? parseInt(complianceMatch[1])
|
|
330
|
+
: totalRequirements > 0
|
|
331
|
+
? Math.round((metRequirements / totalRequirements) * 100)
|
|
332
|
+
: 100,
|
|
333
|
+
violations: [],
|
|
334
|
+
};
|
|
335
|
+
// Extract violations
|
|
336
|
+
const violationMatches = toolOutput.matchAll(/violation[:\s]+([\w\s]+)(?:\(([A-Z0-9-]+)\))?/gi);
|
|
337
|
+
for (const match of violationMatches) {
|
|
338
|
+
if (extracted.adrCompliance && match[1]) {
|
|
339
|
+
extracted.adrCompliance.violations.push({
|
|
340
|
+
requirement: match[1].trim(),
|
|
341
|
+
adrId: match[2] ? match[2].trim() : 'UNKNOWN',
|
|
342
|
+
severity: 'medium',
|
|
343
|
+
description: `Requirement not met: ${match[1].trim()}`,
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
// Extract critical blockers
|
|
349
|
+
const blockerMatches = toolOutput.matchAll(/(?:blocker|critical|error)[:\s]+(.*?)(?:\n|$)/gi);
|
|
350
|
+
const blockers = [];
|
|
351
|
+
for (const match of blockerMatches) {
|
|
352
|
+
if (match[1]) {
|
|
353
|
+
const text = match[1].trim();
|
|
354
|
+
let category = 'tests';
|
|
355
|
+
if (text.toLowerCase().includes('test'))
|
|
356
|
+
category = 'tests';
|
|
357
|
+
else if (text.toLowerCase().includes('quality') || text.toLowerCase().includes('code'))
|
|
358
|
+
category = 'code_quality';
|
|
359
|
+
else if (text.toLowerCase().includes('dependen'))
|
|
360
|
+
category = 'dependencies';
|
|
361
|
+
else if (text.toLowerCase().includes('adr') || text.toLowerCase().includes('compliance'))
|
|
362
|
+
category = 'adr_compliance';
|
|
363
|
+
else if (text.toLowerCase().includes('deploy'))
|
|
364
|
+
category = 'deployment_history';
|
|
365
|
+
blockers.push({
|
|
366
|
+
category,
|
|
367
|
+
title: text,
|
|
368
|
+
description: text,
|
|
369
|
+
severity: 'critical',
|
|
370
|
+
resolutionSteps: [],
|
|
371
|
+
autoFixable: false,
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
if (blockers.length > 0) {
|
|
376
|
+
extracted.criticalBlockers = blockers;
|
|
377
|
+
}
|
|
378
|
+
// Extract memory integration info
|
|
379
|
+
if (toolOutput.includes('memory') || toolOutput.includes('Memory')) {
|
|
380
|
+
const assessmentMatch = toolOutput.match(/assessment[\s\S]*?id[:\s]+([a-f0-9-]+)/i);
|
|
381
|
+
const previousScoreMatch = toolOutput.match(/previous[\s\S]*?score[:\s]+(\d+)/i);
|
|
382
|
+
const currentScoreMatch = toolOutput.match(/current[\s\S]*?score[:\s]+(\d+)/i);
|
|
383
|
+
extracted.memoryIntegration = {
|
|
384
|
+
enabled: true,
|
|
385
|
+
};
|
|
386
|
+
if (assessmentMatch && assessmentMatch[1]) {
|
|
387
|
+
extracted.memoryIntegration.assessmentId = assessmentMatch[1];
|
|
388
|
+
}
|
|
389
|
+
if (previousScoreMatch && previousScoreMatch[1] && currentScoreMatch && currentScoreMatch[1]) {
|
|
390
|
+
const previousScore = parseInt(previousScoreMatch[1]);
|
|
391
|
+
const currentScore = parseInt(currentScoreMatch[1]);
|
|
392
|
+
extracted.memoryIntegration.historicalComparison = {
|
|
393
|
+
previousScore,
|
|
394
|
+
currentScore,
|
|
395
|
+
trend: currentScore > previousScore
|
|
396
|
+
? 'improving'
|
|
397
|
+
: currentScore < previousScore
|
|
398
|
+
? 'degrading'
|
|
399
|
+
: 'stable',
|
|
400
|
+
improvement: currentScore - previousScore,
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
// Extract insights
|
|
404
|
+
const insightMatches = toolOutput.matchAll(/(?:insight|recommendation|pattern)[:\s]+(.*?)(?:\n|$)/gi);
|
|
405
|
+
const insights = [];
|
|
406
|
+
for (const match of insightMatches) {
|
|
407
|
+
if (match[1]) {
|
|
408
|
+
insights.push(match[1].trim());
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
if (insights.length > 0) {
|
|
412
|
+
extracted.memoryIntegration.insights = insights;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
// Extract git push status
|
|
416
|
+
if (toolOutput.includes('git push') || toolOutput.includes('deployment allowed')) {
|
|
417
|
+
const allowedMatch = toolOutput.match(/(?:push|deployment)\s+(?:is\s+)?(allowed|blocked|conditional)/i);
|
|
418
|
+
extracted.gitPushStatus = {
|
|
419
|
+
allowed: allowedMatch && allowedMatch[1] ? allowedMatch[1].toLowerCase() === 'allowed' : false,
|
|
420
|
+
decision: allowedMatch && allowedMatch[1]
|
|
421
|
+
? allowedMatch[1].toLowerCase()
|
|
422
|
+
: 'blocked',
|
|
423
|
+
reason: allowedMatch && allowedMatch[1] ? `Deployment is ${allowedMatch[1]}` : 'Status unknown',
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
// Extract emergency override
|
|
427
|
+
if (toolOutput.includes('override') || toolOutput.includes('emergency')) {
|
|
428
|
+
const activeMatch = toolOutput.match(/override[:\s]+(active|enabled|true)/i);
|
|
429
|
+
const justificationMatch = toolOutput.match(/justification[:\s]+(.*?)(?:\n|$)/i);
|
|
430
|
+
extracted.emergencyOverride = {
|
|
431
|
+
active: activeMatch ? true : false,
|
|
432
|
+
};
|
|
433
|
+
if (justificationMatch && justificationMatch[1]) {
|
|
434
|
+
extracted.emergencyOverride.justification = justificationMatch[1].trim();
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
return extracted;
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Generate basic deployment status (fallback)
|
|
441
|
+
*/
|
|
442
|
+
async function generateBasicDeploymentStatus() {
|
|
443
|
+
// Gather deployment information
|
|
444
|
+
const [gitInfo, version, checks, dependencies, buildInfo] = await Promise.all([
|
|
445
|
+
getGitInfo(),
|
|
446
|
+
getPackageVersion(),
|
|
447
|
+
runDeploymentChecks(),
|
|
448
|
+
checkDependencies(),
|
|
449
|
+
getBuildInfo(),
|
|
450
|
+
]);
|
|
451
|
+
const deploymentReadiness = calculateDeploymentReadiness(checks, dependencies);
|
|
452
|
+
// Determine overall status
|
|
453
|
+
let status = 'unknown';
|
|
454
|
+
if (deploymentReadiness.blockers.length > 0) {
|
|
455
|
+
status = 'failed';
|
|
456
|
+
}
|
|
457
|
+
else if (deploymentReadiness.warnings.length > 0) {
|
|
458
|
+
status = 'degraded';
|
|
459
|
+
}
|
|
460
|
+
else if (checks.every(c => c.status === 'passed')) {
|
|
461
|
+
status = 'healthy';
|
|
462
|
+
}
|
|
463
|
+
return {
|
|
464
|
+
environment: process.env['NODE_ENV'] || 'development',
|
|
465
|
+
version,
|
|
466
|
+
branch: gitInfo.branch,
|
|
467
|
+
commit: gitInfo.commit,
|
|
468
|
+
commitMessage: gitInfo.commitMessage,
|
|
469
|
+
lastDeploy: new Date().toISOString(),
|
|
470
|
+
status,
|
|
471
|
+
checks,
|
|
472
|
+
dependencies,
|
|
473
|
+
buildInfo,
|
|
474
|
+
deploymentReadiness,
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Generate comprehensive deployment status using deployment-readiness-tool
|
|
479
|
+
*/
|
|
480
|
+
async function generateComprehensiveDeploymentStatus(operation, targetEnvironment, enableMemory, strictMode) {
|
|
481
|
+
try {
|
|
482
|
+
// Import the comprehensive tool
|
|
483
|
+
const { deploymentReadiness } = await import('../tools/deployment-readiness-tool.js');
|
|
484
|
+
// Call the tool with appropriate parameters
|
|
485
|
+
const toolResult = await deploymentReadiness({
|
|
486
|
+
operation,
|
|
487
|
+
projectPath: process.cwd(),
|
|
488
|
+
targetEnvironment,
|
|
489
|
+
strictMode,
|
|
490
|
+
enableMemoryIntegration: enableMemory,
|
|
491
|
+
autoCreateTodos: false, // Don't create todos from resource calls
|
|
492
|
+
integrateSandboxing: false,
|
|
493
|
+
blockGitPush: false, // Resource is read-only, don't block operations
|
|
494
|
+
});
|
|
495
|
+
// Extract text content from tool result
|
|
496
|
+
let toolOutputText = '';
|
|
497
|
+
if (toolResult.content && Array.isArray(toolResult.content)) {
|
|
498
|
+
for (const item of toolResult.content) {
|
|
499
|
+
if (item.type === 'text' && item.text) {
|
|
500
|
+
toolOutputText += item.text + '\n';
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
// Get basic data
|
|
505
|
+
const basicStatus = await generateBasicDeploymentStatus();
|
|
506
|
+
// Extract enhanced data from tool output
|
|
507
|
+
const enhancedData = extractDeploymentDataFromToolOutput(toolOutputText);
|
|
508
|
+
// Merge basic and enhanced data
|
|
509
|
+
const comprehensiveStatus = {
|
|
510
|
+
...basicStatus,
|
|
511
|
+
...enhancedData,
|
|
512
|
+
analysisMetadata: {
|
|
513
|
+
operation,
|
|
514
|
+
timestamp: new Date().toISOString(),
|
|
515
|
+
confidence: 0.95,
|
|
516
|
+
source: 'comprehensive-tool',
|
|
517
|
+
memoryIntegration: enableMemory,
|
|
518
|
+
strictMode,
|
|
519
|
+
},
|
|
520
|
+
};
|
|
521
|
+
return comprehensiveStatus;
|
|
522
|
+
}
|
|
523
|
+
catch (error) {
|
|
524
|
+
console.error('[deployment-status-resource] Tool execution failed, falling back to basic status:', error);
|
|
525
|
+
return generateBasicDeploymentStatus();
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Generate comprehensive deployment status resource with readiness analysis and quality gates.
|
|
530
|
+
*
|
|
531
|
+
* Performs multi-dimensional deployment readiness assessment including code quality validation,
|
|
532
|
+
* test execution, dependency health, ADR compliance, deployment history analysis, and optional
|
|
533
|
+
* memory-based pattern recognition for predictive insights.
|
|
534
|
+
*
|
|
535
|
+
* **Query Parameters:**
|
|
536
|
+
* - `operation`: Operation type (default: "check_readiness")
|
|
537
|
+
* - `environment`: Target deployment environment (default: process.env.NODE_ENV || "production")
|
|
538
|
+
* - `memory`: Enable memory integration for historical analysis (default: true)
|
|
539
|
+
* - `strict`: Enable strict zero-tolerance mode (default: true)
|
|
540
|
+
* - `comprehensive`: Use comprehensive analysis vs basic (default: true)
|
|
541
|
+
*
|
|
542
|
+
* **Comprehensive Mode includes:**
|
|
543
|
+
* - TreeSitter AST-based code quality analysis with production code scoring
|
|
544
|
+
* - Zero-tolerance test validation with detailed failure tracking
|
|
545
|
+
* - Deployment history analysis with trend detection
|
|
546
|
+
* - ADR compliance validation
|
|
547
|
+
* - Memory-based pattern analysis and insights
|
|
548
|
+
* - Critical blocker identification with auto-fix suggestions
|
|
549
|
+
* - Git push allow/block decision logic
|
|
550
|
+
*
|
|
551
|
+
* @param _params - URL path parameters (currently unused, reserved for future routing)
|
|
552
|
+
* @param searchParams - URL query parameters controlling analysis behavior
|
|
553
|
+
*
|
|
554
|
+
* @returns Promise resolving to resource generation result containing:
|
|
555
|
+
* - data: Complete deployment status with health metrics and quality gates
|
|
556
|
+
* - contentType: "application/json"
|
|
557
|
+
* - lastModified: ISO timestamp of generation
|
|
558
|
+
* - cacheKey: Unique identifier based on operation/environment/options
|
|
559
|
+
* - ttl: Cache duration (180 seconds / 3 minutes)
|
|
560
|
+
* - etag: Entity tag for cache validation
|
|
561
|
+
*
|
|
562
|
+
* @throws {McpAdrError} When deployment status generation fails due to:
|
|
563
|
+
* - Invalid operation or environment parameters
|
|
564
|
+
* - Deployment-readiness-tool execution failure
|
|
565
|
+
* - Test execution failures (in strict mode)
|
|
566
|
+
* - Cache operation errors
|
|
567
|
+
*
|
|
568
|
+
* @example
|
|
569
|
+
* ```typescript
|
|
570
|
+
* // Basic usage with comprehensive analysis
|
|
571
|
+
* const status = await generateDeploymentStatusResource(
|
|
572
|
+
* {},
|
|
573
|
+
* new URLSearchParams('operation=check_readiness&environment=production')
|
|
574
|
+
* );
|
|
575
|
+
*
|
|
576
|
+
* console.log(`Status: ${status.data.status}`);
|
|
577
|
+
* console.log(`Readiness score: ${status.data.deploymentReadiness.score}`);
|
|
578
|
+
* console.log(`Blockers: ${status.data.deploymentReadiness.blockers.length}`);
|
|
579
|
+
*
|
|
580
|
+
* // Check if deployment is allowed
|
|
581
|
+
* if (status.data.gitPushStatus?.decision === 'blocked') {
|
|
582
|
+
* console.error(`Deployment blocked: ${status.data.gitPushStatus.reason}`);
|
|
583
|
+
* process.exit(1);
|
|
584
|
+
* }
|
|
585
|
+
*
|
|
586
|
+
* // Example with basic mode (faster, less detailed)
|
|
587
|
+
* const basicStatus = await generateDeploymentStatusResource(
|
|
588
|
+
* {},
|
|
589
|
+
* new URLSearchParams('comprehensive=false&memory=false')
|
|
590
|
+
* );
|
|
591
|
+
*
|
|
592
|
+
* // Expected output structure:
|
|
593
|
+
* {
|
|
594
|
+
* data: {
|
|
595
|
+
* environment: "production",
|
|
596
|
+
* status: "healthy",
|
|
597
|
+
* version: "2.0.22",
|
|
598
|
+
* deploymentReadiness: {
|
|
599
|
+
* score: 95,
|
|
600
|
+
* blockers: [],
|
|
601
|
+
* warnings: ["Minor test coverage gaps"],
|
|
602
|
+
* recommendations: ["Increase integration test coverage"]
|
|
603
|
+
* },
|
|
604
|
+
* codeQualityAnalysis: {
|
|
605
|
+
* overallScore: 92,
|
|
606
|
+
* productionCodeScore: 95,
|
|
607
|
+
* qualityGates: [...]
|
|
608
|
+
* },
|
|
609
|
+
* testValidation: {
|
|
610
|
+
* testExecutionResult: "passed",
|
|
611
|
+
* totalTests: 150,
|
|
612
|
+
* passedTests: 150,
|
|
613
|
+
* failedTests: 0,
|
|
614
|
+
* coverage: 85
|
|
615
|
+
* },
|
|
616
|
+
* gitPushStatus: {
|
|
617
|
+
* allowed: true,
|
|
618
|
+
* decision: "allowed",
|
|
619
|
+
* reason: "All quality gates passed"
|
|
620
|
+
* }
|
|
621
|
+
* },
|
|
622
|
+
* contentType: "application/json",
|
|
623
|
+
* cacheKey: "deployment-status:check_readiness:production:true:true:true",
|
|
624
|
+
* ttl: 180
|
|
625
|
+
* }
|
|
626
|
+
* ```
|
|
627
|
+
*
|
|
628
|
+
* @since v2.0.0
|
|
629
|
+
* @see {@link deploymentReadiness} tool for underlying analysis engine
|
|
630
|
+
* @see {@link generateDeploymentHistoryResource} for historical deployment data
|
|
631
|
+
*/
|
|
632
|
+
export async function generateDeploymentStatusResource(_params, searchParams) {
|
|
633
|
+
// Extract query parameters
|
|
634
|
+
const operation = searchParams?.get('operation') || 'check_readiness';
|
|
635
|
+
const targetEnvironment = searchParams?.get('environment') || process.env['NODE_ENV'] || 'production';
|
|
636
|
+
const enableMemory = searchParams?.get('memory') !== 'false';
|
|
637
|
+
const strictMode = searchParams?.get('strict') !== 'false';
|
|
638
|
+
const useComprehensive = searchParams?.get('comprehensive') !== 'false';
|
|
639
|
+
const cacheKey = `deployment-status:${operation}:${targetEnvironment}:${enableMemory}:${strictMode}:${useComprehensive}`;
|
|
640
|
+
// Check cache
|
|
641
|
+
const cached = await resourceCache.get(cacheKey);
|
|
642
|
+
if (cached) {
|
|
643
|
+
return cached;
|
|
644
|
+
}
|
|
645
|
+
// Generate deployment status (comprehensive or basic)
|
|
646
|
+
let deploymentStatus;
|
|
647
|
+
if (useComprehensive) {
|
|
648
|
+
deploymentStatus = await generateComprehensiveDeploymentStatus(operation, targetEnvironment, enableMemory, strictMode);
|
|
649
|
+
}
|
|
650
|
+
else {
|
|
651
|
+
deploymentStatus = await generateBasicDeploymentStatus();
|
|
652
|
+
}
|
|
653
|
+
const result = {
|
|
654
|
+
data: deploymentStatus,
|
|
655
|
+
contentType: 'application/json',
|
|
656
|
+
lastModified: new Date().toISOString(),
|
|
657
|
+
cacheKey,
|
|
658
|
+
ttl: 60, // 1 minute cache (deployment status changes frequently)
|
|
659
|
+
etag: generateETag(deploymentStatus),
|
|
660
|
+
};
|
|
661
|
+
// Cache result
|
|
662
|
+
resourceCache.set(cacheKey, result, result.ttl);
|
|
663
|
+
return result;
|
|
664
|
+
}
|
|
665
|
+
//# sourceMappingURL=deployment-status-resource.js.map
|