mcp-adr-analysis-server 2.1.20 → 2.1.27
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 +63 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/src/config/ai-config.d.ts +54 -6
- package/dist/src/config/ai-config.d.ts.map +1 -1
- package/dist/src/config/ai-config.js +69 -6
- package/dist/src/config/ai-config.js.map +1 -1
- package/dist/src/config/ape-descriptions.d.ts +77 -0
- package/dist/src/config/ape-descriptions.d.ts.map +1 -0
- package/dist/src/config/ape-descriptions.js +177 -0
- package/dist/src/config/ape-descriptions.js.map +1 -0
- package/dist/src/index.d.ts +40 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +934 -8
- package/dist/src/index.js.map +1 -1
- package/dist/src/prompts/adr-suggestion-prompts.d.ts +5 -0
- package/dist/src/prompts/adr-suggestion-prompts.d.ts.map +1 -1
- package/dist/src/prompts/adr-suggestion-prompts.js +22 -1
- package/dist/src/prompts/adr-suggestion-prompts.js.map +1 -1
- package/dist/src/prompts/prompt-catalog.d.ts +95 -0
- package/dist/src/prompts/prompt-catalog.d.ts.map +1 -0
- package/dist/src/prompts/prompt-catalog.js +300 -0
- package/dist/src/prompts/prompt-catalog.js.map +1 -0
- package/dist/src/resources/adrs-discovered-resource.d.ts +124 -0
- package/dist/src/resources/adrs-discovered-resource.d.ts.map +1 -0
- package/dist/src/resources/adrs-discovered-resource.js +174 -0
- package/dist/src/resources/adrs-discovered-resource.js.map +1 -0
- package/dist/src/resources/adrs-review-resource.d.ts +82 -0
- package/dist/src/resources/adrs-review-resource.d.ts.map +1 -0
- package/dist/src/resources/adrs-review-resource.js +160 -0
- package/dist/src/resources/adrs-review-resource.js.map +1 -0
- package/dist/src/resources/architectural-context-resource.d.ts +95 -0
- package/dist/src/resources/architectural-context-resource.d.ts.map +1 -0
- package/dist/src/resources/architectural-context-resource.js +428 -0
- package/dist/src/resources/architectural-context-resource.js.map +1 -0
- package/dist/src/resources/conversation-snapshot-resource.d.ts +92 -0
- package/dist/src/resources/conversation-snapshot-resource.d.ts.map +1 -0
- package/dist/src/resources/conversation-snapshot-resource.js +122 -0
- package/dist/src/resources/conversation-snapshot-resource.js.map +1 -0
- package/dist/src/resources/deployment-status-resource.js +1 -1
- package/dist/src/resources/deployment-status-resource.js.map +1 -1
- package/dist/src/resources/environment-analysis-resource.js +1 -1
- package/dist/src/resources/environment-analysis-resource.js.map +1 -1
- package/dist/src/resources/knowledge-graph-resource.d.ts +129 -0
- package/dist/src/resources/knowledge-graph-resource.d.ts.map +1 -0
- package/dist/src/resources/knowledge-graph-resource.js +217 -0
- package/dist/src/resources/knowledge-graph-resource.js.map +1 -0
- package/dist/src/resources/memory-expand-resource.d.ts +90 -0
- package/dist/src/resources/memory-expand-resource.d.ts.map +1 -0
- package/dist/src/resources/memory-expand-resource.js +176 -0
- package/dist/src/resources/memory-expand-resource.js.map +1 -0
- package/dist/src/resources/memory-stats-resource.d.ts +77 -0
- package/dist/src/resources/memory-stats-resource.d.ts.map +1 -0
- package/dist/src/resources/memory-stats-resource.js +108 -0
- package/dist/src/resources/memory-stats-resource.js.map +1 -0
- package/dist/src/resources/project-metrics-resource.js +1 -1
- package/dist/src/resources/project-metrics-resource.js.map +1 -1
- package/dist/src/resources/resource-cache.d.ts.map +1 -1
- package/dist/src/resources/resource-cache.js +2 -1
- package/dist/src/resources/resource-cache.js.map +1 -1
- package/dist/src/resources/server-context-resource.d.ts +69 -0
- package/dist/src/resources/server-context-resource.d.ts.map +1 -0
- package/dist/src/resources/server-context-resource.js +104 -0
- package/dist/src/resources/server-context-resource.js.map +1 -0
- package/dist/src/resources/tool-catalog-resource.d.ts +122 -0
- package/dist/src/resources/tool-catalog-resource.d.ts.map +1 -0
- package/dist/src/resources/tool-catalog-resource.js +167 -0
- package/dist/src/resources/tool-catalog-resource.js.map +1 -0
- package/dist/src/tools/adr-aggregator-tools.d.ts +185 -0
- package/dist/src/tools/adr-aggregator-tools.d.ts.map +1 -0
- package/dist/src/tools/adr-aggregator-tools.js +872 -0
- package/dist/src/tools/adr-aggregator-tools.js.map +1 -0
- package/dist/src/tools/adr-bootstrap-validation-tool.d.ts.map +1 -1
- package/dist/src/tools/adr-bootstrap-validation-tool.js +7 -6
- package/dist/src/tools/adr-bootstrap-validation-tool.js.map +1 -1
- package/dist/src/tools/adr-suggestion-tool.d.ts +5 -0
- package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -1
- package/dist/src/tools/adr-suggestion-tool.js +40 -71
- package/dist/src/tools/adr-suggestion-tool.js.map +1 -1
- package/dist/src/tools/analyze-gaps-tool.d.ts +57 -0
- package/dist/src/tools/analyze-gaps-tool.d.ts.map +1 -0
- package/dist/src/tools/analyze-gaps-tool.js +727 -0
- package/dist/src/tools/analyze-gaps-tool.js.map +1 -0
- package/dist/src/tools/bootstrap-validation-loop-tool.d.ts +23 -1
- package/dist/src/tools/bootstrap-validation-loop-tool.d.ts.map +1 -1
- package/dist/src/tools/bootstrap-validation-loop-tool.js +15 -5
- package/dist/src/tools/bootstrap-validation-loop-tool.js.map +1 -1
- package/dist/src/tools/ce-mcp-tools.d.ts +291 -0
- package/dist/src/tools/ce-mcp-tools.d.ts.map +1 -0
- package/dist/src/tools/ce-mcp-tools.js +1188 -0
- package/dist/src/tools/ce-mcp-tools.js.map +1 -0
- package/dist/src/tools/content-masking-tool.d.ts +11 -0
- package/dist/src/tools/content-masking-tool.d.ts.map +1 -1
- package/dist/src/tools/content-masking-tool.js +13 -6
- package/dist/src/tools/content-masking-tool.js.map +1 -1
- package/dist/src/tools/deployment-readiness-tool.d.ts +11 -0
- package/dist/src/tools/deployment-readiness-tool.d.ts.map +1 -1
- package/dist/src/tools/deployment-readiness-tool.js +10 -4
- package/dist/src/tools/deployment-readiness-tool.js.map +1 -1
- package/dist/src/tools/environment-analysis-tool.d.ts +96 -1
- package/dist/src/tools/environment-analysis-tool.d.ts.map +1 -1
- package/dist/src/tools/environment-analysis-tool.js +38 -46
- package/dist/src/tools/environment-analysis-tool.js.map +1 -1
- package/dist/src/tools/research-question-tool.d.ts.map +1 -1
- package/dist/src/tools/research-question-tool.js +3 -2
- package/dist/src/tools/research-question-tool.js.map +1 -1
- package/dist/src/tools/review-existing-adrs-tool.d.ts +5 -0
- package/dist/src/tools/review-existing-adrs-tool.d.ts.map +1 -1
- package/dist/src/tools/review-existing-adrs-tool.js +123 -42
- package/dist/src/tools/review-existing-adrs-tool.js.map +1 -1
- package/dist/src/tools/rule-generation-tool.d.ts.map +1 -1
- package/dist/src/tools/rule-generation-tool.js +3 -5
- package/dist/src/tools/rule-generation-tool.js.map +1 -1
- package/dist/src/tools/search-codebase-tool.d.ts +148 -0
- package/dist/src/tools/search-codebase-tool.d.ts.map +1 -0
- package/dist/src/tools/search-codebase-tool.js +406 -0
- package/dist/src/tools/search-codebase-tool.js.map +1 -0
- package/dist/src/tools/smart-git-push-tool-v2.js +1 -1
- package/dist/src/tools/smart-git-push-tool-v2.js.map +1 -1
- package/dist/src/tools/tool-catalog.d.ts +134 -0
- package/dist/src/tools/tool-catalog.d.ts.map +1 -0
- package/dist/src/tools/tool-catalog.js +1813 -0
- package/dist/src/tools/tool-catalog.js.map +1 -0
- package/dist/src/tools/tool-chain-orchestrator.d.ts +11 -2
- package/dist/src/tools/tool-chain-orchestrator.d.ts.map +1 -1
- package/dist/src/tools/tool-chain-orchestrator.js +11 -2
- package/dist/src/tools/tool-chain-orchestrator.js.map +1 -1
- package/dist/src/tools/tool-dispatcher.d.ts +98 -0
- package/dist/src/tools/tool-dispatcher.d.ts.map +1 -0
- package/dist/src/tools/tool-dispatcher.js +229 -0
- package/dist/src/tools/tool-dispatcher.js.map +1 -0
- package/dist/src/tools/tree-sitter-code-tools.d.ts +184 -0
- package/dist/src/tools/tree-sitter-code-tools.d.ts.map +1 -0
- package/dist/src/tools/tree-sitter-code-tools.js +642 -0
- package/dist/src/tools/tree-sitter-code-tools.js.map +1 -0
- package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts +22 -0
- package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts.map +1 -1
- package/dist/src/tools/troubleshoot-guided-workflow-tool.js +20 -3
- package/dist/src/tools/troubleshoot-guided-workflow-tool.js.map +1 -1
- package/dist/src/tools/update-knowledge-tool.d.ts +89 -0
- package/dist/src/tools/update-knowledge-tool.d.ts.map +1 -0
- package/dist/src/tools/update-knowledge-tool.js +222 -0
- package/dist/src/tools/update-knowledge-tool.js.map +1 -0
- package/dist/src/types/adr-aggregator.d.ts +692 -0
- package/dist/src/types/adr-aggregator.d.ts.map +1 -0
- package/dist/src/types/adr-aggregator.js +8 -0
- package/dist/src/types/adr-aggregator.js.map +1 -0
- package/dist/src/types/ce-mcp.d.ts +248 -0
- package/dist/src/types/ce-mcp.d.ts.map +1 -0
- package/dist/src/types/ce-mcp.js +27 -0
- package/dist/src/types/ce-mcp.js.map +1 -0
- package/dist/src/types/index.d.ts +3 -2
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/memory-entities.d.ts +48 -48
- package/dist/src/utils/adr-aggregator-client.d.ts +177 -0
- package/dist/src/utils/adr-aggregator-client.d.ts.map +1 -0
- package/dist/src/utils/adr-aggregator-client.js +396 -0
- package/dist/src/utils/adr-aggregator-client.js.map +1 -0
- package/dist/src/utils/adr-context-detector.js +1 -1
- package/dist/src/utils/adr-context-detector.js.map +1 -1
- package/dist/src/utils/adr-planning-task-integration.d.ts +260 -0
- package/dist/src/utils/adr-planning-task-integration.d.ts.map +1 -0
- package/dist/src/utils/adr-planning-task-integration.js +466 -0
- package/dist/src/utils/adr-planning-task-integration.js.map +1 -0
- package/dist/src/utils/adr-timeline-extractor.d.ts.map +1 -1
- package/dist/src/utils/adr-timeline-extractor.js +3 -2
- package/dist/src/utils/adr-timeline-extractor.js.map +1 -1
- package/dist/src/utils/ai-executor.d.ts +10 -0
- package/dist/src/utils/ai-executor.d.ts.map +1 -1
- package/dist/src/utils/ai-executor.js +14 -3
- package/dist/src/utils/ai-executor.js.map +1 -1
- package/dist/src/utils/automatic-prompt-engineering.d.ts +5 -0
- package/dist/src/utils/automatic-prompt-engineering.d.ts.map +1 -1
- package/dist/src/utils/automatic-prompt-engineering.js +10 -90
- package/dist/src/utils/automatic-prompt-engineering.js.map +1 -1
- package/dist/src/utils/bootstrap-task-integration.d.ts +214 -0
- package/dist/src/utils/bootstrap-task-integration.d.ts.map +1 -0
- package/dist/src/utils/bootstrap-task-integration.js +365 -0
- package/dist/src/utils/bootstrap-task-integration.js.map +1 -0
- package/dist/src/utils/config.d.ts +3 -0
- package/dist/src/utils/config.d.ts.map +1 -1
- package/dist/src/utils/config.js +13 -0
- package/dist/src/utils/config.js.map +1 -1
- package/dist/src/utils/dag-executor.js +1 -1
- package/dist/src/utils/dag-executor.js.map +1 -1
- package/dist/src/utils/deployment-task-integration.d.ts +260 -0
- package/dist/src/utils/deployment-task-integration.d.ts.map +1 -0
- package/dist/src/utils/deployment-task-integration.js +393 -0
- package/dist/src/utils/deployment-task-integration.js.map +1 -0
- package/dist/src/utils/dynamic-deployment-intelligence.js +1 -1
- package/dist/src/utils/dynamic-deployment-intelligence.js.map +1 -1
- package/dist/src/utils/enhanced-logging.d.ts +3 -0
- package/dist/src/utils/enhanced-logging.d.ts.map +1 -1
- package/dist/src/utils/enhanced-logging.js +9 -30
- package/dist/src/utils/enhanced-logging.js.map +1 -1
- package/dist/src/utils/environment-capability-registry.js +1 -1
- package/dist/src/utils/environment-capability-registry.js.map +1 -1
- package/dist/src/utils/file-system.d.ts.map +1 -1
- package/dist/src/utils/file-system.js +33 -3
- package/dist/src/utils/file-system.js.map +1 -1
- package/dist/src/utils/git-remote-detector.d.ts +67 -0
- package/dist/src/utils/git-remote-detector.d.ts.map +1 -0
- package/dist/src/utils/git-remote-detector.js +194 -0
- package/dist/src/utils/git-remote-detector.js.map +1 -0
- package/dist/src/utils/gitleaks-detector.js +1 -1
- package/dist/src/utils/gitleaks-detector.js.map +1 -1
- package/dist/src/utils/knowledge-graph-manager.d.ts +13 -0
- package/dist/src/utils/knowledge-graph-manager.d.ts.map +1 -1
- package/dist/src/utils/knowledge-graph-manager.js +13 -0
- package/dist/src/utils/knowledge-graph-manager.js.map +1 -1
- package/dist/src/utils/prompt-execution.d.ts +29 -1
- package/dist/src/utils/prompt-execution.d.ts.map +1 -1
- package/dist/src/utils/prompt-execution.js +29 -1
- package/dist/src/utils/prompt-execution.js.map +1 -1
- package/dist/src/utils/research-orchestrator.d.ts +87 -1
- package/dist/src/utils/research-orchestrator.d.ts.map +1 -1
- package/dist/src/utils/research-orchestrator.js +121 -17
- package/dist/src/utils/research-orchestrator.js.map +1 -1
- package/dist/src/utils/research-task-integration.d.ts +297 -0
- package/dist/src/utils/research-task-integration.d.ts.map +1 -0
- package/dist/src/utils/research-task-integration.js +449 -0
- package/dist/src/utils/research-task-integration.js.map +1 -0
- package/dist/src/utils/ripgrep-wrapper.d.ts.map +1 -1
- package/dist/src/utils/ripgrep-wrapper.js +17 -3
- package/dist/src/utils/ripgrep-wrapper.js.map +1 -1
- package/dist/src/utils/sandbox-executor.d.ts +145 -0
- package/dist/src/utils/sandbox-executor.d.ts.map +1 -0
- package/dist/src/utils/sandbox-executor.js +642 -0
- package/dist/src/utils/sandbox-executor.js.map +1 -0
- package/dist/src/utils/server-context-generator.d.ts +5 -0
- package/dist/src/utils/server-context-generator.d.ts.map +1 -1
- package/dist/src/utils/server-context-generator.js +38 -0
- package/dist/src/utils/server-context-generator.js.map +1 -1
- package/dist/src/utils/task-manager.d.ts +239 -0
- package/dist/src/utils/task-manager.d.ts.map +1 -0
- package/dist/src/utils/task-manager.js +528 -0
- package/dist/src/utils/task-manager.js.map +1 -0
- package/dist/src/utils/task-persistence.d.ts +82 -0
- package/dist/src/utils/task-persistence.d.ts.map +1 -0
- package/dist/src/utils/task-persistence.js +248 -0
- package/dist/src/utils/task-persistence.js.map +1 -0
- package/dist/src/utils/test-aware-defaults.d.ts +57 -0
- package/dist/src/utils/test-aware-defaults.d.ts.map +1 -0
- package/dist/src/utils/test-aware-defaults.js +71 -0
- package/dist/src/utils/test-aware-defaults.js.map +1 -0
- package/dist/src/utils/tree-sitter-analyzer.d.ts +42 -5
- package/dist/src/utils/tree-sitter-analyzer.d.ts.map +1 -1
- package/dist/src/utils/tree-sitter-analyzer.js +499 -17
- package/dist/src/utils/tree-sitter-analyzer.js.map +1 -1
- package/package.json +24 -19
- package/dist/src/tools/smart-git-push-tool.d.ts +0 -55
- package/dist/src/tools/smart-git-push-tool.d.ts.map +0 -1
- package/dist/src/tools/smart-git-push-tool.js +0 -1011
- package/dist/src/tools/smart-git-push-tool.js.map +0 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server Context Resource - Current server state and capabilities
|
|
3
|
+
* URI Pattern: adr://server/context
|
|
4
|
+
*/
|
|
5
|
+
import { McpAdrError } from '../types/index.js';
|
|
6
|
+
import { resourceCache, generateETag } from './resource-cache.js';
|
|
7
|
+
import { resourceRouter } from './resource-router.js';
|
|
8
|
+
/**
|
|
9
|
+
* Generate server context resource showing current state, memory, and capabilities.
|
|
10
|
+
*
|
|
11
|
+
* Returns a comprehensive markdown-formatted context that includes:
|
|
12
|
+
* - Server configuration and status
|
|
13
|
+
* - Validated deployment patterns
|
|
14
|
+
* - MCP resources catalog
|
|
15
|
+
* - Memory and knowledge graph status
|
|
16
|
+
* - Recent deployment activity
|
|
17
|
+
* - Usage recommendations
|
|
18
|
+
*
|
|
19
|
+
* **URI Pattern:** `adr://server/context`
|
|
20
|
+
*
|
|
21
|
+
* **Query Parameters:**
|
|
22
|
+
* - `includeDetailed`: Include detailed information (default: true)
|
|
23
|
+
* - `maxRecentItems`: Maximum number of recent items to show (default: 5)
|
|
24
|
+
* - `projectPath`: Override project root path (default: process.cwd())
|
|
25
|
+
*
|
|
26
|
+
* @param params - URL path parameters (none for this resource)
|
|
27
|
+
* @param searchParams - URL query parameters for customization
|
|
28
|
+
*
|
|
29
|
+
* @returns Promise resolving to resource generation result containing:
|
|
30
|
+
* - data: Server context data with markdown content
|
|
31
|
+
* - contentType: "application/json"
|
|
32
|
+
* - lastModified: ISO timestamp of generation
|
|
33
|
+
* - cacheKey: Unique identifier "server-context"
|
|
34
|
+
* - ttl: Cache duration (60 seconds / 1 minute)
|
|
35
|
+
* - etag: Entity tag for cache validation
|
|
36
|
+
*
|
|
37
|
+
* @throws {McpAdrError} When context generation fails
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* // Get server context with defaults
|
|
42
|
+
* const context = await generateServerContextResource(
|
|
43
|
+
* {},
|
|
44
|
+
* new URLSearchParams()
|
|
45
|
+
* );
|
|
46
|
+
*
|
|
47
|
+
* console.log(context.data.context); // Markdown-formatted context
|
|
48
|
+
*
|
|
49
|
+
* // Get abbreviated context
|
|
50
|
+
* const brief = await generateServerContextResource(
|
|
51
|
+
* {},
|
|
52
|
+
* new URLSearchParams('includeDetailed=false&maxRecentItems=3')
|
|
53
|
+
* );
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @since v2.2.0
|
|
57
|
+
* @see {@link ServerContextGenerator} for context generation logic
|
|
58
|
+
*/
|
|
59
|
+
export async function generateServerContextResource(_params, searchParams, kgManager, memoryManager, conversationManager) {
|
|
60
|
+
const cacheKey = 'server-context';
|
|
61
|
+
// Check cache
|
|
62
|
+
const cached = await resourceCache.get(cacheKey);
|
|
63
|
+
if (cached) {
|
|
64
|
+
return cached;
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
const includeDetailed = searchParams.get('includeDetailed') !== 'false';
|
|
68
|
+
const maxRecentItems = parseInt(searchParams.get('maxRecentItems') || '5', 10);
|
|
69
|
+
const projectPath = searchParams.get('projectPath') || process.cwd();
|
|
70
|
+
// If managers are not provided, we'll generate basic context
|
|
71
|
+
// In practice, these should be injected from the MCP server
|
|
72
|
+
if (!kgManager || !memoryManager || !conversationManager) {
|
|
73
|
+
throw new McpAdrError('Server context requires initialized managers. Access this resource through the MCP server.', 'RESOURCE_GENERATION_ERROR');
|
|
74
|
+
}
|
|
75
|
+
// Generate context using ServerContextGenerator
|
|
76
|
+
const { ServerContextGenerator: Generator } = await import('../utils/server-context-generator.js');
|
|
77
|
+
const generator = new Generator();
|
|
78
|
+
const contextContent = await generator.generateContext(kgManager, memoryManager, conversationManager, { includeDetailed, maxRecentItems });
|
|
79
|
+
const contextData = {
|
|
80
|
+
context: contextContent,
|
|
81
|
+
timestamp: new Date().toISOString(),
|
|
82
|
+
projectPath,
|
|
83
|
+
includeDetailed,
|
|
84
|
+
maxRecentItems,
|
|
85
|
+
};
|
|
86
|
+
const result = {
|
|
87
|
+
data: contextData,
|
|
88
|
+
contentType: 'application/json',
|
|
89
|
+
lastModified: new Date().toISOString(),
|
|
90
|
+
cacheKey,
|
|
91
|
+
ttl: 60, // 1 minute cache (context changes frequently)
|
|
92
|
+
etag: generateETag(contextData),
|
|
93
|
+
};
|
|
94
|
+
// Cache result
|
|
95
|
+
resourceCache.set(cacheKey, result, result.ttl);
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
throw new McpAdrError(`Failed to generate server context: ${error instanceof Error ? error.message : String(error)}`, 'RESOURCE_GENERATION_ERROR');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Register route
|
|
103
|
+
resourceRouter.register('/server/context', generateServerContextResource, 'Current server state and capabilities');
|
|
104
|
+
//# sourceMappingURL=server-context-resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-context-resource.js","sourceRoot":"","sources":["../../../src/resources/server-context-resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAA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CAAC,WAAW,EAAE;YACnC,WAAW;YACX,eAAe;YACf,cAAc;SACf,CAAC;QAEF,MAAM,MAAM,GAA6B;YACvC,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,kBAAkB;YAC/B,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACtC,QAAQ;YACR,GAAG,EAAE,EAAE,EAAE,8CAA8C;YACvD,IAAI,EAAE,YAAY,CAAC,WAAW,CAAC;SAChC,CAAC;QAEF,eAAe;QACf,aAAa,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;QAEhD,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,WAAW,CACnB,sCAAsC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAC9F,2BAA2B,CAC5B,CAAC;IACJ,CAAC;AACH,CAAC;AAED,iBAAiB;AACjB,cAAc,CAAC,QAAQ,CACrB,iBAAiB,EACjB,6BAA6B,EAC7B,uCAAuC,CACxC,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Catalog Resource - Comprehensive tool metadata registry
|
|
3
|
+
* URI Pattern: adr://tools/catalog
|
|
4
|
+
*/
|
|
5
|
+
import { URLSearchParams } from 'url';
|
|
6
|
+
import { ResourceGenerationResult } from './index.js';
|
|
7
|
+
export interface ToolCatalogData {
|
|
8
|
+
summary: {
|
|
9
|
+
totalTools: number;
|
|
10
|
+
byCategory: Record<string, number>;
|
|
11
|
+
cemcpEnabled: number;
|
|
12
|
+
highTokenCost: number;
|
|
13
|
+
};
|
|
14
|
+
tools: Array<{
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
category: string;
|
|
18
|
+
complexity: string;
|
|
19
|
+
tokenCost: {
|
|
20
|
+
min: number;
|
|
21
|
+
max: number;
|
|
22
|
+
};
|
|
23
|
+
hasCEMCPDirective: boolean;
|
|
24
|
+
requiresAI: boolean;
|
|
25
|
+
relatedTools: string[];
|
|
26
|
+
keywords: string[];
|
|
27
|
+
}>;
|
|
28
|
+
timestamp: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Generate tool catalog resource with comprehensive tool metadata.
|
|
32
|
+
*
|
|
33
|
+
* Returns a complete catalog of all available MCP tools with:
|
|
34
|
+
* - Tool metadata (name, description, category, complexity)
|
|
35
|
+
* - Token cost estimates and CE-MCP availability
|
|
36
|
+
* - Related tools and keyword tags
|
|
37
|
+
* - Summary statistics by category
|
|
38
|
+
*
|
|
39
|
+
* **URI Pattern:** `adr://tools/catalog`
|
|
40
|
+
*
|
|
41
|
+
* **Query Parameters:**
|
|
42
|
+
* - `category`: Filter by tool category (optional)
|
|
43
|
+
* - `includeSchema`: Include full input schemas (default: false)
|
|
44
|
+
* - `lightweight`: Return minimal metadata only (default: false)
|
|
45
|
+
*
|
|
46
|
+
* @param params - URL path parameters (none for this resource)
|
|
47
|
+
* @param searchParams - URL query parameters for filtering
|
|
48
|
+
*
|
|
49
|
+
* @returns Promise resolving to resource generation result containing:
|
|
50
|
+
* - data: Complete tool catalog with metadata
|
|
51
|
+
* - contentType: "application/json"
|
|
52
|
+
* - lastModified: ISO timestamp of generation
|
|
53
|
+
* - cacheKey: Unique identifier "tool-catalog" or "tool-catalog:{category}"
|
|
54
|
+
* - ttl: Cache duration (300 seconds / 5 minutes)
|
|
55
|
+
* - etag: Entity tag for cache validation
|
|
56
|
+
*
|
|
57
|
+
* @throws {McpAdrError} When catalog generation fails
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* // Get full tool catalog
|
|
62
|
+
* const catalog = await generateToolCatalogResource(
|
|
63
|
+
* {},
|
|
64
|
+
* new URLSearchParams()
|
|
65
|
+
* );
|
|
66
|
+
*
|
|
67
|
+
* console.log(`Total tools: ${catalog.data.summary.totalTools}`);
|
|
68
|
+
* console.log(`CE-MCP enabled: ${catalog.data.summary.cemcpEnabled}`);
|
|
69
|
+
*
|
|
70
|
+
* // Filter by category
|
|
71
|
+
* const adrTools = await generateToolCatalogResource(
|
|
72
|
+
* {},
|
|
73
|
+
* new URLSearchParams('category=adr')
|
|
74
|
+
* );
|
|
75
|
+
*
|
|
76
|
+
* // Get lightweight catalog (minimal metadata)
|
|
77
|
+
* const lightweight = await generateToolCatalogResource(
|
|
78
|
+
* {},
|
|
79
|
+
* new URLSearchParams('lightweight=true')
|
|
80
|
+
* );
|
|
81
|
+
*
|
|
82
|
+
* // Expected output structure:
|
|
83
|
+
* {
|
|
84
|
+
* data: {
|
|
85
|
+
* summary: {
|
|
86
|
+
* totalTools: 60,
|
|
87
|
+
* byCategory: {
|
|
88
|
+
* analysis: 10,
|
|
89
|
+
* adr: 15,
|
|
90
|
+
* deployment: 8,
|
|
91
|
+
* ...
|
|
92
|
+
* },
|
|
93
|
+
* cemcpEnabled: 25,
|
|
94
|
+
* highTokenCost: 12
|
|
95
|
+
* },
|
|
96
|
+
* tools: [
|
|
97
|
+
* {
|
|
98
|
+
* name: "analyze_project_ecosystem",
|
|
99
|
+
* description: "Comprehensive project analysis...",
|
|
100
|
+
* category: "analysis",
|
|
101
|
+
* complexity: "complex",
|
|
102
|
+
* tokenCost: { min: 5000, max: 15000 },
|
|
103
|
+
* hasCEMCPDirective: true,
|
|
104
|
+
* requiresAI: true,
|
|
105
|
+
* relatedTools: ["get_architectural_context"],
|
|
106
|
+
* keywords: ["analysis", "ecosystem", "project"]
|
|
107
|
+
* },
|
|
108
|
+
* ...
|
|
109
|
+
* ],
|
|
110
|
+
* timestamp: "2025-12-16T04:30:00.000Z"
|
|
111
|
+
* },
|
|
112
|
+
* contentType: "application/json",
|
|
113
|
+
* cacheKey: "tool-catalog",
|
|
114
|
+
* ttl: 300
|
|
115
|
+
* }
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* @since v2.2.0
|
|
119
|
+
* @see {@link TOOL_CATALOG} for the underlying tool registry
|
|
120
|
+
*/
|
|
121
|
+
export declare function generateToolCatalogResource(_params: Record<string, string>, searchParams: URLSearchParams): Promise<ResourceGenerationResult>;
|
|
122
|
+
//# sourceMappingURL=tool-catalog-resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-catalog-resource.d.ts","sourceRoot":"","sources":["../../../src/resources/tool-catalog-resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAGtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAGtD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE;QACP,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACnC,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,KAAK,EAAE,KAAK,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC;QACxC,iBAAiB,EAAE,OAAO,CAAC;QAC3B,UAAU,EAAE,OAAO,CAAC;QACpB,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC,CAAC;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,YAAY,EAAE,eAAe,GAC5B,OAAO,CAAC,wBAAwB,CAAC,CAgFnC"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Catalog Resource - Comprehensive tool metadata registry
|
|
3
|
+
* URI Pattern: adr://tools/catalog
|
|
4
|
+
*/
|
|
5
|
+
import { McpAdrError } from '../types/index.js';
|
|
6
|
+
import { resourceCache, generateETag } from './resource-cache.js';
|
|
7
|
+
import { resourceRouter } from './resource-router.js';
|
|
8
|
+
/**
|
|
9
|
+
* Generate tool catalog resource with comprehensive tool metadata.
|
|
10
|
+
*
|
|
11
|
+
* Returns a complete catalog of all available MCP tools with:
|
|
12
|
+
* - Tool metadata (name, description, category, complexity)
|
|
13
|
+
* - Token cost estimates and CE-MCP availability
|
|
14
|
+
* - Related tools and keyword tags
|
|
15
|
+
* - Summary statistics by category
|
|
16
|
+
*
|
|
17
|
+
* **URI Pattern:** `adr://tools/catalog`
|
|
18
|
+
*
|
|
19
|
+
* **Query Parameters:**
|
|
20
|
+
* - `category`: Filter by tool category (optional)
|
|
21
|
+
* - `includeSchema`: Include full input schemas (default: false)
|
|
22
|
+
* - `lightweight`: Return minimal metadata only (default: false)
|
|
23
|
+
*
|
|
24
|
+
* @param params - URL path parameters (none for this resource)
|
|
25
|
+
* @param searchParams - URL query parameters for filtering
|
|
26
|
+
*
|
|
27
|
+
* @returns Promise resolving to resource generation result containing:
|
|
28
|
+
* - data: Complete tool catalog with metadata
|
|
29
|
+
* - contentType: "application/json"
|
|
30
|
+
* - lastModified: ISO timestamp of generation
|
|
31
|
+
* - cacheKey: Unique identifier "tool-catalog" or "tool-catalog:{category}"
|
|
32
|
+
* - ttl: Cache duration (300 seconds / 5 minutes)
|
|
33
|
+
* - etag: Entity tag for cache validation
|
|
34
|
+
*
|
|
35
|
+
* @throws {McpAdrError} When catalog generation fails
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* // Get full tool catalog
|
|
40
|
+
* const catalog = await generateToolCatalogResource(
|
|
41
|
+
* {},
|
|
42
|
+
* new URLSearchParams()
|
|
43
|
+
* );
|
|
44
|
+
*
|
|
45
|
+
* console.log(`Total tools: ${catalog.data.summary.totalTools}`);
|
|
46
|
+
* console.log(`CE-MCP enabled: ${catalog.data.summary.cemcpEnabled}`);
|
|
47
|
+
*
|
|
48
|
+
* // Filter by category
|
|
49
|
+
* const adrTools = await generateToolCatalogResource(
|
|
50
|
+
* {},
|
|
51
|
+
* new URLSearchParams('category=adr')
|
|
52
|
+
* );
|
|
53
|
+
*
|
|
54
|
+
* // Get lightweight catalog (minimal metadata)
|
|
55
|
+
* const lightweight = await generateToolCatalogResource(
|
|
56
|
+
* {},
|
|
57
|
+
* new URLSearchParams('lightweight=true')
|
|
58
|
+
* );
|
|
59
|
+
*
|
|
60
|
+
* // Expected output structure:
|
|
61
|
+
* {
|
|
62
|
+
* data: {
|
|
63
|
+
* summary: {
|
|
64
|
+
* totalTools: 60,
|
|
65
|
+
* byCategory: {
|
|
66
|
+
* analysis: 10,
|
|
67
|
+
* adr: 15,
|
|
68
|
+
* deployment: 8,
|
|
69
|
+
* ...
|
|
70
|
+
* },
|
|
71
|
+
* cemcpEnabled: 25,
|
|
72
|
+
* highTokenCost: 12
|
|
73
|
+
* },
|
|
74
|
+
* tools: [
|
|
75
|
+
* {
|
|
76
|
+
* name: "analyze_project_ecosystem",
|
|
77
|
+
* description: "Comprehensive project analysis...",
|
|
78
|
+
* category: "analysis",
|
|
79
|
+
* complexity: "complex",
|
|
80
|
+
* tokenCost: { min: 5000, max: 15000 },
|
|
81
|
+
* hasCEMCPDirective: true,
|
|
82
|
+
* requiresAI: true,
|
|
83
|
+
* relatedTools: ["get_architectural_context"],
|
|
84
|
+
* keywords: ["analysis", "ecosystem", "project"]
|
|
85
|
+
* },
|
|
86
|
+
* ...
|
|
87
|
+
* ],
|
|
88
|
+
* timestamp: "2025-12-16T04:30:00.000Z"
|
|
89
|
+
* },
|
|
90
|
+
* contentType: "application/json",
|
|
91
|
+
* cacheKey: "tool-catalog",
|
|
92
|
+
* ttl: 300
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @since v2.2.0
|
|
97
|
+
* @see {@link TOOL_CATALOG} for the underlying tool registry
|
|
98
|
+
*/
|
|
99
|
+
export async function generateToolCatalogResource(_params, searchParams) {
|
|
100
|
+
const category = searchParams.get('category');
|
|
101
|
+
const includeSchema = searchParams.get('includeSchema') === 'true';
|
|
102
|
+
const lightweight = searchParams.get('lightweight') === 'true';
|
|
103
|
+
const cacheKey = category ? `tool-catalog:${category}` : 'tool-catalog';
|
|
104
|
+
// Check cache
|
|
105
|
+
const cached = await resourceCache.get(cacheKey);
|
|
106
|
+
if (cached) {
|
|
107
|
+
return cached;
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
// Dynamically import the tool catalog to avoid circular dependencies
|
|
111
|
+
const { getCatalogSummary, searchTools } = await import('../tools/tool-catalog.js');
|
|
112
|
+
// Get summary statistics
|
|
113
|
+
const summary = getCatalogSummary();
|
|
114
|
+
// Get tools (filtered by category if specified)
|
|
115
|
+
const searchResult = category
|
|
116
|
+
? searchTools({ category: category, includeSchema, limit: 1000 })
|
|
117
|
+
: searchTools({ includeSchema, limit: 1000 });
|
|
118
|
+
// Format tools based on lightweight flag
|
|
119
|
+
const tools = searchResult.tools.map(tool => {
|
|
120
|
+
if (lightweight) {
|
|
121
|
+
return {
|
|
122
|
+
name: tool.name,
|
|
123
|
+
description: tool.shortDescription,
|
|
124
|
+
category: tool.category,
|
|
125
|
+
hasCEMCPDirective: tool.hasCEMCPDirective,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
const formatted = {
|
|
129
|
+
name: tool.name,
|
|
130
|
+
description: tool.fullDescription,
|
|
131
|
+
category: tool.category,
|
|
132
|
+
complexity: tool.complexity,
|
|
133
|
+
tokenCost: tool.tokenCost,
|
|
134
|
+
hasCEMCPDirective: tool.hasCEMCPDirective,
|
|
135
|
+
requiresAI: tool.requiresAI,
|
|
136
|
+
relatedTools: tool.relatedTools,
|
|
137
|
+
keywords: tool.keywords,
|
|
138
|
+
};
|
|
139
|
+
if (includeSchema) {
|
|
140
|
+
formatted.inputSchema = tool.inputSchema;
|
|
141
|
+
}
|
|
142
|
+
return formatted;
|
|
143
|
+
});
|
|
144
|
+
const catalogData = {
|
|
145
|
+
summary,
|
|
146
|
+
tools,
|
|
147
|
+
timestamp: new Date().toISOString(),
|
|
148
|
+
};
|
|
149
|
+
const result = {
|
|
150
|
+
data: catalogData,
|
|
151
|
+
contentType: 'application/json',
|
|
152
|
+
lastModified: new Date().toISOString(),
|
|
153
|
+
cacheKey,
|
|
154
|
+
ttl: 300, // 5 minutes cache (catalog is relatively static)
|
|
155
|
+
etag: generateETag(catalogData),
|
|
156
|
+
};
|
|
157
|
+
// Cache result
|
|
158
|
+
resourceCache.set(cacheKey, result, result.ttl);
|
|
159
|
+
return result;
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
throw new McpAdrError(`Failed to generate tool catalog: ${error instanceof Error ? error.message : String(error)}`, 'RESOURCE_GENERATION_ERROR');
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// Register route
|
|
166
|
+
resourceRouter.register('/tools/catalog', generateToolCatalogResource, 'Comprehensive tool metadata registry');
|
|
167
|
+
//# sourceMappingURL=tool-catalog-resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-catalog-resource.js","sourceRoot":"","sources":["../../../src/resources/tool-catalog-resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE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,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,WAAW,CACnB,oCAAoC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAC5F,2BAA2B,CAC5B,CAAC;IACJ,CAAC;AACH,CAAC;AAED,iBAAiB;AACjB,cAAc,CAAC,QAAQ,CAAC,gBAAgB,EAAE,2BAA2B,EAAE,sCAAsC,CAAC,CAAC"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR Aggregator Integration Tools
|
|
3
|
+
* MCP tools for bidirectional sync with https://adraggregator.com
|
|
4
|
+
*
|
|
5
|
+
* @see NEW_FEATURE.md for API documentation
|
|
6
|
+
*/
|
|
7
|
+
import type { ToolContext } from '../types/tool-context.js';
|
|
8
|
+
import type { ImplementationStatus } from '../types/adr-aggregator.js';
|
|
9
|
+
/**
|
|
10
|
+
* Arguments for sync_to_aggregator tool
|
|
11
|
+
*/
|
|
12
|
+
export interface SyncToAggregatorArgs {
|
|
13
|
+
/** Replace all ADRs instead of incremental sync */
|
|
14
|
+
full_sync?: boolean;
|
|
15
|
+
/** Include analysis metadata in sync */
|
|
16
|
+
include_metadata?: boolean;
|
|
17
|
+
/** Include Mermaid diagrams (Pro+ tier) */
|
|
18
|
+
include_diagrams?: boolean;
|
|
19
|
+
/** Include timeline/staleness data */
|
|
20
|
+
include_timeline?: boolean;
|
|
21
|
+
/** Include security scan results */
|
|
22
|
+
include_security_scan?: boolean;
|
|
23
|
+
/** Include AST-based code links (Pro+ tier) */
|
|
24
|
+
include_code_links?: boolean;
|
|
25
|
+
/** Specific ADR paths to sync (syncs all if not provided) */
|
|
26
|
+
adr_paths?: string[];
|
|
27
|
+
/** Project path (defaults to PROJECT_PATH) */
|
|
28
|
+
projectPath?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Arguments for get_adr_context tool
|
|
32
|
+
*/
|
|
33
|
+
export interface GetAdrContextArgs {
|
|
34
|
+
/** Include Mermaid diagrams (Pro+ tier) */
|
|
35
|
+
include_diagrams?: boolean;
|
|
36
|
+
/** Include timeline data */
|
|
37
|
+
include_timeline?: boolean;
|
|
38
|
+
/** Include code links (Pro+ tier) */
|
|
39
|
+
include_code_links?: boolean;
|
|
40
|
+
/** Include research context (Pro+ tier) */
|
|
41
|
+
include_research?: boolean;
|
|
42
|
+
/** Filter by staleness level */
|
|
43
|
+
staleness_filter?: 'all' | 'fresh' | 'stale' | 'very_stale';
|
|
44
|
+
/** Knowledge graph depth (Team tier) */
|
|
45
|
+
graph_depth?: number;
|
|
46
|
+
/** Project path (defaults to PROJECT_PATH) */
|
|
47
|
+
projectPath?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Arguments for get_staleness_report tool
|
|
51
|
+
*/
|
|
52
|
+
export interface GetStalenessReportArgs {
|
|
53
|
+
/** Days threshold for staleness */
|
|
54
|
+
threshold?: number;
|
|
55
|
+
/** Project path (defaults to PROJECT_PATH) */
|
|
56
|
+
projectPath?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Arguments for get_adr_templates tool
|
|
60
|
+
*/
|
|
61
|
+
export interface GetAdrTemplatesArgs {
|
|
62
|
+
/** Domain filter (web_application, microservices, api, etc.) */
|
|
63
|
+
domain?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Arguments for get_adr_diagrams tool (Pro+ tier)
|
|
67
|
+
*/
|
|
68
|
+
export interface GetAdrDiagramsArgs {
|
|
69
|
+
/** Specific ADR path (returns all if not specified) */
|
|
70
|
+
adr_path?: string;
|
|
71
|
+
/** Project path (defaults to PROJECT_PATH) */
|
|
72
|
+
projectPath?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Arguments for validate_adr_compliance tool (Pro+ tier)
|
|
76
|
+
*/
|
|
77
|
+
export interface ValidateAdrComplianceArgs {
|
|
78
|
+
/** Specific ADR paths to validate */
|
|
79
|
+
adr_paths?: string[];
|
|
80
|
+
/** Type of validation to perform */
|
|
81
|
+
validation_type?: 'implementation' | 'architecture' | 'security' | 'all';
|
|
82
|
+
/** Project path (defaults to PROJECT_PATH) */
|
|
83
|
+
projectPath?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Arguments for get_knowledge_graph tool (Team tier)
|
|
87
|
+
*/
|
|
88
|
+
export interface GetKnowledgeGraphArgs {
|
|
89
|
+
/** Scope of the graph */
|
|
90
|
+
scope?: 'repository' | 'organization';
|
|
91
|
+
/** Include graph analytics and insights */
|
|
92
|
+
include_analytics?: boolean;
|
|
93
|
+
/** Project path (defaults to PROJECT_PATH) */
|
|
94
|
+
projectPath?: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Standard tool result format
|
|
98
|
+
*/
|
|
99
|
+
export interface ToolResult {
|
|
100
|
+
content: Array<{
|
|
101
|
+
type: 'text';
|
|
102
|
+
text: string;
|
|
103
|
+
}>;
|
|
104
|
+
isError?: boolean;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Sync ADRs to ADR Aggregator platform
|
|
108
|
+
*
|
|
109
|
+
* POST /functions/v1/mcp-sync-adr
|
|
110
|
+
*/
|
|
111
|
+
export declare function syncToAggregator(args: SyncToAggregatorArgs, context?: ToolContext): Promise<ToolResult>;
|
|
112
|
+
/**
|
|
113
|
+
* Get ADR context from aggregator
|
|
114
|
+
*
|
|
115
|
+
* GET /functions/v1/mcp-get-context
|
|
116
|
+
*/
|
|
117
|
+
export declare function getAdrContext(args: GetAdrContextArgs, context?: ToolContext): Promise<ToolResult>;
|
|
118
|
+
/**
|
|
119
|
+
* Get staleness report from aggregator
|
|
120
|
+
*
|
|
121
|
+
* GET /functions/v1/mcp-staleness-report
|
|
122
|
+
*/
|
|
123
|
+
export declare function getStalenessReport(args: GetStalenessReportArgs, context?: ToolContext): Promise<ToolResult>;
|
|
124
|
+
/**
|
|
125
|
+
* Get ADR templates from aggregator
|
|
126
|
+
*
|
|
127
|
+
* GET /functions/v1/mcp-get-templates
|
|
128
|
+
*/
|
|
129
|
+
export declare function getAdrTemplates(args: GetAdrTemplatesArgs, context?: ToolContext): Promise<ToolResult>;
|
|
130
|
+
/**
|
|
131
|
+
* Get Mermaid diagrams from aggregator (Pro+ tier)
|
|
132
|
+
*
|
|
133
|
+
* GET /functions/v1/mcp-get-diagrams
|
|
134
|
+
*/
|
|
135
|
+
export declare function getAdrDiagrams(args: GetAdrDiagramsArgs, context?: ToolContext): Promise<ToolResult>;
|
|
136
|
+
/**
|
|
137
|
+
* Validate ADR compliance via aggregator (Pro+ tier)
|
|
138
|
+
*
|
|
139
|
+
* POST /functions/v1/mcp-validate-compliance
|
|
140
|
+
*/
|
|
141
|
+
export declare function validateAdrCompliance(args: ValidateAdrComplianceArgs, context?: ToolContext): Promise<ToolResult>;
|
|
142
|
+
/**
|
|
143
|
+
* Get knowledge graph from aggregator (Team tier)
|
|
144
|
+
*
|
|
145
|
+
* GET /functions/v1/mcp-get-knowledge-graph
|
|
146
|
+
*/
|
|
147
|
+
export declare function getKnowledgeGraph(args: GetKnowledgeGraphArgs, context?: ToolContext): Promise<ToolResult>;
|
|
148
|
+
/**
|
|
149
|
+
* Arguments for update_implementation_status tool (Pro+ tier)
|
|
150
|
+
*/
|
|
151
|
+
export interface UpdateImplementationStatusArgs {
|
|
152
|
+
/** Array of status updates to apply */
|
|
153
|
+
updates: Array<{
|
|
154
|
+
/** Path to the ADR file relative to project root */
|
|
155
|
+
adr_path: string;
|
|
156
|
+
/** New implementation status */
|
|
157
|
+
implementation_status: ImplementationStatus;
|
|
158
|
+
/** Optional notes about the status change */
|
|
159
|
+
notes?: string;
|
|
160
|
+
}>;
|
|
161
|
+
/** Project path (defaults to PROJECT_PATH) */
|
|
162
|
+
projectPath?: string;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Update implementation status of synced ADRs (Pro+ tier)
|
|
166
|
+
*
|
|
167
|
+
* POST /functions/v1/mcp-update-implementation-status
|
|
168
|
+
*/
|
|
169
|
+
export declare function updateAdrImplementationStatus(args: UpdateImplementationStatusArgs, context?: ToolContext): Promise<ToolResult>;
|
|
170
|
+
/**
|
|
171
|
+
* Arguments for get_adr_priorities tool
|
|
172
|
+
*/
|
|
173
|
+
export interface GetAdrPrioritiesArgs {
|
|
174
|
+
/** Include AI-based priority recommendations */
|
|
175
|
+
include_ai?: boolean;
|
|
176
|
+
/** Project path (defaults to PROJECT_PATH) */
|
|
177
|
+
projectPath?: string;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Get ADR priorities for roadmap/backlog planning
|
|
181
|
+
*
|
|
182
|
+
* GET /functions/v1/mcp-get-priorities
|
|
183
|
+
*/
|
|
184
|
+
export declare function getAdrPriorities(args: GetAdrPrioritiesArgs, context?: ToolContext): Promise<ToolResult>;
|
|
185
|
+
//# sourceMappingURL=adr-aggregator-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adr-aggregator-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/adr-aggregator-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAO5D,OAAO,KAAK,EAUV,oBAAoB,EAErB,MAAM,4BAA4B,CAAC;AAQpC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,mDAAmD;IACnD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,2CAA2C;IAC3C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oCAAoC;IACpC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,+CAA+C;IAC/C,kBAAkB,CAAC,EAAE,OAA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