@rigstate/mcp 0.6.6 → 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 +31 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/tools/get-project-context.ts +52 -3
package/package.json
CHANGED
|
@@ -92,21 +92,45 @@ export async function getProjectContext(
|
|
|
92
92
|
// DNA is now directly available
|
|
93
93
|
const stackDef = (projectRow.architectural_dna as any)?.stack_definition;
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
// Continuity Loop: Fetch Active & Next Tasks
|
|
98
|
+
const [activeTaskResult, nextTaskResult] = await Promise.all([
|
|
99
|
+
supabase
|
|
100
|
+
.from('roadmap_chunks')
|
|
101
|
+
.select('id, title, step_number, role, instruction_set')
|
|
102
|
+
.eq('project_id', projectId)
|
|
103
|
+
.eq('status', 'IN_PROGRESS')
|
|
104
|
+
.limit(1)
|
|
105
|
+
.maybeSingle(),
|
|
106
|
+
supabase
|
|
107
|
+
.from('roadmap_chunks')
|
|
108
|
+
.select('id, title, step_number, role')
|
|
109
|
+
.eq('project_id', projectId)
|
|
110
|
+
.eq('status', 'PENDING')
|
|
111
|
+
.order('step_number', { ascending: true })
|
|
112
|
+
.limit(1)
|
|
113
|
+
.maybeSingle()
|
|
114
|
+
]);
|
|
115
|
+
|
|
116
|
+
const activeTask = activeTaskResult.data;
|
|
117
|
+
const nextTask = nextTaskResult.data;
|
|
118
|
+
|
|
119
|
+
// Fetch Digest Data (Reduced to 2 to save tokens)
|
|
96
120
|
const { data: agentTasks } = await supabase
|
|
97
121
|
.from('agent_bridge')
|
|
98
122
|
.select('id, roadmap_chunks(title), execution_summary, completed_at')
|
|
99
123
|
.eq('project_id', projectId)
|
|
100
124
|
.eq('status', 'COMPLETED')
|
|
101
125
|
.order('completed_at', { ascending: false })
|
|
102
|
-
.limit(
|
|
126
|
+
.limit(2);
|
|
103
127
|
|
|
104
128
|
const { data: roadmapItems } = await supabase
|
|
105
129
|
.from('roadmap_chunks')
|
|
106
130
|
.select('title, status, updated_at')
|
|
107
131
|
.eq('project_id', projectId)
|
|
108
132
|
.order('updated_at', { ascending: false })
|
|
109
|
-
.limit(
|
|
133
|
+
.limit(2);
|
|
110
134
|
|
|
111
135
|
// Parse tech stack from detected_stack
|
|
112
136
|
const techStack: TechStackInfo = {
|
|
@@ -158,6 +182,31 @@ export async function getProjectContext(
|
|
|
158
182
|
|
|
159
183
|
// Add DNA Stack Info if available (Truth)
|
|
160
184
|
if (stackDef) {
|
|
185
|
+
summaryParts.push('\n=== ACTIVE MISSION PARAMETERS ===');
|
|
186
|
+
if (activeTask) {
|
|
187
|
+
summaryParts.push(`⚠️ CURRENT OBJECTIVE: T-${activeTask.step_number}: ${activeTask.title}`);
|
|
188
|
+
summaryParts.push(` Role: ${activeTask.role || 'Developer'}`);
|
|
189
|
+
if (activeTask.instruction_set) {
|
|
190
|
+
summaryParts.push(` Instructions: ${activeTask.instruction_set.substring(0, 200)}...`);
|
|
191
|
+
}
|
|
192
|
+
summaryParts.push(' ACTION: Focus ALL coding efforts on completing this task.');
|
|
193
|
+
} else if (nextTask) {
|
|
194
|
+
summaryParts.push(`⏸ SYSTEM IDLE (Waiting for command)`);
|
|
195
|
+
summaryParts.push(` Suggested Next Mission: T-${nextTask.step_number}: ${nextTask.title}`);
|
|
196
|
+
summaryParts.push(` ACTION: Ask the user "Shall we start T-${nextTask.step_number}?"`);
|
|
197
|
+
} else {
|
|
198
|
+
summaryParts.push('✅ ALL MISSIONS COMPLETE. Awaiting new roadmap items.');
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
summaryParts.push('\n=== AI BEHAVIORAL INSTRUCTIONS ===');
|
|
202
|
+
if (activeTask) {
|
|
203
|
+
summaryParts.push(`1. FOCUS: The user is working on T-${activeTask.step_number}. Help them complete it.`);
|
|
204
|
+
summaryParts.push(`2. COMPLIANCE: Ensure all code follows project standards.`);
|
|
205
|
+
} else if (nextTask) {
|
|
206
|
+
summaryParts.push(`1. NUDGE: No active task found. Suggest starting T-${nextTask.step_number} (${nextTask.title}).`);
|
|
207
|
+
summaryParts.push(`2. PROACTIVE: Instead of asking "How can I help?", ask "Shall we start on T-${nextTask.step_number}?"`);
|
|
208
|
+
}
|
|
209
|
+
|
|
161
210
|
summaryParts.push('\n=== CURRENT STACK ===');
|
|
162
211
|
if (stackDef.frontend) summaryParts.push(`Frontend: ${stackDef.frontend.framework} (${stackDef.frontend.language})`);
|
|
163
212
|
if (stackDef.backend) summaryParts.push(`Backend: ${stackDef.backend.service} (${stackDef.backend.database})`);
|