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(`Added ${feedbacksContext.feedbacks.length} human feedbacks to design context`);
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
- logInfo(`Note: Could not fetch feedbacks (${error instanceof Error ? error.message : String(error)})`);
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
@@ -15,6 +15,9 @@ export interface Feedback {
15
15
  content: string;
16
16
  priority: number;
17
17
  is_active: boolean;
18
+ is_resolved?: boolean;
19
+ resolved_at?: string | null;
20
+ resolved_by?: string | null;
18
21
  created_by: string;
19
22
  created_at: string;
20
23
  updated_at: string;
@@ -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
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edsger",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {