@rigstate/mcp 0.7.10 → 0.7.13
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/index.js +63 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/project-context-utils.ts +1 -1
- package/src/tools/list-roadmap-tasks.ts +23 -2
- package/src/tools/save-decision.ts +49 -15
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@ export async function buildProjectSummary(
|
|
|
24
24
|
|
|
25
25
|
const detailedInstructions = activeTask.prompt_content || activeTask.instruction_set;
|
|
26
26
|
if (detailedInstructions) {
|
|
27
|
-
summaryParts.push(` Instructions: ${detailedInstructions
|
|
27
|
+
summaryParts.push(` Instructions: ${detailedInstructions}`);
|
|
28
28
|
}
|
|
29
29
|
if (activeTask.architectural_brief) {
|
|
30
30
|
summaryParts.push(`\n Architectural Brief: ${activeTask.architectural_brief}`);
|
|
@@ -63,8 +63,29 @@ export async function listRoadmapTasks(
|
|
|
63
63
|
const formatted = activeTasks.length > 0
|
|
64
64
|
? activeTasks.map((t: any) => {
|
|
65
65
|
const statusEmoji = t.status === 'ACTIVE' ? '🔵' : '🔒';
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
const priorityBadge = t.priority ? `[${t.priority}]` : '';
|
|
67
|
+
const tags = t.tags && t.tags.length > 0 ? `Tags: ${t.tags.join(', ')}` : '';
|
|
68
|
+
|
|
69
|
+
let details = `${statusEmoji} Step ${t.step_number}: ${t.title} ${priorityBadge} (ID: ${t.id})`;
|
|
70
|
+
|
|
71
|
+
if (t.description) {
|
|
72
|
+
details += `\n Description: ${t.description.substring(0, 150)}${t.description.length > 150 ? '...' : ''}`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (tags) {
|
|
76
|
+
details += `\n ${tags}`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (t.prompt_content) {
|
|
80
|
+
details += `\n Instruction Preview: ${t.prompt_content.substring(0, 100).replace(/\n/g, ' ')}...`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (t.architectural_brief) {
|
|
84
|
+
details += `\n Arch Brief: ${t.architectural_brief.substring(0, 100).replace(/\n/g, ' ')}...`;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return details;
|
|
88
|
+
}).join('\n\n')
|
|
68
89
|
: 'No active or locked tasks found in the roadmap.';
|
|
69
90
|
|
|
70
91
|
return {
|
|
@@ -75,20 +75,54 @@ export async function saveDecision(
|
|
|
75
75
|
: decision;
|
|
76
76
|
|
|
77
77
|
// Insert the memory with high importance (ADR = 9/10)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
78
|
+
// Use the secure RPC if possible, falling back to direct insert if older RPC not found (unlikely now)
|
|
79
|
+
let memoryId: string | null = null;
|
|
80
|
+
let insertError: any = null;
|
|
81
|
+
|
|
82
|
+
try {
|
|
83
|
+
const { data, error } = await supabase.rpc('save_project_memory_secure', {
|
|
84
|
+
p_project_id: projectId,
|
|
85
|
+
p_user_id: userId,
|
|
86
|
+
p_content: fullContent,
|
|
87
|
+
p_category: category,
|
|
88
|
+
p_tags: ['ADR', ...tags],
|
|
89
|
+
p_importance: 9,
|
|
90
|
+
p_source_type: 'mcp'
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
if (error) {
|
|
94
|
+
insertError = error;
|
|
95
|
+
} else {
|
|
96
|
+
memoryId = data;
|
|
97
|
+
}
|
|
98
|
+
} catch (e) {
|
|
99
|
+
insertError = e;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (!memoryId) {
|
|
103
|
+
// Direct Fallback
|
|
104
|
+
const { data: memory, error } = await supabase
|
|
105
|
+
.from('project_memories')
|
|
106
|
+
.insert({
|
|
107
|
+
project_id: projectId,
|
|
108
|
+
content: fullContent,
|
|
109
|
+
summary: summary,
|
|
110
|
+
category: category,
|
|
111
|
+
tags: ['ADR', ...tags],
|
|
112
|
+
importance: 9, // High importance for decisions
|
|
113
|
+
source_type: 'mcp', // Track source as MCP
|
|
114
|
+
is_active: true
|
|
115
|
+
})
|
|
116
|
+
.select('id')
|
|
117
|
+
.single();
|
|
118
|
+
|
|
119
|
+
if (error) {
|
|
120
|
+
insertError = error;
|
|
121
|
+
} else if (memory) {
|
|
122
|
+
memoryId = memory.id;
|
|
123
|
+
insertError = null; // Clear error if fallback succeeded
|
|
124
|
+
}
|
|
125
|
+
}
|
|
92
126
|
|
|
93
127
|
if (insertError) {
|
|
94
128
|
// Handle specific database errors
|
|
@@ -103,7 +137,7 @@ export async function saveDecision(
|
|
|
103
137
|
|
|
104
138
|
return {
|
|
105
139
|
success: true,
|
|
106
|
-
memoryId:
|
|
140
|
+
memoryId: memoryId!,
|
|
107
141
|
message: `✅ Decision "${title}" saved to project "${project?.name || projectId}" with importance 9/10`
|
|
108
142
|
};
|
|
109
143
|
}
|