@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/dist/index.js
CHANGED
|
@@ -2211,8 +2211,11 @@ including active roadmap steps and council session feedback.`,
|
|
|
2211
2211
|
}
|
|
2212
2212
|
});
|
|
2213
2213
|
async function getLatestDecisions(supabase, userId, projectId, limit = 5) {
|
|
2214
|
-
const { data:
|
|
2215
|
-
|
|
2214
|
+
const { data: hasAccess, error: accessError } = await supabase.rpc("check_project_access_secure", {
|
|
2215
|
+
p_project_id: projectId,
|
|
2216
|
+
p_user_id: userId
|
|
2217
|
+
});
|
|
2218
|
+
if (accessError || !hasAccess) {
|
|
2216
2219
|
throw new Error("Project not found or access denied");
|
|
2217
2220
|
}
|
|
2218
2221
|
const { data: sessionData, error: sessionError } = await supabase.from("council_sessions").select("id, project_id, recruited_agents, feedback_summary, duration_ms, sprints_count, tasks_count, created_at").eq("project_id", projectId).order("created_at", { ascending: false }).limit(limit);
|
|
@@ -2767,8 +2770,11 @@ Shows active and locked steps with their step numbers.`,
|
|
|
2767
2770
|
}
|
|
2768
2771
|
});
|
|
2769
2772
|
async function listRoadmapTasks(supabase, userId, projectId) {
|
|
2770
|
-
const { data:
|
|
2771
|
-
|
|
2773
|
+
const { data: hasAccess, error: accessError } = await supabase.rpc("check_project_access_secure", {
|
|
2774
|
+
p_project_id: projectId,
|
|
2775
|
+
p_user_id: userId
|
|
2776
|
+
});
|
|
2777
|
+
if (accessError || !hasAccess) {
|
|
2772
2778
|
throw new Error("Project not found or access denied");
|
|
2773
2779
|
}
|
|
2774
2780
|
const { data: tasks, error } = await supabase.from("roadmap_chunks").select("id, title, priority, status, step_number, prompt_content").eq("project_id", projectId).neq("status", "COMPLETED").order("priority", { ascending: false }).order("step_number", { ascending: true });
|
|
@@ -3617,8 +3623,8 @@ registry.register({
|
|
|
3617
3623
|
});
|
|
3618
3624
|
async function saveToProjectBrain(supabase, userId, input) {
|
|
3619
3625
|
const { projectId, title, content, category, tags } = input;
|
|
3620
|
-
const { data:
|
|
3621
|
-
if (
|
|
3626
|
+
const { data: hasAccess, error: accessError } = await supabase.rpc("check_project_access_secure", { p_project_id: projectId, p_user_id: userId });
|
|
3627
|
+
if (accessError || !hasAccess) throw new Error("Access denied");
|
|
3622
3628
|
const fullContent = `# ${title}
|
|
3623
3629
|
|
|
3624
3630
|
${content}`;
|
|
@@ -3640,6 +3646,8 @@ ${content}`;
|
|
|
3640
3646
|
}
|
|
3641
3647
|
async function updateRoadmapStatus(supabase, userId, input) {
|
|
3642
3648
|
const { projectId, chunkId, status } = input;
|
|
3649
|
+
const { data: hasAccess, error: accessError } = await supabase.rpc("check_project_access_secure", { p_project_id: projectId, p_user_id: userId });
|
|
3650
|
+
if (accessError || !hasAccess) throw new Error("Access denied");
|
|
3643
3651
|
const dbStatus = status === "TODO" ? "LOCKED" : status === "IN_PROGRESS" ? "ACTIVE" : "COMPLETED";
|
|
3644
3652
|
const { error } = await supabase.from("roadmap_chunks").update({ status: dbStatus }).eq("id", chunkId).eq("project_id", projectId);
|
|
3645
3653
|
if (error) throw new Error(`Update failed: ${error.message}`);
|
|
@@ -3653,6 +3661,8 @@ async function updateRoadmapStatus(supabase, userId, input) {
|
|
|
3653
3661
|
}
|
|
3654
3662
|
async function addRoadmapChunk(supabase, userId, input) {
|
|
3655
3663
|
const { projectId, title, description, priority } = input;
|
|
3664
|
+
const { data: hasAccess, error: accessError } = await supabase.rpc("check_project_access_secure", { p_project_id: projectId, p_user_id: userId });
|
|
3665
|
+
if (accessError || !hasAccess) throw new Error("Access denied");
|
|
3656
3666
|
const { data: maxStep } = await supabase.from("roadmap_chunks").select("step_number").eq("project_id", projectId).order("step_number", { ascending: false }).limit(1).single();
|
|
3657
3667
|
const nextStepNum = (maxStep?.step_number || 0) + 1;
|
|
3658
3668
|
const { data, error } = await supabase.from("roadmap_chunks").insert({
|