edsger 0.2.11 â 0.2.12
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.
|
@@ -168,20 +168,42 @@ async function prepareDesignContext(mcpServerUrl, mcpToken, featureId, checklist
|
|
|
168
168
|
}
|
|
169
169
|
// Add feedbacks context to the design prompt
|
|
170
170
|
try {
|
|
171
|
+
if (verbose) {
|
|
172
|
+
logInfo(`đ Fetching feedbacks from MCP: ${mcpServerUrl}/mcp (phase: technical-design)`);
|
|
173
|
+
}
|
|
171
174
|
feedbacksContext = await getFeedbacksForPhase({ featureId, mcpServerUrl, mcpToken, verbose }, 'technical-design');
|
|
175
|
+
if (verbose) {
|
|
176
|
+
logInfo(`đ Feedbacks fetched successfully: ${feedbacksContext.feedbacks.length} feedbacks found`);
|
|
177
|
+
if (feedbacksContext.feedbacks.length > 0) {
|
|
178
|
+
logInfo('đ Feedbacks details:');
|
|
179
|
+
feedbacksContext.feedbacks.forEach((fb, idx) => {
|
|
180
|
+
logInfo(` ${idx + 1}. [${fb.feedback_type}] ${fb.title} (priority: ${fb.priority}, resolved: ${fb.is_resolved || false})`);
|
|
181
|
+
logInfo(` Content: ${fb.content.substring(0, 150)}...`);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}
|
|
172
185
|
if (feedbacksContext.feedbacks.length > 0) {
|
|
173
186
|
hasFeedbacks = true;
|
|
174
187
|
const feedbacksInfo = formatFeedbacksForContext(feedbacksContext);
|
|
175
188
|
finalContextInfo = finalContextInfo + '\n\n' + feedbacksInfo;
|
|
176
189
|
if (verbose) {
|
|
177
|
-
logInfo(
|
|
190
|
+
logInfo(`â
Added ${feedbacksContext.feedbacks.length} human feedbacks to design context`);
|
|
191
|
+
logInfo(`đ Feedbacks section length: ${feedbacksInfo.length} characters`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
if (verbose) {
|
|
196
|
+
logInfo('âšī¸ No unresolved feedbacks found for this phase');
|
|
178
197
|
}
|
|
179
198
|
}
|
|
180
199
|
}
|
|
181
200
|
catch (error) {
|
|
182
201
|
// Don't fail if feedbacks fetch fails - just log and continue
|
|
183
202
|
if (verbose) {
|
|
184
|
-
|
|
203
|
+
logError(`â Failed to fetch feedbacks: ${error instanceof Error ? error.message : String(error)}`);
|
|
204
|
+
if (error instanceof Error && error.stack) {
|
|
205
|
+
logError(` Stack: ${error.stack}`);
|
|
206
|
+
}
|
|
185
207
|
}
|
|
186
208
|
}
|
|
187
209
|
// Add checklist context to the design prompt
|
|
@@ -11,8 +11,19 @@ export async function getFeedbacksForPhase(options, phase) {
|
|
|
11
11
|
// Convert phase name from hyphen to underscore format for database compatibility
|
|
12
12
|
// e.g., 'feature-analysis' -> 'feature_analysis'
|
|
13
13
|
const dbPhase = phase.replace(/-/g, '_');
|
|
14
|
+
const requestBody = {
|
|
15
|
+
jsonrpc: '2.0',
|
|
16
|
+
id: 1,
|
|
17
|
+
method: 'feedbacks/get',
|
|
18
|
+
params: {
|
|
19
|
+
feature_id: featureId,
|
|
20
|
+
phase: dbPhase,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
14
23
|
if (verbose) {
|
|
15
24
|
console.log(`đ Fetching feedbacks: phase="${phase}" (db: "${dbPhase}"), feature_id="${featureId}"`);
|
|
25
|
+
console.log(`đĄ MCP URL: ${mcpServerUrl}/mcp`);
|
|
26
|
+
console.log(`đĻ Request body:`, JSON.stringify(requestBody, null, 2));
|
|
16
27
|
}
|
|
17
28
|
const response = await fetch(`${mcpServerUrl}/mcp`, {
|
|
18
29
|
method: 'POST',
|
|
@@ -20,32 +31,42 @@ export async function getFeedbacksForPhase(options, phase) {
|
|
|
20
31
|
'Content-Type': 'application/json',
|
|
21
32
|
Authorization: `Bearer ${mcpToken}`,
|
|
22
33
|
},
|
|
23
|
-
body: JSON.stringify(
|
|
24
|
-
jsonrpc: '2.0',
|
|
25
|
-
id: 1,
|
|
26
|
-
method: 'feedbacks/get',
|
|
27
|
-
params: {
|
|
28
|
-
feature_id: featureId,
|
|
29
|
-
phase: dbPhase,
|
|
30
|
-
},
|
|
31
|
-
}),
|
|
34
|
+
body: JSON.stringify(requestBody),
|
|
32
35
|
});
|
|
36
|
+
if (verbose) {
|
|
37
|
+
console.log(`đĨ Response status: ${response.status} ${response.statusText}`);
|
|
38
|
+
}
|
|
33
39
|
if (!response.ok) {
|
|
34
40
|
const errorText = await response.text();
|
|
41
|
+
if (verbose) {
|
|
42
|
+
console.log(`â Response error body:`, errorText);
|
|
43
|
+
}
|
|
35
44
|
throw new Error(`Failed to fetch feedbacks for phase "${phase}": ${response.status} ${response.statusText}. Response: ${errorText}`);
|
|
36
45
|
}
|
|
37
46
|
const data = await response.json();
|
|
47
|
+
if (verbose) {
|
|
48
|
+
console.log(`đ MCP response:`, JSON.stringify(data, null, 2));
|
|
49
|
+
}
|
|
38
50
|
if (data.error) {
|
|
51
|
+
if (verbose) {
|
|
52
|
+
console.log(`â MCP error:`, data.error);
|
|
53
|
+
}
|
|
39
54
|
throw new Error(`MCP Error for phase "${phase}": ${data.error.message || JSON.stringify(data.error)}`);
|
|
40
55
|
}
|
|
41
56
|
// Handle empty result gracefully
|
|
42
57
|
if (!data.result) {
|
|
58
|
+
if (verbose) {
|
|
59
|
+
console.log(`â ī¸ Empty result from MCP, returning empty feedbacks array`);
|
|
60
|
+
}
|
|
43
61
|
return {
|
|
44
62
|
phase,
|
|
45
63
|
feature_id: featureId,
|
|
46
64
|
feedbacks: [],
|
|
47
65
|
};
|
|
48
66
|
}
|
|
67
|
+
if (verbose) {
|
|
68
|
+
console.log(`â
Successfully fetched ${data.result.feedbacks?.length || 0} feedbacks`);
|
|
69
|
+
}
|
|
49
70
|
return data.result;
|
|
50
71
|
}
|
|
51
72
|
/**
|