@rigstate/mcp 0.7.2 → 0.7.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rigstate/mcp",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "Rigstate MCP Server - Model Context Protocol for AI Editors",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"zod": "^3.22.4"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@rigstate/rules-engine": "
|
|
29
|
+
"@rigstate/rules-engine": "*",
|
|
30
30
|
"@types/node": "^20.11.5",
|
|
31
31
|
"tsup": "^8.0.1",
|
|
32
32
|
"typescript": "^5.3.3"
|
|
@@ -36,15 +36,14 @@ export async function getLatestDecisions(
|
|
|
36
36
|
projectId: string,
|
|
37
37
|
limit: number = 5
|
|
38
38
|
): Promise<DecisionsResponse> {
|
|
39
|
-
// First, verify project
|
|
40
|
-
const { data:
|
|
41
|
-
.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (projectError || !project) {
|
|
39
|
+
// First, verify project access
|
|
40
|
+
const { data: hasAccess, error: accessError } = await supabase
|
|
41
|
+
.rpc('check_project_access_secure', {
|
|
42
|
+
p_project_id: projectId,
|
|
43
|
+
p_user_id: userId
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
if (accessError || !hasAccess) {
|
|
48
47
|
throw new Error('Project not found or access denied');
|
|
49
48
|
}
|
|
50
49
|
|
|
@@ -33,15 +33,14 @@ export async function listRoadmapTasks(
|
|
|
33
33
|
userId: string,
|
|
34
34
|
projectId: string
|
|
35
35
|
): Promise<ListRoadmapTasksResponse> {
|
|
36
|
-
// 1. Verify project
|
|
37
|
-
const { data:
|
|
38
|
-
.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
.single();
|
|
36
|
+
// 1. Verify project access
|
|
37
|
+
const { data: hasAccess, error: accessError } = await supabase
|
|
38
|
+
.rpc('check_project_access_secure', {
|
|
39
|
+
p_project_id: projectId,
|
|
40
|
+
p_user_id: userId
|
|
41
|
+
});
|
|
43
42
|
|
|
44
|
-
if (
|
|
43
|
+
if (accessError || !hasAccess) {
|
|
45
44
|
throw new Error('Project not found or access denied');
|
|
46
45
|
}
|
|
47
46
|
|
|
@@ -53,8 +53,10 @@ export async function saveToProjectBrain(
|
|
|
53
53
|
const { projectId, title, content, category, tags } = input;
|
|
54
54
|
|
|
55
55
|
// Confirm project access
|
|
56
|
-
const { data:
|
|
57
|
-
|
|
56
|
+
const { data: hasAccess, error: accessError } = await supabase
|
|
57
|
+
.rpc('check_project_access_secure', { p_project_id: projectId, p_user_id: userId });
|
|
58
|
+
|
|
59
|
+
if (accessError || !hasAccess) throw new Error('Access denied');
|
|
58
60
|
|
|
59
61
|
const fullContent = `# ${title}\n\n${content}`;
|
|
60
62
|
|
|
@@ -92,6 +94,12 @@ export async function updateRoadmapStatus(
|
|
|
92
94
|
) {
|
|
93
95
|
const { projectId, chunkId, status } = input;
|
|
94
96
|
|
|
97
|
+
// Confirm project access
|
|
98
|
+
const { data: hasAccess, error: accessError } = await supabase
|
|
99
|
+
.rpc('check_project_access_secure', { p_project_id: projectId, p_user_id: userId });
|
|
100
|
+
|
|
101
|
+
if (accessError || !hasAccess) throw new Error('Access denied');
|
|
102
|
+
|
|
95
103
|
// Map status to DB enum: 'TODO' -> 'LOCKED' (Standard convention in Rigstate seems to be LOCKED/ACTIVE/COMPLETED)
|
|
96
104
|
// If 'TODO' is meant to be 'PENDING', we check schema. Assuming 'LOCKED' is the backlog state.
|
|
97
105
|
const dbStatus = status === 'TODO' ? 'LOCKED' : status === 'IN_PROGRESS' ? 'ACTIVE' : 'COMPLETED';
|
|
@@ -127,6 +135,12 @@ export async function addRoadmapChunk(
|
|
|
127
135
|
) {
|
|
128
136
|
const { projectId, title, description, priority } = input;
|
|
129
137
|
|
|
138
|
+
// Confirm project access
|
|
139
|
+
const { data: hasAccess, error: accessError } = await supabase
|
|
140
|
+
.rpc('check_project_access_secure', { p_project_id: projectId, p_user_id: userId });
|
|
141
|
+
|
|
142
|
+
if (accessError || !hasAccess) throw new Error('Access denied');
|
|
143
|
+
|
|
130
144
|
// Get max step number
|
|
131
145
|
const { data: maxStep } = await supabase
|
|
132
146
|
.from('roadmap_chunks')
|