@rigstate/mcp 0.6.5 → 0.7.1

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 { 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(3);
1941
- const { data: roadmapItems } = await supabase.from("roadmap_chunks").select("title, status, updated_at").eq("project_id", projectId).order("updated_at", { ascending: false }).limit(3);
1940
+ const [activeTaskResult, nextTaskResult] = await Promise.all([
1941
+ supabase.from("roadmap_chunks").select("id, title, step_number, role, instruction_set").eq("project_id", projectId).eq("status", "IN_PROGRESS").limit(1).maybeSingle(),
1942
+ supabase.from("roadmap_chunks").select("id, title, step_number, role").eq("project_id", projectId).eq("status", "PENDING").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})`);
@@ -4207,6 +4236,9 @@ async function main() {
4207
4236
  }
4208
4237
  const { supabase, userId } = authResult.context;
4209
4238
  startFrankWatcher(supabase, userId);
4239
+ const apiUrl = process.env.RIGSTATE_APP_URL || "https://app.rigstate.com";
4240
+ console.error(`Status: Connected to Rigstate Cloud (${apiUrl})`);
4241
+ console.error(`Project Context: Secured via RPC`);
4210
4242
  const server = createMcpServer();
4211
4243
  setupToolHandlers(server, { supabase, userId });
4212
4244
  const transport = new StdioServerTransport();