@rigstate/mcp 0.7.10 → 0.7.13

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
@@ -1913,7 +1913,7 @@ async function buildProjectSummary(project, techStack, activeTask, nextTask, age
1913
1913
  summaryParts.push(` Role: ${activeTask.role || "Developer"}`);
1914
1914
  const detailedInstructions = activeTask.prompt_content || activeTask.instruction_set;
1915
1915
  if (detailedInstructions) {
1916
- summaryParts.push(` Instructions: ${detailedInstructions.substring(0, 1e3)}...`);
1916
+ summaryParts.push(` Instructions: ${detailedInstructions}`);
1917
1917
  }
1918
1918
  if (activeTask.architectural_brief) {
1919
1919
  summaryParts.push(`
@@ -2373,18 +2373,46 @@ async function saveDecision(supabase, userId, projectId, title, decision, ration
2373
2373
  }
2374
2374
  const fullContent = contentParts.join("\n");
2375
2375
  const summary = decision.length > 150 ? decision.substring(0, 147) + "..." : decision;
2376
- const { data: memory, error: insertError } = await supabase.from("project_memories").insert({
2377
- project_id: projectId,
2378
- content: fullContent,
2379
- summary,
2380
- category,
2381
- tags: ["ADR", ...tags],
2382
- importance: 9,
2383
- // High importance for decisions
2384
- source_type: "mcp",
2385
- // Track source as MCP
2386
- is_active: true
2387
- }).select("id").single();
2376
+ let memoryId = null;
2377
+ let insertError = null;
2378
+ try {
2379
+ const { data, error } = await supabase.rpc("save_project_memory_secure", {
2380
+ p_project_id: projectId,
2381
+ p_user_id: userId,
2382
+ p_content: fullContent,
2383
+ p_category: category,
2384
+ p_tags: ["ADR", ...tags],
2385
+ p_importance: 9,
2386
+ p_source_type: "mcp"
2387
+ });
2388
+ if (error) {
2389
+ insertError = error;
2390
+ } else {
2391
+ memoryId = data;
2392
+ }
2393
+ } catch (e) {
2394
+ insertError = e;
2395
+ }
2396
+ if (!memoryId) {
2397
+ const { data: memory, error } = await supabase.from("project_memories").insert({
2398
+ project_id: projectId,
2399
+ content: fullContent,
2400
+ summary,
2401
+ category,
2402
+ tags: ["ADR", ...tags],
2403
+ importance: 9,
2404
+ // High importance for decisions
2405
+ source_type: "mcp",
2406
+ // Track source as MCP
2407
+ is_active: true
2408
+ }).select("id").single();
2409
+ if (error) {
2410
+ insertError = error;
2411
+ } else if (memory) {
2412
+ memoryId = memory.id;
2413
+ insertError = null;
2414
+ }
2415
+ }
2388
2416
  if (insertError) {
2389
2417
  if (insertError.code === "23503") {
2390
2418
  throw new Error("Project no longer exists");
@@ -2396,7 +2424,7 @@ async function saveDecision(supabase, userId, projectId, title, decision, ration
2396
2424
  }
2397
2425
  return {
2398
2426
  success: true,
2399
- memoryId: memory.id,
2427
+ memoryId,
2400
2428
  message: `\u2705 Decision "${title}" saved to project "${project?.name || projectId}" with importance 9/10`
2401
2429
  };
2402
2430
  }
@@ -2868,8 +2896,27 @@ async function listRoadmapTasks(supabase, userId, projectId) {
2868
2896
  });
2869
2897
  const formatted = activeTasks.length > 0 ? activeTasks.map((t) => {
2870
2898
  const statusEmoji = t.status === "ACTIVE" ? "\u{1F535}" : "\u{1F512}";
2871
- return `${statusEmoji} Step ${t.step_number}: ${t.title} (ID: ${t.id})`;
2872
- }).join("\n") : "No active or locked tasks found in the roadmap.";
2899
+ const priorityBadge = t.priority ? `[${t.priority}]` : "";
2900
+ const tags = t.tags && t.tags.length > 0 ? `Tags: ${t.tags.join(", ")}` : "";
2901
+ let details = `${statusEmoji} Step ${t.step_number}: ${t.title} ${priorityBadge} (ID: ${t.id})`;
2902
+ if (t.description) {
2903
+ details += `
2904
+ Description: ${t.description.substring(0, 150)}${t.description.length > 150 ? "..." : ""}`;
2905
+ }
2906
+ if (tags) {
2907
+ details += `
2908
+ ${tags}`;
2909
+ }
2910
+ if (t.prompt_content) {
2911
+ details += `
2912
+ Instruction Preview: ${t.prompt_content.substring(0, 100).replace(/\n/g, " ")}...`;
2913
+ }
2914
+ if (t.architectural_brief) {
2915
+ details += `
2916
+ Arch Brief: ${t.architectural_brief.substring(0, 100).replace(/\n/g, " ")}...`;
2917
+ }
2918
+ return details;
2919
+ }).join("\n\n") : "No active or locked tasks found in the roadmap.";
2873
2920
  return {
2874
2921
  tasks: activeTasks.map((t) => ({
2875
2922
  id: t.id,