mcp-adr-analysis-server 2.0.3 → 2.0.6
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/dist/src/index.d.ts +28 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +703 -325
- package/dist/src/index.js.map +1 -1
- package/dist/src/prompts/adr-suggestion-prompts.d.ts +1 -0
- package/dist/src/prompts/adr-suggestion-prompts.d.ts.map +1 -1
- package/dist/src/prompts/adr-suggestion-prompts.js +14 -6
- package/dist/src/prompts/adr-suggestion-prompts.js.map +1 -1
- package/dist/src/resources/index.d.ts.map +1 -1
- package/dist/src/resources/index.js +31 -15
- package/dist/src/resources/index.js.map +1 -1
- package/dist/src/tools/adr-suggestion-tool.d.ts +4 -1
- package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -1
- package/dist/src/tools/adr-suggestion-tool.js +72 -114
- package/dist/src/tools/adr-suggestion-tool.js.map +1 -1
- package/dist/src/tools/content-masking-tool.d.ts +7 -0
- package/dist/src/tools/content-masking-tool.d.ts.map +1 -1
- package/dist/src/tools/content-masking-tool.js +134 -17
- package/dist/src/tools/content-masking-tool.js.map +1 -1
- package/dist/src/tools/deployment-guidance-tool.d.ts +21 -0
- package/dist/src/tools/deployment-guidance-tool.d.ts.map +1 -0
- package/dist/src/tools/deployment-guidance-tool.js +289 -0
- package/dist/src/tools/deployment-guidance-tool.js.map +1 -0
- package/dist/src/tools/environment-analysis-tool.d.ts +4 -0
- package/dist/src/tools/environment-analysis-tool.d.ts.map +1 -1
- package/dist/src/tools/environment-analysis-tool.js +209 -25
- package/dist/src/tools/environment-analysis-tool.js.map +1 -1
- package/dist/src/tools/research-question-tool.d.ts +4 -0
- package/dist/src/tools/research-question-tool.d.ts.map +1 -1
- package/dist/src/tools/research-question-tool.js +42 -4
- package/dist/src/tools/research-question-tool.js.map +1 -1
- package/dist/src/tools/rule-generation-tool.d.ts +4 -0
- package/dist/src/tools/rule-generation-tool.d.ts.map +1 -1
- package/dist/src/tools/rule-generation-tool.js +136 -16
- package/dist/src/tools/rule-generation-tool.js.map +1 -1
- package/dist/src/tools/todo-management-tool.d.ts +166 -0
- package/dist/src/tools/todo-management-tool.d.ts.map +1 -0
- package/dist/src/tools/todo-management-tool.js +472 -0
- package/dist/src/tools/todo-management-tool.js.map +1 -0
- package/dist/src/types/conversation-context.d.ts +93 -0
- package/dist/src/types/conversation-context.d.ts.map +1 -0
- package/dist/src/types/conversation-context.js +101 -0
- package/dist/src/types/conversation-context.js.map +1 -0
- package/dist/src/utils/actual-file-operations.d.ts +40 -0
- package/dist/src/utils/actual-file-operations.d.ts.map +1 -0
- package/dist/src/utils/actual-file-operations.js +309 -0
- package/dist/src/utils/actual-file-operations.js.map +1 -0
- package/dist/src/utils/adr-discovery.d.ts +36 -0
- package/dist/src/utils/adr-discovery.d.ts.map +1 -0
- package/dist/src/utils/adr-discovery.js +237 -0
- package/dist/src/utils/adr-discovery.js.map +1 -0
- package/dist/src/utils/adr-suggestions.d.ts +2 -1
- package/dist/src/utils/adr-suggestions.d.ts.map +1 -1
- package/dist/src/utils/adr-suggestions.js +8 -2
- package/dist/src/utils/adr-suggestions.js.map +1 -1
- package/dist/src/utils/apply-cot-enhancement.d.ts +46 -0
- package/dist/src/utils/apply-cot-enhancement.d.ts.map +1 -0
- package/dist/src/utils/apply-cot-enhancement.js +165 -0
- package/dist/src/utils/apply-cot-enhancement.js.map +1 -0
- package/dist/src/utils/chain-of-thought-template.d.ts +48 -0
- package/dist/src/utils/chain-of-thought-template.d.ts.map +1 -0
- package/dist/src/utils/chain-of-thought-template.js +191 -0
- package/dist/src/utils/chain-of-thought-template.js.map +1 -0
- package/dist/src/utils/deployment-analysis.d.ts +1 -0
- package/dist/src/utils/deployment-analysis.d.ts.map +1 -1
- package/dist/src/utils/deployment-analysis.js +82 -39
- package/dist/src/utils/deployment-analysis.js.map +1 -1
- package/dist/src/utils/environment-analysis.d.ts +6 -1
- package/dist/src/utils/environment-analysis.d.ts.map +1 -1
- package/dist/src/utils/environment-analysis.js +176 -87
- package/dist/src/utils/environment-analysis.js.map +1 -1
- package/dist/src/utils/file-system.d.ts +1 -0
- package/dist/src/utils/file-system.d.ts.map +1 -1
- package/dist/src/utils/file-system.js +24 -47
- package/dist/src/utils/file-system.js.map +1 -1
- package/dist/src/utils/prompt-execution.d.ts.map +1 -1
- package/dist/src/utils/prompt-execution.js +67 -3
- package/dist/src/utils/prompt-execution.js.map +1 -1
- package/dist/src/utils/research-integration.d.ts +4 -0
- package/dist/src/utils/research-integration.d.ts.map +1 -1
- package/dist/src/utils/research-integration.js +275 -84
- package/dist/src/utils/research-integration.js.map +1 -1
- package/dist/src/utils/research-questions.d.ts.map +1 -1
- package/dist/src/utils/research-questions.js +134 -38
- package/dist/src/utils/research-questions.js.map +1 -1
- package/dist/src/utils/rule-generation.d.ts +2 -1
- package/dist/src/utils/rule-generation.d.ts.map +1 -1
- package/dist/src/utils/rule-generation.js +65 -36
- package/dist/src/utils/rule-generation.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tool for TODO.md management with incremental updates and task lifecycle
|
|
3
|
+
* Provides smart merging, status tracking, and preservation of custom tasks
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { McpAdrError } from '../types/index.js';
|
|
7
|
+
// Task status enumeration
|
|
8
|
+
const TaskStatus = z.enum(['pending', 'in_progress', 'completed', 'blocked', 'cancelled']);
|
|
9
|
+
// Task priority enumeration
|
|
10
|
+
const TaskPriority = z.enum(['low', 'medium', 'high', 'critical']);
|
|
11
|
+
// Individual task schema
|
|
12
|
+
const TaskSchema = z.object({
|
|
13
|
+
id: z.string().describe('Unique task identifier'),
|
|
14
|
+
title: z.string().describe('Task title/description'),
|
|
15
|
+
status: TaskStatus.describe('Current task status'),
|
|
16
|
+
priority: TaskPriority.optional().describe('Task priority level'),
|
|
17
|
+
adrSource: z.string().optional().describe('Source ADR filename if task comes from ADR'),
|
|
18
|
+
category: z.string().optional().describe('Task category (e.g., implementation, testing, docs)'),
|
|
19
|
+
dependencies: z.array(z.string()).optional().describe('IDs of dependent tasks'),
|
|
20
|
+
notes: z.string().optional().describe('Additional task notes'),
|
|
21
|
+
createdAt: z.string().optional().describe('Task creation timestamp'),
|
|
22
|
+
updatedAt: z.string().optional().describe('Last update timestamp'),
|
|
23
|
+
estimatedHours: z.number().optional().describe('Estimated effort in hours'),
|
|
24
|
+
assignee: z.string().optional().describe('Person assigned to task')
|
|
25
|
+
});
|
|
26
|
+
// TODO file structure schema
|
|
27
|
+
const TodoStructure = z.object({
|
|
28
|
+
title: z.string().describe('TODO file title'),
|
|
29
|
+
lastUpdated: z.string().describe('Last update timestamp'),
|
|
30
|
+
summary: z.object({
|
|
31
|
+
total: z.number(),
|
|
32
|
+
completed: z.number(),
|
|
33
|
+
inProgress: z.number(),
|
|
34
|
+
pending: z.number(),
|
|
35
|
+
blocked: z.number()
|
|
36
|
+
}).describe('Task count summary'),
|
|
37
|
+
sections: z.array(z.object({
|
|
38
|
+
name: z.string().describe('Section name'),
|
|
39
|
+
tasks: z.array(TaskSchema).describe('Tasks in this section')
|
|
40
|
+
})).describe('Organized task sections'),
|
|
41
|
+
customContent: z.array(z.string()).optional().describe('Custom markdown content to preserve')
|
|
42
|
+
});
|
|
43
|
+
// Operation schemas
|
|
44
|
+
const UpdateTaskStatusSchema = z.object({
|
|
45
|
+
operation: z.literal('update_status'),
|
|
46
|
+
todoPath: z.string().default('todo.md').describe('Path to TODO.md file'),
|
|
47
|
+
updates: z.array(z.object({
|
|
48
|
+
taskId: z.string().describe('Task ID to update'),
|
|
49
|
+
status: TaskStatus.describe('New status'),
|
|
50
|
+
notes: z.string().optional().describe('Update notes'),
|
|
51
|
+
assignee: z.string().optional().describe('New assignee')
|
|
52
|
+
})).describe('Status updates to apply')
|
|
53
|
+
});
|
|
54
|
+
const AddTasksSchema = z.object({
|
|
55
|
+
operation: z.literal('add_tasks'),
|
|
56
|
+
todoPath: z.string().default('todo.md').describe('Path to TODO.md file'),
|
|
57
|
+
tasks: z.array(TaskSchema.omit({ id: true, createdAt: true, updatedAt: true })).describe('New tasks to add'),
|
|
58
|
+
section: z.string().optional().describe('Section to add tasks to (will create if not exists)')
|
|
59
|
+
});
|
|
60
|
+
const MergeAdrSchema = z.object({
|
|
61
|
+
operation: z.literal('merge_adr_updates'),
|
|
62
|
+
todoPath: z.string().default('todo.md').describe('Path to TODO.md file'),
|
|
63
|
+
adrDirectory: z.string().default('docs/adrs').describe('ADR directory path'),
|
|
64
|
+
preserveCompleted: z.boolean().default(true).describe('Keep completed tasks'),
|
|
65
|
+
preserveCustom: z.boolean().default(true).describe('Keep manually added tasks')
|
|
66
|
+
});
|
|
67
|
+
const SyncProgressSchema = z.object({
|
|
68
|
+
operation: z.literal('sync_progress'),
|
|
69
|
+
todoPath: z.string().default('todo.md').describe('Path to TODO.md file'),
|
|
70
|
+
adrDirectory: z.string().default('docs/adrs').describe('ADR directory path'),
|
|
71
|
+
updateAdrs: z.boolean().default(false).describe('Update ADR status based on TODO progress')
|
|
72
|
+
});
|
|
73
|
+
const AnalyzeProgressSchema = z.object({
|
|
74
|
+
operation: z.literal('analyze_progress'),
|
|
75
|
+
todoPath: z.string().default('todo.md').describe('Path to TODO.md file'),
|
|
76
|
+
timeframe: z.enum(['day', 'week', 'month', 'all']).default('week').describe('Analysis timeframe'),
|
|
77
|
+
includeVelocity: z.boolean().default(true).describe('Include velocity metrics')
|
|
78
|
+
});
|
|
79
|
+
// Main operation schema
|
|
80
|
+
const ManageTodoSchema = z.union([
|
|
81
|
+
UpdateTaskStatusSchema,
|
|
82
|
+
AddTasksSchema,
|
|
83
|
+
MergeAdrSchema,
|
|
84
|
+
SyncProgressSchema,
|
|
85
|
+
AnalyzeProgressSchema
|
|
86
|
+
]);
|
|
87
|
+
/**
|
|
88
|
+
* Parse TODO.md file into structured format
|
|
89
|
+
*/
|
|
90
|
+
async function parseTodoFile(todoPath) {
|
|
91
|
+
try {
|
|
92
|
+
const fs = await import('fs/promises');
|
|
93
|
+
const content = await fs.readFile(todoPath, 'utf-8');
|
|
94
|
+
const lines = content.split('\n');
|
|
95
|
+
const structure = {
|
|
96
|
+
title: 'TODO Management',
|
|
97
|
+
lastUpdated: new Date().toISOString(),
|
|
98
|
+
summary: { total: 0, completed: 0, inProgress: 0, pending: 0, blocked: 0 },
|
|
99
|
+
sections: [],
|
|
100
|
+
customContent: []
|
|
101
|
+
};
|
|
102
|
+
let currentSection = null;
|
|
103
|
+
let taskIdCounter = 1;
|
|
104
|
+
for (const line of lines) {
|
|
105
|
+
const trimmed = line.trim();
|
|
106
|
+
// Extract title
|
|
107
|
+
if (trimmed.startsWith('# ') && !structure.title) {
|
|
108
|
+
structure.title = trimmed.substring(2);
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
// Extract sections
|
|
112
|
+
if (trimmed.startsWith('## ')) {
|
|
113
|
+
if (currentSection) {
|
|
114
|
+
structure.sections.push(currentSection);
|
|
115
|
+
}
|
|
116
|
+
currentSection = {
|
|
117
|
+
name: trimmed.substring(3),
|
|
118
|
+
tasks: []
|
|
119
|
+
};
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
// Extract tasks (support various markdown formats)
|
|
123
|
+
const taskMatch = trimmed.match(/^[-*+]\s*(\[([x\s])\])?\s*(.+)$/i);
|
|
124
|
+
if (taskMatch && currentSection) {
|
|
125
|
+
const [, , checkbox, taskText] = taskMatch;
|
|
126
|
+
const isCompleted = checkbox?.toLowerCase() === 'x';
|
|
127
|
+
// Parse task metadata from text
|
|
128
|
+
const safeTaskText = taskText || '';
|
|
129
|
+
const metadataMatch = safeTaskText.match(/^(.+?)\s*(?:\(([^)]+)\))?\s*(?:\[([^\]]+)\])?\s*(?:@(\w+))?\s*$/);
|
|
130
|
+
const title = metadataMatch?.[1] || safeTaskText;
|
|
131
|
+
const category = metadataMatch?.[2];
|
|
132
|
+
const priority = metadataMatch?.[3];
|
|
133
|
+
const assignee = metadataMatch?.[4];
|
|
134
|
+
const task = {
|
|
135
|
+
id: `task-${taskIdCounter++}`,
|
|
136
|
+
title: (title || 'Untitled Task').trim(),
|
|
137
|
+
status: isCompleted ? 'completed' : 'pending',
|
|
138
|
+
...(category && { category }),
|
|
139
|
+
...(priority && TaskPriority.safeParse(priority).success && { priority: priority }),
|
|
140
|
+
...(assignee && { assignee }),
|
|
141
|
+
createdAt: new Date().toISOString(),
|
|
142
|
+
updatedAt: new Date().toISOString()
|
|
143
|
+
};
|
|
144
|
+
currentSection.tasks.push(task);
|
|
145
|
+
// Update summary
|
|
146
|
+
structure.summary.total++;
|
|
147
|
+
if (task.status === 'completed')
|
|
148
|
+
structure.summary.completed++;
|
|
149
|
+
else if (task.status === 'in_progress')
|
|
150
|
+
structure.summary.inProgress++;
|
|
151
|
+
else if (task.status === 'blocked')
|
|
152
|
+
structure.summary.blocked++;
|
|
153
|
+
else
|
|
154
|
+
structure.summary.pending++;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// Add final section
|
|
158
|
+
if (currentSection) {
|
|
159
|
+
structure.sections.push(currentSection);
|
|
160
|
+
}
|
|
161
|
+
return structure;
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
// Handle specific file not found vs other errors
|
|
165
|
+
if (error?.code === 'ENOENT') {
|
|
166
|
+
// If file doesn't exist, return empty structure
|
|
167
|
+
return {
|
|
168
|
+
title: 'TODO Management',
|
|
169
|
+
lastUpdated: new Date().toISOString(),
|
|
170
|
+
summary: { total: 0, completed: 0, inProgress: 0, pending: 0, blocked: 0 },
|
|
171
|
+
sections: [{
|
|
172
|
+
name: 'General Tasks',
|
|
173
|
+
tasks: []
|
|
174
|
+
}]
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
// Re-throw other errors
|
|
178
|
+
throw error;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Convert structured TODO back to markdown format
|
|
183
|
+
*/
|
|
184
|
+
function formatTodoAsMarkdown(structure) {
|
|
185
|
+
const lines = [];
|
|
186
|
+
// Title and metadata
|
|
187
|
+
lines.push(`# ${structure.title}`);
|
|
188
|
+
lines.push('');
|
|
189
|
+
lines.push(`**Last Updated**: ${new Date(structure.lastUpdated).toLocaleDateString()}`);
|
|
190
|
+
lines.push(`**Progress**: ${structure.summary.completed}/${structure.summary.total} tasks completed (${Math.round((structure.summary.completed / structure.summary.total) * 100) || 0}%)`);
|
|
191
|
+
lines.push('');
|
|
192
|
+
// Progress summary
|
|
193
|
+
lines.push('## 📊 Progress Summary');
|
|
194
|
+
lines.push('');
|
|
195
|
+
lines.push(`- ✅ **Completed**: ${structure.summary.completed}`);
|
|
196
|
+
lines.push(`- 🔄 **In Progress**: ${structure.summary.inProgress}`);
|
|
197
|
+
lines.push(`- ⏳ **Pending**: ${structure.summary.pending}`);
|
|
198
|
+
lines.push(`- 🚫 **Blocked**: ${structure.summary.blocked}`);
|
|
199
|
+
lines.push('');
|
|
200
|
+
// Sections and tasks
|
|
201
|
+
for (const section of structure.sections) {
|
|
202
|
+
lines.push(`## ${section.name}`);
|
|
203
|
+
lines.push('');
|
|
204
|
+
if (section.tasks.length === 0) {
|
|
205
|
+
lines.push('*No tasks in this section*');
|
|
206
|
+
lines.push('');
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
for (const task of section.tasks) {
|
|
210
|
+
const checkbox = task.status === 'completed' ? '[x]' : '[ ]';
|
|
211
|
+
const statusIcon = {
|
|
212
|
+
pending: '⏳',
|
|
213
|
+
in_progress: '🔄',
|
|
214
|
+
completed: '✅',
|
|
215
|
+
blocked: '🚫',
|
|
216
|
+
cancelled: '❌'
|
|
217
|
+
}[task.status] || '⏳';
|
|
218
|
+
let taskLine = `- ${checkbox} ${statusIcon} ${task.title}`;
|
|
219
|
+
// Add metadata
|
|
220
|
+
const metadata = [];
|
|
221
|
+
if (task.category)
|
|
222
|
+
metadata.push(task.category);
|
|
223
|
+
if (task.priority)
|
|
224
|
+
metadata.push(`${task.priority} priority`);
|
|
225
|
+
if (task.assignee)
|
|
226
|
+
metadata.push(`@${task.assignee}`);
|
|
227
|
+
if (task.adrSource)
|
|
228
|
+
metadata.push(`ADR: ${task.adrSource}`);
|
|
229
|
+
if (metadata.length > 0) {
|
|
230
|
+
taskLine += ` *(${metadata.join(', ')})*`;
|
|
231
|
+
}
|
|
232
|
+
if (task.notes) {
|
|
233
|
+
taskLine += `\n > ${task.notes}`;
|
|
234
|
+
}
|
|
235
|
+
lines.push(taskLine);
|
|
236
|
+
}
|
|
237
|
+
lines.push('');
|
|
238
|
+
}
|
|
239
|
+
// Custom content
|
|
240
|
+
if (structure.customContent && structure.customContent.length > 0) {
|
|
241
|
+
lines.push('## Additional Notes');
|
|
242
|
+
lines.push('');
|
|
243
|
+
lines.push(...structure.customContent);
|
|
244
|
+
lines.push('');
|
|
245
|
+
}
|
|
246
|
+
// Footer
|
|
247
|
+
lines.push('---');
|
|
248
|
+
lines.push('');
|
|
249
|
+
lines.push(`*Generated by MCP ADR Analysis Server at ${new Date().toISOString()}*`);
|
|
250
|
+
return lines.join('\n');
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Update task statuses in TODO structure
|
|
254
|
+
*/
|
|
255
|
+
function updateTaskStatuses(structure, updates) {
|
|
256
|
+
const updatedStructure = { ...structure };
|
|
257
|
+
for (const update of updates) {
|
|
258
|
+
for (const section of updatedStructure.sections) {
|
|
259
|
+
const taskIndex = section.tasks.findIndex(task => task.id === update.taskId);
|
|
260
|
+
if (taskIndex >= 0) {
|
|
261
|
+
const task = { ...section.tasks[taskIndex] };
|
|
262
|
+
const oldStatus = task.status;
|
|
263
|
+
task.status = update.status;
|
|
264
|
+
task.updatedAt = new Date().toISOString();
|
|
265
|
+
if (update.notes !== undefined) {
|
|
266
|
+
task.notes = update.notes;
|
|
267
|
+
}
|
|
268
|
+
if (update.assignee !== undefined) {
|
|
269
|
+
task.assignee = update.assignee;
|
|
270
|
+
}
|
|
271
|
+
section.tasks[taskIndex] = task;
|
|
272
|
+
// Update summary counts
|
|
273
|
+
if (oldStatus !== update.status) {
|
|
274
|
+
updatedStructure.summary[oldStatus]--;
|
|
275
|
+
updatedStructure.summary[update.status]++;
|
|
276
|
+
}
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
updatedStructure.lastUpdated = new Date().toISOString();
|
|
282
|
+
return updatedStructure;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Add new tasks to TODO structure
|
|
286
|
+
*/
|
|
287
|
+
function addTasksToStructure(structure, newTasks, sectionName) {
|
|
288
|
+
const updatedStructure = { ...structure };
|
|
289
|
+
const targetSectionName = sectionName || 'General Tasks';
|
|
290
|
+
// Find or create section
|
|
291
|
+
let targetSection = updatedStructure.sections.find(s => s.name === targetSectionName);
|
|
292
|
+
if (!targetSection) {
|
|
293
|
+
targetSection = { name: targetSectionName, tasks: [] };
|
|
294
|
+
updatedStructure.sections.push(targetSection);
|
|
295
|
+
}
|
|
296
|
+
// Add tasks with IDs
|
|
297
|
+
const tasksWithIds = newTasks.map((task, index) => ({
|
|
298
|
+
...task,
|
|
299
|
+
id: `task-${Date.now()}-${index}`,
|
|
300
|
+
createdAt: new Date().toISOString(),
|
|
301
|
+
updatedAt: new Date().toISOString()
|
|
302
|
+
}));
|
|
303
|
+
targetSection.tasks.push(...tasksWithIds);
|
|
304
|
+
// Update summary
|
|
305
|
+
updatedStructure.summary.total += tasksWithIds.length;
|
|
306
|
+
for (const task of tasksWithIds) {
|
|
307
|
+
updatedStructure.summary[task.status]++;
|
|
308
|
+
}
|
|
309
|
+
updatedStructure.lastUpdated = new Date().toISOString();
|
|
310
|
+
return updatedStructure;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Main TODO management function
|
|
314
|
+
*/
|
|
315
|
+
export async function manageTodo(args) {
|
|
316
|
+
try {
|
|
317
|
+
const validatedArgs = ManageTodoSchema.parse(args);
|
|
318
|
+
switch (validatedArgs.operation) {
|
|
319
|
+
case 'update_status': {
|
|
320
|
+
const structure = await parseTodoFile(validatedArgs.todoPath);
|
|
321
|
+
const updatedStructure = updateTaskStatuses(structure, validatedArgs.updates);
|
|
322
|
+
const markdown = formatTodoAsMarkdown(updatedStructure);
|
|
323
|
+
const fs = await import('fs/promises');
|
|
324
|
+
await fs.writeFile(validatedArgs.todoPath, markdown, 'utf-8');
|
|
325
|
+
return {
|
|
326
|
+
content: [{
|
|
327
|
+
type: 'text',
|
|
328
|
+
text: `# Task Status Updated
|
|
329
|
+
|
|
330
|
+
## Updates Applied
|
|
331
|
+
${validatedArgs.updates.map(update => `- Task \`${update.taskId}\`: ${update.status}${update.notes ? ` (${update.notes})` : ''}`).join('\n')}
|
|
332
|
+
|
|
333
|
+
## Current Progress
|
|
334
|
+
- ✅ Completed: ${updatedStructure.summary.completed}
|
|
335
|
+
- 🔄 In Progress: ${updatedStructure.summary.inProgress}
|
|
336
|
+
- ⏳ Pending: ${updatedStructure.summary.pending}
|
|
337
|
+
- 🚫 Blocked: ${updatedStructure.summary.blocked}
|
|
338
|
+
|
|
339
|
+
Updated TODO file: \`${validatedArgs.todoPath}\``
|
|
340
|
+
}]
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
case 'add_tasks': {
|
|
344
|
+
const structure = await parseTodoFile(validatedArgs.todoPath);
|
|
345
|
+
const updatedStructure = addTasksToStructure(structure, validatedArgs.tasks, validatedArgs.section);
|
|
346
|
+
const markdown = formatTodoAsMarkdown(updatedStructure);
|
|
347
|
+
const fs = await import('fs/promises');
|
|
348
|
+
await fs.writeFile(validatedArgs.todoPath, markdown, 'utf-8');
|
|
349
|
+
return {
|
|
350
|
+
content: [{
|
|
351
|
+
type: 'text',
|
|
352
|
+
text: `# Tasks Added Successfully
|
|
353
|
+
|
|
354
|
+
## Added ${validatedArgs.tasks.length} New Tasks
|
|
355
|
+
${validatedArgs.tasks.map((task) => `- ${task.title} (${task.status}${task.priority ? `, ${task.priority} priority` : ''})`).join('\n')}
|
|
356
|
+
|
|
357
|
+
## Section: ${validatedArgs.section || 'General Tasks'}
|
|
358
|
+
|
|
359
|
+
## Updated Progress
|
|
360
|
+
- Total Tasks: ${updatedStructure.summary.total}
|
|
361
|
+
- New Pending: ${validatedArgs.tasks.filter(t => t.status === 'pending').length}
|
|
362
|
+
|
|
363
|
+
Updated TODO file: \`${validatedArgs.todoPath}\``
|
|
364
|
+
}]
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
case 'merge_adr_updates': {
|
|
368
|
+
// Get current TODO structure
|
|
369
|
+
const currentStructure = await parseTodoFile(validatedArgs.todoPath);
|
|
370
|
+
// Get ADR-generated tasks using existing tool
|
|
371
|
+
// Note: This would require integration with the existing generate_adr_todo tool
|
|
372
|
+
// For now, we'll create a placeholder implementation
|
|
373
|
+
return {
|
|
374
|
+
content: [{
|
|
375
|
+
type: 'text',
|
|
376
|
+
text: `# ADR Merge Analysis
|
|
377
|
+
|
|
378
|
+
## Current TODO Status
|
|
379
|
+
- Total Tasks: ${currentStructure.summary.total}
|
|
380
|
+
- Completed: ${currentStructure.summary.completed}
|
|
381
|
+
- Preserve Completed: ${validatedArgs.preserveCompleted}
|
|
382
|
+
- Preserve Custom: ${validatedArgs.preserveCustom}
|
|
383
|
+
|
|
384
|
+
## Next Steps
|
|
385
|
+
1. Review ADR-generated tasks from \`generate_adr_todo\`
|
|
386
|
+
2. Identify new tasks not in current TODO
|
|
387
|
+
3. Merge while preserving settings
|
|
388
|
+
4. Update TODO file
|
|
389
|
+
|
|
390
|
+
*Full merge implementation requires integration with ADR generation results*`
|
|
391
|
+
}]
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
case 'sync_progress': {
|
|
395
|
+
const structure = await parseTodoFile(validatedArgs.todoPath);
|
|
396
|
+
return {
|
|
397
|
+
content: [{
|
|
398
|
+
type: 'text',
|
|
399
|
+
text: `# TODO Progress Sync
|
|
400
|
+
|
|
401
|
+
## Current Status
|
|
402
|
+
- Total Tasks: ${structure.summary.total}
|
|
403
|
+
- Completed: ${structure.summary.completed}
|
|
404
|
+
- In Progress: ${structure.summary.inProgress}
|
|
405
|
+
- ADR Directory: ${validatedArgs.adrDirectory}
|
|
406
|
+
- Update ADRs: ${validatedArgs.updateAdrs}
|
|
407
|
+
|
|
408
|
+
## Sync Results
|
|
409
|
+
*This operation would sync TODO progress with ADR status*
|
|
410
|
+
*Implementation requires integration with ADR status tracking*
|
|
411
|
+
|
|
412
|
+
## Next Steps
|
|
413
|
+
1. Review TODO completion status
|
|
414
|
+
2. Update corresponding ADR statuses if enabled
|
|
415
|
+
3. Generate sync report`
|
|
416
|
+
}]
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
case 'analyze_progress': {
|
|
420
|
+
const structure = await parseTodoFile(validatedArgs.todoPath);
|
|
421
|
+
// Calculate progress metrics
|
|
422
|
+
const totalTasks = structure.summary.total;
|
|
423
|
+
const completionRate = totalTasks > 0 ? (structure.summary.completed / totalTasks) * 100 : 0;
|
|
424
|
+
// Calculate velocity (placeholder - would need historical data)
|
|
425
|
+
const velocity = validatedArgs.includeVelocity ? {
|
|
426
|
+
tasksPerDay: 2.5,
|
|
427
|
+
estimatedCompletion: '2 weeks',
|
|
428
|
+
trend: 'stable'
|
|
429
|
+
} : null;
|
|
430
|
+
return {
|
|
431
|
+
content: [{
|
|
432
|
+
type: 'text',
|
|
433
|
+
text: `# TODO Progress Analysis
|
|
434
|
+
|
|
435
|
+
## Overall Progress
|
|
436
|
+
- **Completion Rate**: ${completionRate.toFixed(1)}% (${structure.summary.completed}/${totalTasks})
|
|
437
|
+
- **Active Tasks**: ${structure.summary.inProgress}
|
|
438
|
+
- **Blocked Tasks**: ${structure.summary.blocked}
|
|
439
|
+
|
|
440
|
+
## Status Distribution
|
|
441
|
+
- ✅ Completed: ${structure.summary.completed} (${((structure.summary.completed / totalTasks) * 100).toFixed(1)}%)
|
|
442
|
+
- 🔄 In Progress: ${structure.summary.inProgress} (${((structure.summary.inProgress / totalTasks) * 100).toFixed(1)}%)
|
|
443
|
+
- ⏳ Pending: ${structure.summary.pending} (${((structure.summary.pending / totalTasks) * 100).toFixed(1)}%)
|
|
444
|
+
- 🚫 Blocked: ${structure.summary.blocked} (${((structure.summary.blocked / totalTasks) * 100).toFixed(1)}%)
|
|
445
|
+
|
|
446
|
+
${velocity ? `## Velocity Metrics
|
|
447
|
+
- **Tasks per Day**: ${velocity.tasksPerDay}
|
|
448
|
+
- **Estimated Completion**: ${velocity.estimatedCompletion}
|
|
449
|
+
- **Trend**: ${velocity.trend}` : ''}
|
|
450
|
+
|
|
451
|
+
## Recommendations
|
|
452
|
+
${structure.summary.blocked > 0 ? '- 🚨 Address blocked tasks to improve flow' : ''}
|
|
453
|
+
${structure.summary.inProgress > 5 ? '- ⚠️ Consider reducing work in progress' : ''}
|
|
454
|
+
${completionRate < 50 ? '- 📈 Focus on completing existing tasks' : ''}
|
|
455
|
+
${completionRate > 80 ? '- 🎉 Great progress! Consider adding new tasks' : ''}
|
|
456
|
+
|
|
457
|
+
*Analysis timeframe: ${validatedArgs.timeframe}*`
|
|
458
|
+
}]
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
default:
|
|
462
|
+
throw new McpAdrError(`Unknown operation: ${validatedArgs.operation}`, 'INVALID_INPUT');
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
catch (error) {
|
|
466
|
+
if (error instanceof z.ZodError) {
|
|
467
|
+
throw new McpAdrError(`Invalid input: ${error.errors.map(e => e.message).join(', ')}`, 'INVALID_INPUT');
|
|
468
|
+
}
|
|
469
|
+
throw new McpAdrError(`TODO management failed: ${error instanceof Error ? error.message : String(error)}`, 'TODO_MANAGEMENT_ERROR');
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
//# sourceMappingURL=todo-management-tool.js.map
|
|
@@ -0,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|
|
3
|
+
*
|
|
4
|
+
* Defines the structure for passing conversation context from calling LLMs
|
|
5
|
+
* to the MCP server for context-aware analysis.
|
|
6
|
+
*/
|
|
7
|
+
export interface ConversationContext {
|
|
8
|
+
/** User's primary objectives from the conversation */
|
|
9
|
+
userGoals?: string[];
|
|
10
|
+
/** Specific areas of concern or interest */
|
|
11
|
+
focusAreas?: string[];
|
|
12
|
+
/** Limitations, compliance requirements, or restrictions */
|
|
13
|
+
constraints?: string[];
|
|
14
|
+
/** Relevant context from previous conversation */
|
|
15
|
+
previousContext?: string;
|
|
16
|
+
/** Current project phase or stage */
|
|
17
|
+
projectPhase?: 'planning' | 'development' | 'migration' | 'production' | 'maintenance' | string;
|
|
18
|
+
/** User's role or expertise level */
|
|
19
|
+
userRole?: 'architect' | 'developer' | 'manager' | 'ops' | 'security' | string;
|
|
20
|
+
/** Specific requirements or preferences mentioned */
|
|
21
|
+
requirements?: string[];
|
|
22
|
+
/** Timeline or urgency information */
|
|
23
|
+
timeline?: string;
|
|
24
|
+
/** Budget or resource constraints */
|
|
25
|
+
budget?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* JSON Schema for conversation context - reusable across tools
|
|
29
|
+
*/
|
|
30
|
+
export declare const CONVERSATION_CONTEXT_SCHEMA: {
|
|
31
|
+
type: "object";
|
|
32
|
+
description: string;
|
|
33
|
+
properties: {
|
|
34
|
+
userGoals: {
|
|
35
|
+
type: "array";
|
|
36
|
+
items: {
|
|
37
|
+
type: "string";
|
|
38
|
+
};
|
|
39
|
+
description: string;
|
|
40
|
+
};
|
|
41
|
+
focusAreas: {
|
|
42
|
+
type: "array";
|
|
43
|
+
items: {
|
|
44
|
+
type: "string";
|
|
45
|
+
};
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
constraints: {
|
|
49
|
+
type: "array";
|
|
50
|
+
items: {
|
|
51
|
+
type: "string";
|
|
52
|
+
};
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
previousContext: {
|
|
56
|
+
type: "string";
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
projectPhase: {
|
|
60
|
+
type: "string";
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
userRole: {
|
|
64
|
+
type: "string";
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
requirements: {
|
|
68
|
+
type: "array";
|
|
69
|
+
items: {
|
|
70
|
+
type: "string";
|
|
71
|
+
};
|
|
72
|
+
description: string;
|
|
73
|
+
};
|
|
74
|
+
timeline: {
|
|
75
|
+
type: "string";
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
budget: {
|
|
79
|
+
type: "string";
|
|
80
|
+
description: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
additionalProperties: boolean;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Utility function to extract context summary for prompts
|
|
87
|
+
*/
|
|
88
|
+
export declare function formatContextForPrompt(context?: ConversationContext): string;
|
|
89
|
+
/**
|
|
90
|
+
* Check if context contains meaningful information
|
|
91
|
+
*/
|
|
92
|
+
export declare function hasMeaningfulContext(context?: ConversationContext): boolean;
|
|
93
|
+
//# sourceMappingURL=conversation-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-context.d.ts","sourceRoot":"","sources":["../../../src/types/conversation-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,mBAAmB;IAClC,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAEvB,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,qCAAqC;IACrC,YAAY,CAAC,EAAE,UAAU,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY,GAAG,aAAa,GAAG,MAAM,CAAC;IAEhG,qCAAqC;IACrC,QAAQ,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,CAAC;IAE/E,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CvC,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAkC5E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAY3E"}
|