mcp-adr-analysis-server 1.1.0

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.
Files changed (131) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +608 -0
  3. package/dist/src/index.d.ts +10 -0
  4. package/dist/src/index.d.ts.map +1 -0
  5. package/dist/src/index.js +1722 -0
  6. package/dist/src/index.js.map +1 -0
  7. package/dist/src/prompts/adr-suggestion-prompts.d.ts +24 -0
  8. package/dist/src/prompts/adr-suggestion-prompts.d.ts.map +1 -0
  9. package/dist/src/prompts/adr-suggestion-prompts.js +383 -0
  10. package/dist/src/prompts/adr-suggestion-prompts.js.map +1 -0
  11. package/dist/src/prompts/analysis-prompts.d.ts +24 -0
  12. package/dist/src/prompts/analysis-prompts.d.ts.map +1 -0
  13. package/dist/src/prompts/analysis-prompts.js +489 -0
  14. package/dist/src/prompts/analysis-prompts.js.map +1 -0
  15. package/dist/src/prompts/deployment-analysis-prompts.d.ts +54 -0
  16. package/dist/src/prompts/deployment-analysis-prompts.d.ts.map +1 -0
  17. package/dist/src/prompts/deployment-analysis-prompts.js +712 -0
  18. package/dist/src/prompts/deployment-analysis-prompts.js.map +1 -0
  19. package/dist/src/prompts/environment-analysis-prompts.d.ts +34 -0
  20. package/dist/src/prompts/environment-analysis-prompts.d.ts.map +1 -0
  21. package/dist/src/prompts/environment-analysis-prompts.js +724 -0
  22. package/dist/src/prompts/environment-analysis-prompts.js.map +1 -0
  23. package/dist/src/prompts/index.d.ts +43 -0
  24. package/dist/src/prompts/index.d.ts.map +1 -0
  25. package/dist/src/prompts/index.js +384 -0
  26. package/dist/src/prompts/index.js.map +1 -0
  27. package/dist/src/prompts/research-integration-prompts.d.ts +43 -0
  28. package/dist/src/prompts/research-integration-prompts.d.ts.map +1 -0
  29. package/dist/src/prompts/research-integration-prompts.js +398 -0
  30. package/dist/src/prompts/research-integration-prompts.js.map +1 -0
  31. package/dist/src/prompts/research-question-prompts.d.ts +75 -0
  32. package/dist/src/prompts/research-question-prompts.d.ts.map +1 -0
  33. package/dist/src/prompts/research-question-prompts.js +695 -0
  34. package/dist/src/prompts/research-question-prompts.js.map +1 -0
  35. package/dist/src/prompts/rule-generation-prompts.d.ts +63 -0
  36. package/dist/src/prompts/rule-generation-prompts.d.ts.map +1 -0
  37. package/dist/src/prompts/rule-generation-prompts.js +630 -0
  38. package/dist/src/prompts/rule-generation-prompts.js.map +1 -0
  39. package/dist/src/prompts/security-prompts.d.ts +23 -0
  40. package/dist/src/prompts/security-prompts.d.ts.map +1 -0
  41. package/dist/src/prompts/security-prompts.js +287 -0
  42. package/dist/src/prompts/security-prompts.js.map +1 -0
  43. package/dist/src/resources/index.d.ts +24 -0
  44. package/dist/src/resources/index.d.ts.map +1 -0
  45. package/dist/src/resources/index.js +458 -0
  46. package/dist/src/resources/index.js.map +1 -0
  47. package/dist/src/tools/adr-suggestion-tool.d.ts +40 -0
  48. package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -0
  49. package/dist/src/tools/adr-suggestion-tool.js +338 -0
  50. package/dist/src/tools/adr-suggestion-tool.js.map +1 -0
  51. package/dist/src/tools/content-masking-tool.d.ts +52 -0
  52. package/dist/src/tools/content-masking-tool.d.ts.map +1 -0
  53. package/dist/src/tools/content-masking-tool.js +206 -0
  54. package/dist/src/tools/content-masking-tool.js.map +1 -0
  55. package/dist/src/tools/deployment-analysis-tool.d.ts +39 -0
  56. package/dist/src/tools/deployment-analysis-tool.d.ts.map +1 -0
  57. package/dist/src/tools/deployment-analysis-tool.js +310 -0
  58. package/dist/src/tools/deployment-analysis-tool.js.map +1 -0
  59. package/dist/src/tools/environment-analysis-tool.d.ts +16 -0
  60. package/dist/src/tools/environment-analysis-tool.d.ts.map +1 -0
  61. package/dist/src/tools/environment-analysis-tool.js +298 -0
  62. package/dist/src/tools/environment-analysis-tool.js.map +1 -0
  63. package/dist/src/tools/research-integration-tool.d.ts +44 -0
  64. package/dist/src/tools/research-integration-tool.d.ts.map +1 -0
  65. package/dist/src/tools/research-integration-tool.js +429 -0
  66. package/dist/src/tools/research-integration-tool.js.map +1 -0
  67. package/dist/src/tools/research-question-tool.d.ts +55 -0
  68. package/dist/src/tools/research-question-tool.d.ts.map +1 -0
  69. package/dist/src/tools/research-question-tool.js +333 -0
  70. package/dist/src/tools/research-question-tool.js.map +1 -0
  71. package/dist/src/tools/rule-generation-tool.d.ts +49 -0
  72. package/dist/src/tools/rule-generation-tool.d.ts.map +1 -0
  73. package/dist/src/tools/rule-generation-tool.js +432 -0
  74. package/dist/src/tools/rule-generation-tool.js.map +1 -0
  75. package/dist/src/types/index.d.ts +531 -0
  76. package/dist/src/types/index.d.ts.map +1 -0
  77. package/dist/src/types/index.js +129 -0
  78. package/dist/src/types/index.js.map +1 -0
  79. package/dist/src/utils/adr-suggestions.d.ts +104 -0
  80. package/dist/src/utils/adr-suggestions.d.ts.map +1 -0
  81. package/dist/src/utils/adr-suggestions.js +228 -0
  82. package/dist/src/utils/adr-suggestions.js.map +1 -0
  83. package/dist/src/utils/cache.d.ts +51 -0
  84. package/dist/src/utils/cache.d.ts.map +1 -0
  85. package/dist/src/utils/cache.js +243 -0
  86. package/dist/src/utils/cache.js.map +1 -0
  87. package/dist/src/utils/config.d.ts +65 -0
  88. package/dist/src/utils/config.d.ts.map +1 -0
  89. package/dist/src/utils/config.js +118 -0
  90. package/dist/src/utils/config.js.map +1 -0
  91. package/dist/src/utils/content-masking.d.ts +79 -0
  92. package/dist/src/utils/content-masking.d.ts.map +1 -0
  93. package/dist/src/utils/content-masking.js +203 -0
  94. package/dist/src/utils/content-masking.js.map +1 -0
  95. package/dist/src/utils/deployment-analysis.d.ts +67 -0
  96. package/dist/src/utils/deployment-analysis.d.ts.map +1 -0
  97. package/dist/src/utils/deployment-analysis.js +263 -0
  98. package/dist/src/utils/deployment-analysis.js.map +1 -0
  99. package/dist/src/utils/environment-analysis.d.ts +76 -0
  100. package/dist/src/utils/environment-analysis.d.ts.map +1 -0
  101. package/dist/src/utils/environment-analysis.js +329 -0
  102. package/dist/src/utils/environment-analysis.js.map +1 -0
  103. package/dist/src/utils/file-system.d.ts +63 -0
  104. package/dist/src/utils/file-system.d.ts.map +1 -0
  105. package/dist/src/utils/file-system.js +189 -0
  106. package/dist/src/utils/file-system.js.map +1 -0
  107. package/dist/src/utils/output-masking.d.ts +45 -0
  108. package/dist/src/utils/output-masking.d.ts.map +1 -0
  109. package/dist/src/utils/output-masking.js +200 -0
  110. package/dist/src/utils/output-masking.js.map +1 -0
  111. package/dist/src/utils/research-documentation.d.ts +58 -0
  112. package/dist/src/utils/research-documentation.d.ts.map +1 -0
  113. package/dist/src/utils/research-documentation.js +438 -0
  114. package/dist/src/utils/research-documentation.js.map +1 -0
  115. package/dist/src/utils/research-integration.d.ts +89 -0
  116. package/dist/src/utils/research-integration.d.ts.map +1 -0
  117. package/dist/src/utils/research-integration.js +432 -0
  118. package/dist/src/utils/research-integration.js.map +1 -0
  119. package/dist/src/utils/research-questions.d.ts +97 -0
  120. package/dist/src/utils/research-questions.d.ts.map +1 -0
  121. package/dist/src/utils/research-questions.js +319 -0
  122. package/dist/src/utils/research-questions.js.map +1 -0
  123. package/dist/src/utils/rule-format.d.ts +76 -0
  124. package/dist/src/utils/rule-format.d.ts.map +1 -0
  125. package/dist/src/utils/rule-format.js +257 -0
  126. package/dist/src/utils/rule-format.js.map +1 -0
  127. package/dist/src/utils/rule-generation.d.ts +86 -0
  128. package/dist/src/utils/rule-generation.d.ts.map +1 -0
  129. package/dist/src/utils/rule-generation.js +330 -0
  130. package/dist/src/utils/rule-generation.js.map +1 -0
  131. package/package.json +71 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"research-integration-tool.d.ts","sourceRoot":"","sources":["../../../src/tools/research-integration-tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EACT,SAAS,GACT,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,eAAe,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,KAAK,CAAC;QACrB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,EAAE,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC,CAAC;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,cAAc,GAAG,cAAc,GAAG,aAAa,CAAC;IACpF,gBAAgB,CAAC,EAAE,KAAK,CAAC;QACvB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;CACJ,GAAG,OAAO,CAAC,GAAG,CAAC,CAkUf;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,GAAG,CAAC,CAmEf;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;CACjD,GAAG,OAAO,CAAC,GAAG,CAAC,CA4Ef"}
@@ -0,0 +1,429 @@
1
+ /**
2
+ * MCP Tool for research integration and findings incorporation
3
+ * Implements prompt-driven research analysis and ADR impact evaluation
4
+ */
5
+ import { McpAdrError } from '../types/index.js';
6
+ /**
7
+ * Incorporate research findings into architectural decisions
8
+ */
9
+ export async function incorporateResearch(args) {
10
+ const { researchPath = 'docs/research', adrDirectory = 'docs/adrs', analysisType = 'comprehensive', existingTopics, researchTopics, adrId, updateType, researchFindings, } = args;
11
+ try {
12
+ const { monitorResearchDirectory, extractResearchTopics, evaluateResearchImpact, generateAdrUpdateSuggestions, } = await import('../utils/research-integration.js');
13
+ switch (analysisType) {
14
+ case 'monitor': {
15
+ const result = await monitorResearchDirectory(researchPath);
16
+ return {
17
+ content: [
18
+ {
19
+ type: 'text',
20
+ text: `# Research Directory Monitoring
21
+
22
+ ${result.instructions}
23
+
24
+ ## Monitoring Status
25
+ ${result.monitoringPrompt}
26
+
27
+ ## Next Steps
28
+ 1. **Extract research topics** using \`incorporate_research\` with \`analysisType: "extract_topics"\`
29
+ 2. **Evaluate ADR impact** using \`analysisType: "evaluate_impact"\`
30
+ 3. **Generate specific updates** using \`analysisType: "generate_updates"\`
31
+
32
+ ## Automation Recommendations
33
+ - Set up file system watchers for real-time monitoring
34
+ - Schedule periodic research integration reviews
35
+ - Establish research file templates and conventions
36
+ - Create notification systems for new research findings
37
+ `,
38
+ },
39
+ ],
40
+ };
41
+ }
42
+ case 'extract_topics': {
43
+ const result = await extractResearchTopics(researchPath, existingTopics);
44
+ return {
45
+ content: [
46
+ {
47
+ type: 'text',
48
+ text: `# Research Topic Extraction
49
+
50
+ ${result.instructions}
51
+
52
+ ## AI Analysis Prompt
53
+
54
+ ${result.extractionPrompt}
55
+
56
+ ## Next Steps
57
+
58
+ 1. **Submit the prompt** to an AI agent for comprehensive topic extraction
59
+ 2. **Review the extracted topics** for architectural relevance and quality
60
+ 3. **Use the topics** with \`analysisType: "evaluate_impact"\` to assess ADR implications
61
+ 4. **Store the topics** for future reference and tracking
62
+
63
+ ## Expected Output
64
+
65
+ The AI will provide:
66
+ - **Extracted Topics**: Detailed research topics with findings and evidence
67
+ - **Research Summary**: Quality assessment and completeness evaluation
68
+ - **Key Insights**: Major findings that require immediate attention
69
+ - **Recommendations**: Specific actions for incorporating research
70
+ - **Gaps**: Areas needing additional research
71
+
72
+ ## Integration Workflow
73
+
74
+ After topic extraction, proceed with impact evaluation:
75
+ \`\`\`json
76
+ {
77
+ "tool": "incorporate_research",
78
+ "args": {
79
+ "analysisType": "evaluate_impact",
80
+ "researchTopics": [extracted topics from AI response]
81
+ }
82
+ }
83
+ \`\`\`
84
+ `,
85
+ },
86
+ ],
87
+ };
88
+ }
89
+ case 'evaluate_impact': {
90
+ if (!researchTopics || researchTopics.length === 0) {
91
+ throw new McpAdrError('Research topics are required for impact evaluation. Use extract_topics first.', 'INVALID_INPUT');
92
+ }
93
+ // Convert to full ResearchTopic format
94
+ const fullResearchTopics = researchTopics.map(topic => ({
95
+ ...topic,
96
+ description: `Research topic: ${topic.title}`,
97
+ sourceFiles: [],
98
+ evidence: topic.keyFindings,
99
+ confidence: topic.relevanceScore,
100
+ lastUpdated: new Date().toISOString().split('T')[0] || '',
101
+ tags: [topic.category],
102
+ }));
103
+ const result = await evaluateResearchImpact(fullResearchTopics, adrDirectory);
104
+ return {
105
+ content: [
106
+ {
107
+ type: 'text',
108
+ text: `# Research Impact Evaluation
109
+
110
+ ${result.instructions}
111
+
112
+ ## AI Evaluation Prompt
113
+
114
+ ${result.evaluationPrompt}
115
+
116
+ ## Next Steps
117
+
118
+ 1. **Submit the prompt** to an AI agent for comprehensive impact analysis
119
+ 2. **Review the impact assessments** and prioritize based on urgency and impact level
120
+ 3. **Generate specific updates** for high-impact ADRs using \`analysisType: "generate_updates"\`
121
+ 4. **Plan implementation** of recommended changes
122
+
123
+ ## Expected Output
124
+
125
+ The AI will provide:
126
+ - **Impact Analysis**: Detailed assessment of how research affects each ADR
127
+ - **Update Recommendations**: Specific suggestions for ADR modifications
128
+ - **New ADR Suggestions**: Recommendations for new ADRs based on research
129
+ - **Deprecation Suggestions**: ADRs that should be deprecated or superseded
130
+ - **Overall Assessment**: Summary and action priorities
131
+
132
+ ## Implementation Workflow
133
+
134
+ For high-priority updates, use the update generation tool:
135
+ \`\`\`json
136
+ {
137
+ "tool": "incorporate_research",
138
+ "args": {
139
+ "analysisType": "generate_updates",
140
+ "adrId": "target-adr-id",
141
+ "updateType": "content",
142
+ "researchFindings": [relevant findings from analysis]
143
+ }
144
+ }
145
+ \`\`\`
146
+ `,
147
+ },
148
+ ],
149
+ };
150
+ }
151
+ case 'generate_updates': {
152
+ if (!adrId || !updateType || !researchFindings) {
153
+ throw new McpAdrError('ADR ID, update type, and research findings are required for update generation', 'INVALID_INPUT');
154
+ }
155
+ const result = await generateAdrUpdateSuggestions(adrId, researchFindings, updateType, adrDirectory);
156
+ return {
157
+ content: [
158
+ {
159
+ type: 'text',
160
+ text: `# ADR Update Generation
161
+
162
+ ${result.instructions}
163
+
164
+ ## AI Update Prompt
165
+
166
+ ${result.updatePrompt}
167
+
168
+ ## Next Steps
169
+
170
+ 1. **Submit the prompt** to an AI agent for detailed update suggestions
171
+ 2. **Review the proposed changes** for accuracy and completeness
172
+ 3. **Request confirmation** using the action confirmation process
173
+ 4. **Apply the updates** to the ADR file with proper version control
174
+ 5. **Notify stakeholders** of the changes and implementation plan
175
+
176
+ ## Expected Output
177
+
178
+ The AI will provide:
179
+ - **Update Suggestion**: Overall assessment and metadata
180
+ - **Proposed Changes**: Specific modifications to make
181
+ - **New Content**: Complete updated ADR content
182
+ - **Migration Guidance**: Implementation and rollback plans
183
+ - **Quality Checks**: Assessment of update quality
184
+ - **Review Recommendations**: Suggested approval process
185
+
186
+ ## Implementation Checklist
187
+
188
+ Before applying updates:
189
+ - [ ] Review all proposed changes carefully
190
+ - [ ] Verify research evidence supports changes
191
+ - [ ] Check impact on dependent systems
192
+ - [ ] Ensure proper backup and version control
193
+ - [ ] Plan stakeholder communication
194
+ - [ ] Schedule implementation timeline
195
+ `,
196
+ },
197
+ ],
198
+ };
199
+ }
200
+ case 'comprehensive': {
201
+ const monitorResult = await monitorResearchDirectory(researchPath);
202
+ const extractResult = await extractResearchTopics(researchPath, existingTopics);
203
+ return {
204
+ content: [
205
+ {
206
+ type: 'text',
207
+ text: `# Comprehensive Research Integration
208
+
209
+ This comprehensive analysis will integrate research findings into your architectural decision-making process.
210
+
211
+ ## Research Directory Status
212
+
213
+ ${monitorResult.instructions}
214
+
215
+ ## Topic Extraction Analysis
216
+
217
+ ${extractResult.instructions}
218
+
219
+ ## AI Analysis Prompt
220
+
221
+ ${extractResult.extractionPrompt}
222
+
223
+ ## Comprehensive Workflow
224
+
225
+ ### 1. **Topic Extraction** (Current Step)
226
+ Submit the prompt above to extract research topics and insights
227
+
228
+ ### 2. **Impact Evaluation**
229
+ Use the extracted topics to evaluate impact on existing ADRs:
230
+ \`\`\`json
231
+ {
232
+ "tool": "incorporate_research",
233
+ "args": {
234
+ "analysisType": "evaluate_impact",
235
+ "researchTopics": [topics from step 1]
236
+ }
237
+ }
238
+ \`\`\`
239
+
240
+ ### 3. **Update Generation**
241
+ Generate specific updates for affected ADRs:
242
+ \`\`\`json
243
+ {
244
+ "tool": "incorporate_research",
245
+ "args": {
246
+ "analysisType": "generate_updates",
247
+ "adrId": "target-adr-id",
248
+ "updateType": "content",
249
+ "researchFindings": [findings from step 2]
250
+ }
251
+ }
252
+ \`\`\`
253
+
254
+ ### 4. **Implementation**
255
+ - Review and approve proposed changes
256
+ - Apply updates with proper version control
257
+ - Communicate changes to stakeholders
258
+ - Monitor implementation results
259
+
260
+ ## Expected Outcomes
261
+
262
+ This comprehensive integration will help you:
263
+ - **Identify research insights** that impact architectural decisions
264
+ - **Prioritize ADR updates** based on research findings
265
+ - **Generate high-quality updates** with proper justification
266
+ - **Maintain architectural consistency** with latest research
267
+ - **Improve decision quality** through evidence-based updates
268
+
269
+ ## Quality Assurance
270
+
271
+ All research integration follows these principles:
272
+ - **Evidence-based**: All suggestions backed by solid research
273
+ - **Impact-assessed**: Changes prioritized by architectural impact
274
+ - **Stakeholder-aware**: Considers impact on all relevant parties
275
+ - **Version-controlled**: Maintains proper change tracking
276
+ - **Reversible**: Includes rollback plans for all changes
277
+ `,
278
+ },
279
+ ],
280
+ };
281
+ }
282
+ default:
283
+ throw new McpAdrError(`Unknown analysis type: ${analysisType}`, 'INVALID_INPUT');
284
+ }
285
+ }
286
+ catch (error) {
287
+ throw new McpAdrError(`Failed to incorporate research: ${error instanceof Error ? error.message : String(error)}`, 'RESEARCH_INTEGRATION_ERROR');
288
+ }
289
+ }
290
+ /**
291
+ * Create research template file
292
+ */
293
+ export async function createResearchTemplate(args) {
294
+ const { title, category = 'general', researchPath = 'docs/research' } = args;
295
+ try {
296
+ const { createResearchTemplate } = await import('../utils/research-integration.js');
297
+ const template = createResearchTemplate(title, category);
298
+ const filename = `${title
299
+ .toLowerCase()
300
+ .replace(/[^a-z0-9\s-]/g, '')
301
+ .replace(/\s+/g, '-')}.md`;
302
+ const fullPath = `${researchPath}/${filename}`;
303
+ return {
304
+ content: [
305
+ {
306
+ type: 'text',
307
+ text: `# Research Template Created
308
+
309
+ ## Template Details
310
+ - **Title**: ${title}
311
+ - **Category**: ${category}
312
+ - **Filename**: ${filename}
313
+ - **Full Path**: ${fullPath}
314
+
315
+ ## Template Content
316
+
317
+ \`\`\`markdown
318
+ ${template}
319
+ \`\`\`
320
+
321
+ ## Next Steps
322
+
323
+ 1. **Save the template** to the specified path: \`${fullPath}\`
324
+ 2. **Fill in the research details** following the template structure
325
+ 3. **Conduct your research** and document findings
326
+ 4. **Use the research integration tool** to analyze impact on ADRs
327
+
328
+ ## Template Sections
329
+
330
+ - **Research Question**: Define what you're investigating
331
+ - **Background**: Provide context and motivation
332
+ - **Methodology**: Describe your research approach
333
+ - **Key Findings**: Document specific discoveries with evidence
334
+ - **Implications**: Analyze architectural and technology impact
335
+ - **Recommendations**: Provide actionable suggestions
336
+ - **Related ADRs**: Link to potentially affected decisions
337
+ - **Next Steps**: Plan follow-up actions
338
+
339
+ ## Research Best Practices
340
+
341
+ - Use clear, specific research questions
342
+ - Document evidence and sources thoroughly
343
+ - Assess confidence levels for findings
344
+ - Consider architectural implications early
345
+ - Link findings to existing ADRs when relevant
346
+ - Plan for regular research reviews and updates
347
+ `,
348
+ },
349
+ ],
350
+ };
351
+ }
352
+ catch (error) {
353
+ throw new McpAdrError(`Failed to create research template: ${error instanceof Error ? error.message : String(error)}`, 'TEMPLATE_CREATION_ERROR');
354
+ }
355
+ }
356
+ /**
357
+ * Request action confirmation for research-based changes
358
+ */
359
+ export async function requestActionConfirmation(args) {
360
+ const { action, details, impact = 'medium' } = args;
361
+ try {
362
+ const { promptForActionConfirmation } = await import('../utils/research-integration.js');
363
+ const result = promptForActionConfirmation(action, details, impact);
364
+ return {
365
+ content: [
366
+ {
367
+ type: 'text',
368
+ text: `# Action Confirmation Request
369
+
370
+ ${result.instructions}
371
+
372
+ ## Confirmation Prompt
373
+
374
+ ${result.confirmationPrompt}
375
+
376
+ ## Response Required
377
+
378
+ Please provide your decision on this action:
379
+
380
+ ### Response Format
381
+ \`\`\`
382
+ DECISION: [APPROVED|REJECTED|MODIFIED|DEFERRED]
383
+
384
+ REASONING: [Your reasoning for the decision]
385
+
386
+ MODIFICATIONS: [If MODIFIED, specify required changes]
387
+
388
+ TIMELINE: [If DEFERRED, specify when to reconsider]
389
+
390
+ ADDITIONAL_REQUIREMENTS: [Any additional requirements or conditions]
391
+ \`\`\`
392
+
393
+ ### Decision Guidelines
394
+
395
+ - **APPROVED**: Action can proceed as proposed
396
+ - **REJECTED**: Action should not be implemented (provide reasoning)
397
+ - **MODIFIED**: Action needs changes before approval (specify modifications)
398
+ - **DEFERRED**: Action should be postponed (specify timeline)
399
+
400
+ ## Impact Assessment
401
+
402
+ **Impact Level**: ${impact.toUpperCase()}
403
+
404
+ ${impact === 'critical'
405
+ ? '⚠️ **CRITICAL IMPACT**: This action requires careful review and may affect multiple systems or stakeholders.'
406
+ : impact === 'high'
407
+ ? '🔶 **HIGH IMPACT**: This action should be reviewed by senior stakeholders and may require coordination.'
408
+ : impact === 'medium'
409
+ ? '🔷 **MEDIUM IMPACT**: This action requires standard review and approval processes.'
410
+ : '🔹 **LOW IMPACT**: This action has minimal risk but still requires confirmation.'}
411
+
412
+ ## Next Steps
413
+
414
+ After receiving confirmation:
415
+ 1. **Document the decision** and reasoning
416
+ 2. **Proceed with approved actions** following implementation guidelines
417
+ 3. **Apply any required modifications** before implementation
418
+ 4. **Schedule deferred actions** for future consideration
419
+ 5. **Communicate decisions** to relevant stakeholders
420
+ `,
421
+ },
422
+ ],
423
+ };
424
+ }
425
+ catch (error) {
426
+ throw new McpAdrError(`Failed to request action confirmation: ${error instanceof Error ? error.message : String(error)}`, 'CONFIRMATION_ERROR');
427
+ }
428
+ }
429
+ //# sourceMappingURL=research-integration-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"research-integration-tool.js","sourceRoot":"","sources":["../../../src/tools/research-integration-tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAwBzC;IACC,MAAM,EACJ,YAAY,GAAG,eAAe,EAC9B,YAAY,GAAG,WAAW,EAC1B,YAAY,GAAG,eAAe,EAC9B,cAAc,EACd,cAAc,EACd,KAAK,EACL,UAAU,EACV,gBAAgB,GACjB,GAAG,IAAI,CAAC;IAET,IAAI,CAAC;QACH,MAAM,EACJ,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,GAC7B,GAAG,MAAM,MAAM,CAAC,kCAAkC,CAAC,CAAC;QAErD,QAAQ,YAAY,EAAE,CAAC;YACrB,KAAK,SAAS,CAAC,CAAC,CAAC;gBACf,MAAM,MAAM,GAAG,MAAM,wBAAwB,CAAC,YAAY,CAAC,CAAC;gBAE5D,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE;;EAElB,MAAM,CAAC,YAAY;;;EAGnB,MAAM,CA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/C;IACC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC;IAEpD,IAAI,CAAC;QACH,MAAM,EAAE,2BAA2B,EAAE,GAAG,MAAM,MAAM,CAAC,kCAAkC,CAAC,CAAC;QAEzF,MAAM,MAAM,GAAG,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAEpE,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;EAEd,MAAM,CAAC,YAAY;;;;EAInB,MAAM,CAAC,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA4BP,MAAM,CAAC,WAAW,EAAE;;EAGtC,MAAM,KAAK,UAAU;wBACnB,CAAC,CAAC,8GAA8G;wBAChH,CAAC,CAAC,MAAM,KAAK,MAAM;4BACjB,CAAC,CAAC,yGAAyG;4BAC3G,CAAC,CAAC,MAAM,KAAK,QAAQ;gCACnB,CAAC,CAAC,oFAAoF;gCACtF,CAAC,CAAC,kFACV;;;;;;;;;;CAUC;iBACQ;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,WAAW,CACnB,0CAA0C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAClG,oBAAoB,CACrB,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * MCP Tool for research question generation
3
+ * Implements prompt-driven research question generation and task tracking
4
+ */
5
+ /**
6
+ * Generate research questions and create research tracking system
7
+ */
8
+ export declare function generateResearchQuestions(args: {
9
+ analysisType?: 'correlation' | 'relevance' | 'questions' | 'tracking' | 'comprehensive';
10
+ researchContext?: {
11
+ topic: string;
12
+ category: string;
13
+ scope: string;
14
+ objectives: string[];
15
+ constraints?: string[];
16
+ timeline?: string;
17
+ };
18
+ problems?: Array<{
19
+ id: string;
20
+ description: string;
21
+ category: string;
22
+ severity: string;
23
+ context: string;
24
+ }>;
25
+ knowledgeGraph?: {
26
+ technologies: any[];
27
+ patterns: any[];
28
+ adrs: any[];
29
+ relationships: any[];
30
+ };
31
+ relevantKnowledge?: {
32
+ adrs: any[];
33
+ patterns: any[];
34
+ gaps: any[];
35
+ opportunities: any[];
36
+ };
37
+ researchQuestions?: Array<{
38
+ id: string;
39
+ question: string;
40
+ type: string;
41
+ priority: string;
42
+ timeline: string;
43
+ methodology: string;
44
+ }>;
45
+ currentProgress?: Array<{
46
+ questionId: string;
47
+ status: string;
48
+ progress: number;
49
+ findings: string[];
50
+ blockers: string[];
51
+ }>;
52
+ projectPath?: string;
53
+ adrDirectory?: string;
54
+ }): Promise<any>;
55
+ //# sourceMappingURL=research-question-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"research-question-tool.d.ts","sourceRoot":"","sources":["../../../src/tools/research-question-tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,YAAY,CAAC,EAAE,aAAa,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,eAAe,CAAC;IACxF,eAAe,CAAC,EAAE;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,EAAE,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,QAAQ,CAAC,EAAE,KAAK,CAAC;QACf,EAAE,EAAE,MAAM,CAAC;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;K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