@rigstate/mcp 0.6.6 → 0.7.2
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
|
@@ -1937,8 +1937,14 @@ async function getProjectContext(supabase, userId, projectId) {
|
|
|
1937
1937
|
repository_tree: projectRow.repository_tree
|
|
1938
1938
|
};
|
|
1939
1939
|
const stackDef = projectRow.architectural_dna?.stack_definition;
|
|
1940
|
-
const
|
|
1941
|
-
|
|
1940
|
+
const [activeTaskResult, nextTaskResult] = await Promise.all([
|
|
1941
|
+
supabase.from("roadmap_chunks").select("id, title, step_number, role, instruction_set").eq("project_id", projectId).in("status", ["IN_PROGRESS", "ACTIVE"]).limit(1).maybeSingle(),
|
|
1942
|
+
supabase.from("roadmap_chunks").select("id, title, step_number, role").eq("project_id", projectId).in("status", ["PENDING", "LOCKED"]).order("step_number", { ascending: true }).limit(1).maybeSingle()
|
|
1943
|
+
]);
|
|
1944
|
+
const activeTask = activeTaskResult.data;
|
|
1945
|
+
const nextTask = nextTaskResult.data;
|
|
1946
|
+
const { data: agentTasks } = await supabase.from("agent_bridge").select("id, roadmap_chunks(title), execution_summary, completed_at").eq("project_id", projectId).eq("status", "COMPLETED").order("completed_at", { ascending: false }).limit(2);
|
|
1947
|
+
const { data: roadmapItems } = await supabase.from("roadmap_chunks").select("title, status, updated_at").eq("project_id", projectId).order("updated_at", { ascending: false }).limit(2);
|
|
1942
1948
|
const techStack = {
|
|
1943
1949
|
framework: null,
|
|
1944
1950
|
orm: null,
|
|
@@ -1972,6 +1978,29 @@ async function getProjectContext(supabase, userId, projectId) {
|
|
|
1972
1978
|
const summaryParts = [];
|
|
1973
1979
|
summaryParts.push(`Project Type: ${project.project_type?.toUpperCase() || "UNKNOWN"}`);
|
|
1974
1980
|
if (stackDef) {
|
|
1981
|
+
summaryParts.push("\n=== ACTIVE MISSION PARAMETERS ===");
|
|
1982
|
+
if (activeTask) {
|
|
1983
|
+
summaryParts.push(`\u26A0\uFE0F CURRENT OBJECTIVE: T-${activeTask.step_number}: ${activeTask.title}`);
|
|
1984
|
+
summaryParts.push(` Role: ${activeTask.role || "Developer"}`);
|
|
1985
|
+
if (activeTask.instruction_set) {
|
|
1986
|
+
summaryParts.push(` Instructions: ${activeTask.instruction_set.substring(0, 200)}...`);
|
|
1987
|
+
}
|
|
1988
|
+
summaryParts.push(" ACTION: Focus ALL coding efforts on completing this task.");
|
|
1989
|
+
} else if (nextTask) {
|
|
1990
|
+
summaryParts.push(`\u23F8 SYSTEM IDLE (Waiting for command)`);
|
|
1991
|
+
summaryParts.push(` Suggested Next Mission: T-${nextTask.step_number}: ${nextTask.title}`);
|
|
1992
|
+
summaryParts.push(` ACTION: Ask the user "Shall we start T-${nextTask.step_number}?"`);
|
|
1993
|
+
} else {
|
|
1994
|
+
summaryParts.push("\u2705 ALL MISSIONS COMPLETE. Awaiting new roadmap items.");
|
|
1995
|
+
}
|
|
1996
|
+
summaryParts.push("\n=== AI BEHAVIORAL INSTRUCTIONS ===");
|
|
1997
|
+
if (activeTask) {
|
|
1998
|
+
summaryParts.push(`1. FOCUS: The user is working on T-${activeTask.step_number}. Help them complete it.`);
|
|
1999
|
+
summaryParts.push(`2. COMPLIANCE: Ensure all code follows project standards.`);
|
|
2000
|
+
} else if (nextTask) {
|
|
2001
|
+
summaryParts.push(`1. NUDGE: No active task found. Suggest starting T-${nextTask.step_number} (${nextTask.title}).`);
|
|
2002
|
+
summaryParts.push(`2. PROACTIVE: Instead of asking "How can I help?", ask "Shall we start on T-${nextTask.step_number}?"`);
|
|
2003
|
+
}
|
|
1975
2004
|
summaryParts.push("\n=== CURRENT STACK ===");
|
|
1976
2005
|
if (stackDef.frontend) summaryParts.push(`Frontend: ${stackDef.frontend.framework} (${stackDef.frontend.language})`);
|
|
1977
2006
|
if (stackDef.backend) summaryParts.push(`Backend: ${stackDef.backend.service} (${stackDef.backend.database})`);
|
|
@@ -2789,7 +2818,7 @@ async function getNextRoadmapStep(supabase, projectId, currentStepId) {
|
|
|
2789
2818
|
currentStepNumber = current.step_number;
|
|
2790
2819
|
}
|
|
2791
2820
|
} else {
|
|
2792
|
-
const { data: active } = await supabase.from("roadmap_chunks").select("step_number").eq("project_id", projectId).
|
|
2821
|
+
const { data: active } = await supabase.from("roadmap_chunks").select("step_number").eq("project_id", projectId).in("status", ["ACTIVE", "IN_PROGRESS"]).order("step_number", { ascending: true }).limit(1).single();
|
|
2793
2822
|
if (active) {
|
|
2794
2823
|
currentStepNumber = active.step_number;
|
|
2795
2824
|
}
|