midas-mcp 5.4.0 → 5.15.0
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/analyzer.d.ts +0 -10
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +1 -24
- package/dist/analyzer.js.map +1 -1
- package/dist/context.d.ts +6 -70
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +6 -425
- package/dist/context.js.map +1 -1
- package/dist/docs/prd.md +5 -0
- package/dist/reality.d.ts +64 -8
- package/dist/reality.d.ts.map +1 -1
- package/dist/reality.js +523 -67
- package/dist/reality.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +2 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/reality.d.ts +45 -4
- package/dist/tools/reality.d.ts.map +1 -1
- package/dist/tools/reality.js +71 -7
- package/dist/tools/reality.js.map +1 -1
- package/dist/tools/verify.d.ts +6 -0
- package/dist/tools/verify.d.ts.map +1 -1
- package/dist/tools/verify.js +21 -0
- package/dist/tools/verify.js.map +1 -1
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +146 -25
- package/dist/tui.js.map +1 -1
- package/docs/prd.md +5 -0
- package/package.json +1 -1
package/dist/context.js
CHANGED
|
@@ -1,433 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Context
|
|
2
|
+
* Context Utilities for Midas
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Token estimation for prompt building.
|
|
5
|
+
*
|
|
6
|
+
* Note: Context compression via system/user prompt split is handled in analyzer.ts.
|
|
7
|
+
* The system prompt contains stable methodology (cached by Claude API).
|
|
8
|
+
* The user prompt contains dynamic project state (not cached).
|
|
8
9
|
*/
|
|
9
|
-
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
10
|
-
import { join } from 'path';
|
|
11
|
-
import { loadState } from './state/phase.js';
|
|
12
|
-
import { loadTracker, getGatesStatus, getUnresolvedErrors } from './tracker.js';
|
|
13
|
-
import { getJournalEntries } from './tools/journal.js';
|
|
14
|
-
import { sanitizePath } from './security.js';
|
|
15
|
-
const MIDAS_DIR = '.midas';
|
|
16
|
-
const CACHE_FILE = 'context-cache.json';
|
|
17
10
|
// Token estimation (rough: 1 token ≈ 4 chars for English)
|
|
18
11
|
export function estimateTokens(text) {
|
|
19
12
|
return Math.ceil(text.length / 4);
|
|
20
13
|
}
|
|
21
|
-
function getCachePath(projectPath) {
|
|
22
|
-
return join(projectPath, MIDAS_DIR, CACHE_FILE);
|
|
23
|
-
}
|
|
24
|
-
function loadCache(projectPath) {
|
|
25
|
-
const path = getCachePath(projectPath);
|
|
26
|
-
if (existsSync(path)) {
|
|
27
|
-
try {
|
|
28
|
-
return JSON.parse(readFileSync(path, 'utf-8'));
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return {};
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return {};
|
|
35
|
-
}
|
|
36
|
-
function saveCache(projectPath, cache) {
|
|
37
|
-
const dir = join(projectPath, MIDAS_DIR);
|
|
38
|
-
if (!existsSync(dir)) {
|
|
39
|
-
mkdirSync(dir, { recursive: true });
|
|
40
|
-
}
|
|
41
|
-
writeFileSync(getCachePath(projectPath), JSON.stringify(cache, null, 2));
|
|
42
|
-
}
|
|
43
|
-
export function getCachedSummary(projectPath, content, maxTokens) {
|
|
44
|
-
const cache = loadCache(projectPath);
|
|
45
|
-
const key = `${simpleHash(content)}-${maxTokens}`;
|
|
46
|
-
const entry = cache[key];
|
|
47
|
-
if (entry && Date.now() - entry.timestamp < 3600000) { // 1 hour cache
|
|
48
|
-
return entry.summary;
|
|
49
|
-
}
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
export function setCachedSummary(projectPath, content, maxTokens, summary) {
|
|
53
|
-
const cache = loadCache(projectPath);
|
|
54
|
-
const key = `${simpleHash(content)}-${maxTokens}`;
|
|
55
|
-
cache[key] = {
|
|
56
|
-
summary,
|
|
57
|
-
timestamp: Date.now(),
|
|
58
|
-
originalTokens: estimateTokens(content),
|
|
59
|
-
summaryTokens: estimateTokens(summary),
|
|
60
|
-
};
|
|
61
|
-
// Keep cache size reasonable (max 100 entries)
|
|
62
|
-
const keys = Object.keys(cache);
|
|
63
|
-
if (keys.length > 100) {
|
|
64
|
-
const oldest = keys
|
|
65
|
-
.sort((a, b) => cache[a].timestamp - cache[b].timestamp)
|
|
66
|
-
.slice(0, 20);
|
|
67
|
-
oldest.forEach(k => delete cache[k]);
|
|
68
|
-
}
|
|
69
|
-
saveCache(projectPath, cache);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Get cache statistics for monitoring
|
|
73
|
-
*/
|
|
74
|
-
export function getCacheStats(projectPath) {
|
|
75
|
-
const cache = loadCache(projectPath);
|
|
76
|
-
const entries = Object.values(cache);
|
|
77
|
-
const totalOriginal = entries.reduce((sum, e) => sum + e.originalTokens, 0);
|
|
78
|
-
const totalSummary = entries.reduce((sum, e) => sum + e.summaryTokens, 0);
|
|
79
|
-
return {
|
|
80
|
-
entries: entries.length,
|
|
81
|
-
totalOriginalTokens: totalOriginal,
|
|
82
|
-
totalSummaryTokens: totalSummary,
|
|
83
|
-
tokensSaved: totalOriginal - totalSummary,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
function simpleHash(str) {
|
|
87
|
-
let hash = 0;
|
|
88
|
-
for (let i = 0; i < str.length; i++) {
|
|
89
|
-
const char = str.charCodeAt(i);
|
|
90
|
-
hash = ((hash << 5) - hash) + char;
|
|
91
|
-
hash = hash & hash;
|
|
92
|
-
}
|
|
93
|
-
return Math.abs(hash).toString(36);
|
|
94
|
-
}
|
|
95
|
-
// ============================================================================
|
|
96
|
-
// COMPRESSION STRATEGIES
|
|
97
|
-
// ============================================================================
|
|
98
|
-
/**
|
|
99
|
-
* Truncate text to approximate token limit, preferring sentence boundaries
|
|
100
|
-
*/
|
|
101
|
-
export function truncateToTokens(text, maxTokens) {
|
|
102
|
-
const currentTokens = estimateTokens(text);
|
|
103
|
-
if (currentTokens <= maxTokens)
|
|
104
|
-
return text;
|
|
105
|
-
const targetChars = maxTokens * 4;
|
|
106
|
-
let truncated = text.slice(0, targetChars);
|
|
107
|
-
// Try to end at sentence boundary
|
|
108
|
-
const lastPeriod = truncated.lastIndexOf('. ');
|
|
109
|
-
const lastNewline = truncated.lastIndexOf('\n');
|
|
110
|
-
const boundary = Math.max(lastPeriod, lastNewline);
|
|
111
|
-
if (boundary > targetChars * 0.7) {
|
|
112
|
-
truncated = truncated.slice(0, boundary + 1);
|
|
113
|
-
}
|
|
114
|
-
return truncated + '...';
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Extract key points from text (simple keyword-based)
|
|
118
|
-
*/
|
|
119
|
-
export function extractKeyPoints(text, maxPoints = 5) {
|
|
120
|
-
const lines = text.split('\n').filter(l => l.trim());
|
|
121
|
-
const points = [];
|
|
122
|
-
// Prioritize lines with key indicators
|
|
123
|
-
const keyIndicators = ['error', 'fix', 'implement', 'test', 'build', 'deploy', 'decision', 'chose', 'because'];
|
|
124
|
-
for (const line of lines) {
|
|
125
|
-
if (points.length >= maxPoints)
|
|
126
|
-
break;
|
|
127
|
-
const lower = line.toLowerCase();
|
|
128
|
-
if (keyIndicators.some(k => lower.includes(k))) {
|
|
129
|
-
points.push(line.trim().slice(0, 100));
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
// Fill with first lines if not enough
|
|
133
|
-
for (const line of lines) {
|
|
134
|
-
if (points.length >= maxPoints)
|
|
135
|
-
break;
|
|
136
|
-
if (!points.includes(line.trim().slice(0, 100))) {
|
|
137
|
-
points.push(line.trim().slice(0, 100));
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return points;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Hierarchical summarization - more detail for recent, less for old
|
|
144
|
-
* Level 1 (most recent): Title + 3 key points
|
|
145
|
-
* Level 2 (recent): Title + 1 key point
|
|
146
|
-
* Level 3 (older): Just title
|
|
147
|
-
*/
|
|
148
|
-
export function summarizeJournalEntries(entries) {
|
|
149
|
-
if (entries.length === 0)
|
|
150
|
-
return 'No journal entries.';
|
|
151
|
-
const lines = [];
|
|
152
|
-
for (let i = 0; i < entries.length && i < 7; i++) {
|
|
153
|
-
const entry = entries[i];
|
|
154
|
-
const date = entry.timestamp.slice(0, 10);
|
|
155
|
-
if (i === 0) {
|
|
156
|
-
// Most recent: full detail
|
|
157
|
-
const keyPoints = extractKeyPoints(entry.conversation, 3);
|
|
158
|
-
lines.push(`- ${date}: ${entry.title}`);
|
|
159
|
-
keyPoints.forEach(p => lines.push(` > ${p.slice(0, 100)}`));
|
|
160
|
-
}
|
|
161
|
-
else if (i < 3) {
|
|
162
|
-
// Recent: title + 1 key point
|
|
163
|
-
const keyPoints = extractKeyPoints(entry.conversation, 1);
|
|
164
|
-
lines.push(`- ${date}: ${entry.title}`);
|
|
165
|
-
if (keyPoints.length > 0) {
|
|
166
|
-
lines.push(` > ${keyPoints[0].slice(0, 80)}`);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
// Older: just title
|
|
171
|
-
lines.push(`- ${date}: ${entry.title}`);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return lines.join('\n');
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Get code snippets from recently modified files.
|
|
178
|
-
* Read substantially more context for accurate analysis.
|
|
179
|
-
*/
|
|
180
|
-
export function getCodeSnippets(projectPath, maxFiles = 15, maxLinesPerFile = 100) {
|
|
181
|
-
const tracker = loadTracker(projectPath);
|
|
182
|
-
const snippets = [];
|
|
183
|
-
const codeExtensions = ['.ts', '.tsx', '.js', '.jsx', '.py', '.go', '.rs', '.swift'];
|
|
184
|
-
// Prioritize test files and key entry points
|
|
185
|
-
const allCodeFiles = tracker.recentFiles.filter(f => codeExtensions.some(ext => f.path.endsWith(ext)));
|
|
186
|
-
const priorityPatterns = ['.test.', '.spec.', 'index.', 'main.', 'app.', 'server.'];
|
|
187
|
-
const priorityFiles = allCodeFiles.filter(f => priorityPatterns.some(p => f.path.includes(p)));
|
|
188
|
-
const otherFiles = allCodeFiles.filter(f => !priorityPatterns.some(p => f.path.includes(p)));
|
|
189
|
-
const recentCodeFiles = [...priorityFiles, ...otherFiles].slice(0, maxFiles);
|
|
190
|
-
for (const file of recentCodeFiles) {
|
|
191
|
-
try {
|
|
192
|
-
const fullPath = join(projectPath, file.path);
|
|
193
|
-
if (!existsSync(fullPath))
|
|
194
|
-
continue;
|
|
195
|
-
const content = readFileSync(fullPath, 'utf-8');
|
|
196
|
-
const lines = content.split('\n');
|
|
197
|
-
// For large files, take beginning + end (important context at both ends)
|
|
198
|
-
let snippet;
|
|
199
|
-
if (lines.length <= maxLinesPerFile) {
|
|
200
|
-
snippet = content;
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
const head = lines.slice(0, Math.floor(maxLinesPerFile * 0.7));
|
|
204
|
-
const tail = lines.slice(-Math.floor(maxLinesPerFile * 0.3));
|
|
205
|
-
snippet = [...head, '\n// ... middle truncated ...\n', ...tail].join('\n');
|
|
206
|
-
}
|
|
207
|
-
snippets.push(`--- ${file.path} ---\n${snippet}`);
|
|
208
|
-
}
|
|
209
|
-
catch {
|
|
210
|
-
// Skip files we can't read
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
return snippets.join('\n\n');
|
|
214
|
-
}
|
|
215
|
-
// ============================================================================
|
|
216
|
-
// CONTEXT BUILDING
|
|
217
|
-
// ============================================================================
|
|
218
|
-
const METHODOLOGY_COMPRESSED = `Golden Code: PLAN (plan) → BUILD (code) → SHIP (deploy) → GROW (iterate)
|
|
219
|
-
BUILD cycle: RULES → INDEX → READ → RESEARCH → IMPLEMENT → TEST → DEBUG
|
|
220
|
-
If stuck: Tornado (research + logs + tests). If output doesn't fit: Horizon (expand context).
|
|
221
|
-
Gates must pass (build/test/lint) before advancing.`;
|
|
222
|
-
export function buildCompressedContext(projectPath, options = {}) {
|
|
223
|
-
const safePath = sanitizePath(projectPath);
|
|
224
|
-
// Dynamic budget: increase when errors present
|
|
225
|
-
const errors = getUnresolvedErrors(safePath);
|
|
226
|
-
const hasErrors = errors.length > 0;
|
|
227
|
-
const baseTokens = options.maxTokens || 4000;
|
|
228
|
-
// Give 50% more budget when debugging errors
|
|
229
|
-
const maxTokens = hasErrors ? Math.floor(baseTokens * 1.5) : baseTokens;
|
|
230
|
-
const includeCode = options.includeCode ?? true; // Default to including code
|
|
231
|
-
const layers = [];
|
|
232
|
-
let totalTokens = 0;
|
|
233
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
234
|
-
// BEGINNING: Stable context (high attention)
|
|
235
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
236
|
-
// Layer 1: Methodology (always, ~100 tokens)
|
|
237
|
-
layers.push({
|
|
238
|
-
name: 'methodology',
|
|
239
|
-
priority: 'critical',
|
|
240
|
-
position: 'beginning',
|
|
241
|
-
content: METHODOLOGY_COMPRESSED,
|
|
242
|
-
tokens: estimateTokens(METHODOLOGY_COMPRESSED),
|
|
243
|
-
});
|
|
244
|
-
// Layer 2: Current state
|
|
245
|
-
const state = loadState(safePath);
|
|
246
|
-
const tracker = loadTracker(safePath);
|
|
247
|
-
const gatesStatus = getGatesStatus(safePath);
|
|
248
|
-
const stateContent = [
|
|
249
|
-
`Phase: ${state.current.phase}${'step' in state.current ? ` → ${state.current.step}` : ''}`,
|
|
250
|
-
`Gates: ${gatesStatus.allPass ? 'ALL PASS' : gatesStatus.failing.length > 0 ? `FAILING: ${gatesStatus.failing.join(', ')}` : 'not run'}`,
|
|
251
|
-
tracker.currentTask ? `Task: ${tracker.currentTask.description}` : '',
|
|
252
|
-
].filter(Boolean).join('\n');
|
|
253
|
-
layers.push({
|
|
254
|
-
name: 'current_state',
|
|
255
|
-
priority: 'critical',
|
|
256
|
-
position: 'beginning',
|
|
257
|
-
content: stateContent,
|
|
258
|
-
tokens: estimateTokens(stateContent),
|
|
259
|
-
});
|
|
260
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
261
|
-
// MIDDLE: Project context (lower attention, summarized)
|
|
262
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
263
|
-
// Layer 3: Journal summaries
|
|
264
|
-
const journalEntries = getJournalEntries({ projectPath: safePath, limit: 5 });
|
|
265
|
-
const journalSummary = summarizeJournalEntries(journalEntries);
|
|
266
|
-
layers.push({
|
|
267
|
-
name: 'journal_summary',
|
|
268
|
-
priority: 'medium',
|
|
269
|
-
position: 'middle',
|
|
270
|
-
content: `Past sessions:\n${journalSummary}`,
|
|
271
|
-
tokens: estimateTokens(journalSummary),
|
|
272
|
-
});
|
|
273
|
-
// Layer 4: Recent files (just names)
|
|
274
|
-
if (tracker.recentFiles.length > 0) {
|
|
275
|
-
const fileList = tracker.recentFiles.slice(0, 10).map(f => f.path).join(', ');
|
|
276
|
-
layers.push({
|
|
277
|
-
name: 'recent_files',
|
|
278
|
-
priority: 'low',
|
|
279
|
-
position: 'middle',
|
|
280
|
-
content: `Recently modified: ${fileList}`,
|
|
281
|
-
tokens: estimateTokens(fileList) + 20,
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
// Layer 4b: Code snippets (if enabled and budget allows)
|
|
285
|
-
if (includeCode && tracker.recentFiles.length > 0) {
|
|
286
|
-
const snippets = getCodeSnippets(safePath, 3, 15);
|
|
287
|
-
if (snippets.length > 0) {
|
|
288
|
-
const snippetTokens = estimateTokens(snippets);
|
|
289
|
-
// Only include if it fits in 20% of budget
|
|
290
|
-
if (snippetTokens < maxTokens * 0.2) {
|
|
291
|
-
layers.push({
|
|
292
|
-
name: 'code_snippets',
|
|
293
|
-
priority: 'medium',
|
|
294
|
-
position: 'middle',
|
|
295
|
-
content: `Recent code:\n${snippets}`,
|
|
296
|
-
tokens: snippetTokens + 20,
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
302
|
-
// END: Recent context (high attention, full detail)
|
|
303
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
304
|
-
// Layer 5: Unresolved errors (ALL - critical for debugging)
|
|
305
|
-
// Note: 'errors' already loaded at top for dynamic budget calculation
|
|
306
|
-
if (errors.length > 0) {
|
|
307
|
-
const errorContent = errors.slice(0, 10).map(e => {
|
|
308
|
-
const attempts = e.fixAttempts.length > 0
|
|
309
|
-
? ` (tried ${e.fixAttempts.length}x: ${e.fixAttempts.map(a => a.approach).join(', ')})`
|
|
310
|
-
: '';
|
|
311
|
-
const location = e.file ? ` [${e.file}${e.line ? `:${e.line}` : ''}]` : '';
|
|
312
|
-
return `ERROR${location}: ${e.error}${attempts}`;
|
|
313
|
-
}).join('\n\n');
|
|
314
|
-
layers.push({
|
|
315
|
-
name: 'errors',
|
|
316
|
-
priority: 'high',
|
|
317
|
-
position: 'end',
|
|
318
|
-
content: errorContent,
|
|
319
|
-
tokens: estimateTokens(errorContent),
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
// Layer 6: Recent tool calls (more context for understanding workflow)
|
|
323
|
-
if (tracker.recentToolCalls.length > 0) {
|
|
324
|
-
const toolContent = tracker.recentToolCalls.slice(0, 15).map(t => {
|
|
325
|
-
const ago = Math.round((Date.now() - t.timestamp) / 60000);
|
|
326
|
-
return `${t.tool} (${ago}m ago)`;
|
|
327
|
-
}).join('\n');
|
|
328
|
-
layers.push({
|
|
329
|
-
name: 'recent_tools',
|
|
330
|
-
priority: 'medium',
|
|
331
|
-
position: 'end',
|
|
332
|
-
content: `Recent actions:\n${toolContent}`,
|
|
333
|
-
tokens: estimateTokens(toolContent) + 20,
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
// Layer 7: Current task (if set)
|
|
337
|
-
if (options.taskDescription) {
|
|
338
|
-
layers.push({
|
|
339
|
-
name: 'current_task',
|
|
340
|
-
priority: 'critical',
|
|
341
|
-
position: 'end',
|
|
342
|
-
content: `CURRENT TASK: ${options.taskDescription}`,
|
|
343
|
-
tokens: estimateTokens(options.taskDescription) + 20,
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
347
|
-
// ASSEMBLE: Fit within token budget
|
|
348
|
-
// ─────────────────────────────────────────────────────────────────────────
|
|
349
|
-
// Sort by priority and position
|
|
350
|
-
const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
|
|
351
|
-
const positionOrder = { beginning: 0, end: 1, middle: 2 };
|
|
352
|
-
layers.sort((a, b) => {
|
|
353
|
-
const priorityDiff = priorityOrder[a.priority] - priorityOrder[b.priority];
|
|
354
|
-
if (priorityDiff !== 0)
|
|
355
|
-
return priorityDiff;
|
|
356
|
-
return positionOrder[a.position] - positionOrder[b.position];
|
|
357
|
-
});
|
|
358
|
-
// Include layers until token limit
|
|
359
|
-
const included = [];
|
|
360
|
-
let usedTokens = 0;
|
|
361
|
-
let truncated = false;
|
|
362
|
-
for (const layer of layers) {
|
|
363
|
-
if (usedTokens + layer.tokens <= maxTokens) {
|
|
364
|
-
included.push(layer);
|
|
365
|
-
usedTokens += layer.tokens;
|
|
366
|
-
}
|
|
367
|
-
else if (layer.priority === 'critical') {
|
|
368
|
-
// Always include critical, even if truncated
|
|
369
|
-
const available = maxTokens - usedTokens;
|
|
370
|
-
if (available > 100) {
|
|
371
|
-
const truncatedContent = truncateToTokens(layer.content, available);
|
|
372
|
-
included.push({
|
|
373
|
-
...layer,
|
|
374
|
-
content: truncatedContent,
|
|
375
|
-
tokens: estimateTokens(truncatedContent),
|
|
376
|
-
});
|
|
377
|
-
usedTokens += estimateTokens(truncatedContent);
|
|
378
|
-
truncated = true;
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
else {
|
|
382
|
-
truncated = true;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
// Re-sort by position for final output
|
|
386
|
-
included.sort((a, b) => positionOrder[a.position] - positionOrder[b.position]);
|
|
387
|
-
return {
|
|
388
|
-
layers: included,
|
|
389
|
-
totalTokens: usedTokens,
|
|
390
|
-
truncated,
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* Convert compressed context to a single string for the API
|
|
395
|
-
*/
|
|
396
|
-
export function contextToString(context) {
|
|
397
|
-
const sections = [];
|
|
398
|
-
const beginning = context.layers.filter(l => l.position === 'beginning');
|
|
399
|
-
const middle = context.layers.filter(l => l.position === 'middle');
|
|
400
|
-
const end = context.layers.filter(l => l.position === 'end');
|
|
401
|
-
if (beginning.length > 0) {
|
|
402
|
-
sections.push('# METHODOLOGY & STATE\n' + beginning.map(l => l.content).join('\n\n'));
|
|
403
|
-
}
|
|
404
|
-
if (middle.length > 0) {
|
|
405
|
-
sections.push('# PROJECT CONTEXT\n' + middle.map(l => l.content).join('\n\n'));
|
|
406
|
-
}
|
|
407
|
-
if (end.length > 0) {
|
|
408
|
-
sections.push('# CURRENT SITUATION\n' + end.map(l => l.content).join('\n\n'));
|
|
409
|
-
}
|
|
410
|
-
return sections.join('\n\n---\n\n');
|
|
411
|
-
}
|
|
412
|
-
/**
|
|
413
|
-
* Get context stats for debugging/monitoring
|
|
414
|
-
*/
|
|
415
|
-
export function getContextStats(projectPath) {
|
|
416
|
-
const context = buildCompressedContext(projectPath);
|
|
417
|
-
const layerBreakdown = {};
|
|
418
|
-
for (const layer of context.layers) {
|
|
419
|
-
layerBreakdown[layer.name] = layer.tokens;
|
|
420
|
-
}
|
|
421
|
-
// Estimate what full context would be
|
|
422
|
-
const tracker = loadTracker(projectPath);
|
|
423
|
-
const journal = getJournalEntries({ projectPath, limit: 10 });
|
|
424
|
-
const fullEstimate = estimateTokens(METHODOLOGY_COMPRESSED) * 5 + // Full methodology
|
|
425
|
-
tracker.recentFiles.length * 500 + // File contents
|
|
426
|
-
journal.reduce((sum, j) => sum + estimateTokens(j.conversation), 0);
|
|
427
|
-
return {
|
|
428
|
-
estimatedTokens: context.totalTokens,
|
|
429
|
-
layerBreakdown,
|
|
430
|
-
compressionRatio: fullEstimate > 0 ? context.totalTokens / fullEstimate : 1,
|
|
431
|
-
};
|
|
432
|
-
}
|
|
433
14
|
//# sourceMappingURL=context.js.map
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,SAAS,EAA0B,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,mBAAmB,EAAqB,MAAM,cAAc,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,0DAA0D;AAC1D,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACpC,CAAC;AAiCD,SAAS,YAAY,CAAC,WAAmB;IACvC,OAAO,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,SAAS,CAAC,WAAmB;IACpC,MAAM,IAAI,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IACvC,I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CHANGED
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
## User Stories
|
|
14
14
|
- As a [user type], I want to [action] so that [benefit]
|
|
15
15
|
|
|
16
|
+
## Target Geography
|
|
17
|
+
- Primary markets: [US, EU, Global, etc.]
|
|
18
|
+
- Data storage region: [AWS us-east-1, etc.]
|
|
19
|
+
- Regulatory considerations: [GDPR, CCPA, none, etc.]
|
|
20
|
+
|
|
16
21
|
## Technical Requirements
|
|
17
22
|
- [Performance, security, integration requirements]
|
|
18
23
|
|
package/dist/reality.d.ts
CHANGED
|
@@ -5,13 +5,39 @@
|
|
|
5
5
|
* categorizes them by what AI can/cannot do,
|
|
6
6
|
* and generates context-aware prompts for Cursor.
|
|
7
7
|
*/
|
|
8
|
+
export type RealityCheckStatus = 'pending' | 'completed' | 'skipped';
|
|
9
|
+
export interface PersistedCheckState {
|
|
10
|
+
status: RealityCheckStatus;
|
|
11
|
+
updatedAt: string;
|
|
12
|
+
skippedReason?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Update the status of a reality check
|
|
16
|
+
*/
|
|
17
|
+
export declare function updateCheckStatus(projectPath: string, checkKey: string, status: RealityCheckStatus, skippedReason?: string): void;
|
|
18
|
+
/**
|
|
19
|
+
* Get the persisted status for a check
|
|
20
|
+
*/
|
|
21
|
+
export declare function getCheckStatus(projectPath: string, checkKey: string): PersistedCheckState | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Get all check statuses
|
|
24
|
+
*/
|
|
25
|
+
export declare function getAllCheckStatuses(projectPath: string): Record<string, PersistedCheckState>;
|
|
26
|
+
/**
|
|
27
|
+
* Reset all check statuses (e.g., when profile changes significantly)
|
|
28
|
+
*/
|
|
29
|
+
export declare function resetCheckStatuses(projectPath: string): void;
|
|
8
30
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* - assistable: AI can help with checklist/guide, but needs professional verification
|
|
12
|
-
* - human_only: Requires real-world action (signup, purchase, certification)
|
|
31
|
+
* Detect if any expected output files exist and auto-complete checks
|
|
32
|
+
* Returns array of check keys that were auto-completed
|
|
13
33
|
*/
|
|
14
|
-
export
|
|
34
|
+
export declare function detectGeneratedDocs(projectPath: string): string[];
|
|
35
|
+
/**
|
|
36
|
+
* Two tiers of AI capability:
|
|
37
|
+
* - ai_assisted: AI can help (draft docs, create checklists, generate code)
|
|
38
|
+
* - manual: Requires real-world action (signup, purchase, certification)
|
|
39
|
+
*/
|
|
40
|
+
export type RealityTier = 'ai_assisted' | 'manual';
|
|
15
41
|
export interface RealityCheck {
|
|
16
42
|
key: string;
|
|
17
43
|
category: string;
|
|
@@ -23,6 +49,10 @@ export interface RealityCheck {
|
|
|
23
49
|
externalLinks?: string[];
|
|
24
50
|
alsoNeeded?: string[];
|
|
25
51
|
priority: 'critical' | 'high' | 'medium' | 'low';
|
|
52
|
+
triggeredBy: string;
|
|
53
|
+
status: RealityCheckStatus;
|
|
54
|
+
statusUpdatedAt?: string;
|
|
55
|
+
skippedReason?: string;
|
|
26
56
|
}
|
|
27
57
|
export interface ProjectProfile {
|
|
28
58
|
collectsUserData: boolean;
|
|
@@ -46,10 +76,14 @@ export interface RealityCheckResult {
|
|
|
46
76
|
summary: {
|
|
47
77
|
total: number;
|
|
48
78
|
critical: number;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
79
|
+
aiAssisted: number;
|
|
80
|
+
manual: number;
|
|
81
|
+
pending: number;
|
|
82
|
+
completed: number;
|
|
83
|
+
skipped: number;
|
|
52
84
|
};
|
|
85
|
+
totalAvailable?: number;
|
|
86
|
+
isFirstSession?: boolean;
|
|
53
87
|
}
|
|
54
88
|
/**
|
|
55
89
|
* Infer project profile from brainlift, PRD, and package.json
|
|
@@ -59,6 +93,28 @@ export declare function inferProjectProfile(projectPath: string): ProjectProfile
|
|
|
59
93
|
* Get all applicable reality checks for a project
|
|
60
94
|
*/
|
|
61
95
|
export declare function getRealityChecks(projectPath: string): RealityCheckResult;
|
|
96
|
+
/**
|
|
97
|
+
* AI-powered reality check filter
|
|
98
|
+
*
|
|
99
|
+
* Conservative defaults may miss edge cases. This AI pass:
|
|
100
|
+
* 1. Reviews the full project context
|
|
101
|
+
* 2. Filters out irrelevant checks (e.g., GDPR for US-only app)
|
|
102
|
+
* 3. Adds missing checks based on nuanced understanding
|
|
103
|
+
*
|
|
104
|
+
* Called only when API key is available, falls back to keyword-based otherwise.
|
|
105
|
+
*/
|
|
106
|
+
export declare function filterChecksWithAI(profile: ProjectProfile, checks: RealityCheck[], projectPath: string): Promise<{
|
|
107
|
+
filtered: RealityCheck[];
|
|
108
|
+
additions: string[];
|
|
109
|
+
removals: string[];
|
|
110
|
+
}>;
|
|
111
|
+
/**
|
|
112
|
+
* Get reality checks with AI filtering (async version)
|
|
113
|
+
* Use this when you want the most accurate checks
|
|
114
|
+
*/
|
|
115
|
+
export declare function getRealityChecksWithAI(projectPath: string): Promise<RealityCheckResult & {
|
|
116
|
+
aiFiltered: boolean;
|
|
117
|
+
}>;
|
|
62
118
|
/**
|
|
63
119
|
* Get tier symbol for display
|
|
64
120
|
*/
|
package/dist/reality.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reality.d.ts","sourceRoot":"","sources":["../src/reality.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"reality.d.ts","sourceRoot":"","sources":["../src/reality.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;AAErE,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAwCD;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,EAC1B,aAAa,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