@rigstate/mcp 0.4.3 → 0.4.5
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 +13 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/tools/get-latest-decisions.ts +1 -1
- package/src/tools/query-brain.ts +15 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rigstate/mcp",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "Rigstate MCP Server - Model Context Protocol for AI Editors",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -40,4 +40,4 @@
|
|
|
40
40
|
],
|
|
41
41
|
"author": "Rigstate",
|
|
42
42
|
"license": "MIT"
|
|
43
|
-
}
|
|
43
|
+
}
|
|
@@ -60,7 +60,7 @@ export async function getLatestDecisions(
|
|
|
60
60
|
id: s.id,
|
|
61
61
|
projectId: s.project_id,
|
|
62
62
|
recruitedAgents: s.recruited_agents || [],
|
|
63
|
-
feedbackSummary: (s.feedback_summary
|
|
63
|
+
feedbackSummary: (Array.isArray(s.feedback_summary) ? s.feedback_summary : []).map((f: any) => ({
|
|
64
64
|
agentName: f.agentName || f.agent?.name || 'Unknown',
|
|
65
65
|
emoji: f.emoji || f.agent?.emoji || '🤖',
|
|
66
66
|
critiques: f.critiques || [],
|
package/src/tools/query-brain.ts
CHANGED
|
@@ -80,20 +80,24 @@ export async function queryBrain(
|
|
|
80
80
|
|
|
81
81
|
const { data: keywordMatches, error: searchError } = await supabase
|
|
82
82
|
.from('project_memories')
|
|
83
|
-
.select('id, content, category, tags,
|
|
83
|
+
.select('id, content, category, tags, importance, created_at')
|
|
84
84
|
.eq('project_id', projectId)
|
|
85
85
|
.eq('is_active', true)
|
|
86
86
|
.or(orConditions)
|
|
87
|
-
.order('
|
|
87
|
+
.order('importance', { ascending: false, nullsFirst: false })
|
|
88
88
|
.limit(limit);
|
|
89
89
|
|
|
90
|
-
if (
|
|
90
|
+
if (searchError) {
|
|
91
|
+
console.error('Search error:', searchError);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (keywordMatches) {
|
|
91
95
|
memories = keywordMatches.map(m => ({
|
|
92
96
|
id: m.id,
|
|
93
97
|
content: m.content,
|
|
94
98
|
category: m.category || 'general',
|
|
95
99
|
tags: m.tags || [],
|
|
96
|
-
netVotes: m.
|
|
100
|
+
netVotes: m.importance || 0,
|
|
97
101
|
createdAt: m.created_at
|
|
98
102
|
}));
|
|
99
103
|
}
|
|
@@ -103,19 +107,23 @@ export async function queryBrain(
|
|
|
103
107
|
if (memories.length === 0) {
|
|
104
108
|
const { data: recentMemories, error: recentError } = await supabase
|
|
105
109
|
.from('project_memories')
|
|
106
|
-
.select('id, content, category, tags,
|
|
110
|
+
.select('id, content, category, tags, importance, created_at')
|
|
107
111
|
.eq('project_id', projectId)
|
|
108
112
|
.eq('is_active', true)
|
|
109
113
|
.order('created_at', { ascending: false })
|
|
110
114
|
.limit(limit);
|
|
111
115
|
|
|
112
|
-
if (
|
|
116
|
+
if (recentError) {
|
|
117
|
+
console.error('Recent error:', recentError);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (recentMemories) {
|
|
113
121
|
memories = recentMemories.map(m => ({
|
|
114
122
|
id: m.id,
|
|
115
123
|
content: m.content,
|
|
116
124
|
category: m.category || 'general',
|
|
117
125
|
tags: m.tags || [],
|
|
118
|
-
netVotes: m.
|
|
126
|
+
netVotes: m.importance || 0,
|
|
119
127
|
createdAt: m.created_at
|
|
120
128
|
}));
|
|
121
129
|
}
|