cortex-mcp 1.2.4 → 1.4.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/db/memory-store.d.ts +2 -2
- package/dist/db/memory-store.d.ts.map +1 -1
- package/dist/db/memory-store.js +26 -4
- package/dist/db/memory-store.js.map +1 -1
- package/dist/memory/auto-learner.d.ts.map +1 -1
- package/dist/memory/auto-learner.js +62 -23
- package/dist/memory/auto-learner.js.map +1 -1
- package/dist/memory/convention-detector.d.ts +11 -0
- package/dist/memory/convention-detector.d.ts.map +1 -0
- package/dist/memory/convention-detector.js +294 -0
- package/dist/memory/convention-detector.js.map +1 -0
- package/dist/memory/correction-detector.d.ts +33 -0
- package/dist/memory/correction-detector.d.ts.map +1 -0
- package/dist/memory/correction-detector.js +129 -0
- package/dist/memory/correction-detector.js.map +1 -0
- package/dist/memory/error-learner.d.ts +26 -0
- package/dist/memory/error-learner.d.ts.map +1 -0
- package/dist/memory/error-learner.js +145 -0
- package/dist/memory/error-learner.js.map +1 -0
- package/dist/memory/file-relationships.d.ts +47 -0
- package/dist/memory/file-relationships.d.ts.map +1 -0
- package/dist/memory/file-relationships.js +130 -0
- package/dist/memory/file-relationships.js.map +1 -0
- package/dist/memory/impact-analyzer.d.ts +16 -0
- package/dist/memory/impact-analyzer.d.ts.map +1 -0
- package/dist/memory/impact-analyzer.js +189 -0
- package/dist/memory/impact-analyzer.js.map +1 -0
- package/dist/memory/instructions-generator.d.ts +30 -0
- package/dist/memory/instructions-generator.d.ts.map +1 -0
- package/dist/memory/instructions-generator.js +117 -0
- package/dist/memory/instructions-generator.js.map +1 -0
- package/dist/memory/pre-flight.d.ts +24 -0
- package/dist/memory/pre-flight.d.ts.map +1 -0
- package/dist/memory/pre-flight.js +121 -0
- package/dist/memory/pre-flight.js.map +1 -0
- package/dist/memory/preference-learner.d.ts +28 -0
- package/dist/memory/preference-learner.d.ts.map +1 -0
- package/dist/memory/preference-learner.js +144 -0
- package/dist/memory/preference-learner.js.map +1 -0
- package/dist/memory/regression-guard.d.ts +35 -0
- package/dist/memory/regression-guard.d.ts.map +1 -0
- package/dist/memory/regression-guard.js +90 -0
- package/dist/memory/regression-guard.js.map +1 -0
- package/dist/memory/resume-work.d.ts +37 -0
- package/dist/memory/resume-work.d.ts.map +1 -0
- package/dist/memory/resume-work.js +122 -0
- package/dist/memory/resume-work.js.map +1 -0
- package/dist/memory/success-tracker.d.ts +33 -0
- package/dist/memory/success-tracker.d.ts.map +1 -0
- package/dist/memory/success-tracker.js +75 -0
- package/dist/memory/success-tracker.js.map +1 -0
- package/dist/memory/tool-recommender.d.ts +29 -0
- package/dist/memory/tool-recommender.d.ts.map +1 -0
- package/dist/memory/tool-recommender.js +117 -0
- package/dist/memory/tool-recommender.js.map +1 -0
- package/dist/memory/usage-stats.d.ts +59 -0
- package/dist/memory/usage-stats.d.ts.map +1 -0
- package/dist/memory/usage-stats.js +122 -0
- package/dist/memory/usage-stats.js.map +1 -0
- package/dist/server/mcp-handler.d.ts.map +1 -1
- package/dist/server/mcp-handler.js +634 -14
- package/dist/server/mcp-handler.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.analyzeImpact = analyzeImpact;
|
|
37
|
+
exports.formatImpact = formatImpact;
|
|
38
|
+
/**
|
|
39
|
+
* Impact Analyzer — Shows what breaks when you change a file.
|
|
40
|
+
*
|
|
41
|
+
* Before editing file A, this module checks the architecture graph
|
|
42
|
+
* to find all files that import from A (dependents).
|
|
43
|
+
* Prevents breaking changes by making dependencies visible.
|
|
44
|
+
*
|
|
45
|
+
* Like checking "who's using this?" before changing an API.
|
|
46
|
+
*/
|
|
47
|
+
const fs = __importStar(require("fs"));
|
|
48
|
+
const path = __importStar(require("path"));
|
|
49
|
+
/**
|
|
50
|
+
* Analyze the impact of changing a file.
|
|
51
|
+
* Scans for import statements that reference the target file.
|
|
52
|
+
*/
|
|
53
|
+
function analyzeImpact(targetFile, workspaceRoot) {
|
|
54
|
+
const result = {
|
|
55
|
+
targetFile,
|
|
56
|
+
directDependents: [],
|
|
57
|
+
indirectDependents: [],
|
|
58
|
+
totalImpact: 0,
|
|
59
|
+
exports: [],
|
|
60
|
+
riskLevel: 'LOW',
|
|
61
|
+
};
|
|
62
|
+
if (!workspaceRoot || !fs.existsSync(workspaceRoot))
|
|
63
|
+
return result;
|
|
64
|
+
// Normalize target for matching
|
|
65
|
+
const targetBasename = path.basename(targetFile).replace(/\.(ts|tsx|js|jsx)$/, '');
|
|
66
|
+
const targetRelative = path.relative(workspaceRoot, targetFile).replace(/\\/g, '/');
|
|
67
|
+
// Get all source files
|
|
68
|
+
const allFiles = getAllSourceFiles(workspaceRoot);
|
|
69
|
+
// Find what the target exports
|
|
70
|
+
try {
|
|
71
|
+
const targetContent = fs.readFileSync(fs.existsSync(targetFile) ? targetFile : path.join(workspaceRoot, targetFile), 'utf-8');
|
|
72
|
+
const exportMatches = targetContent.match(/export\s+(?:function|class|const|let|type|interface|enum)\s+(\w+)/g);
|
|
73
|
+
if (exportMatches) {
|
|
74
|
+
result.exports = exportMatches.map(m => {
|
|
75
|
+
const name = m.match(/\s(\w+)$/);
|
|
76
|
+
return name ? name[1] : m;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch { /* file read failure is non-fatal */ }
|
|
81
|
+
// Scan all files for imports from target
|
|
82
|
+
for (const file of allFiles) {
|
|
83
|
+
if (file === targetRelative)
|
|
84
|
+
continue;
|
|
85
|
+
try {
|
|
86
|
+
const content = fs.readFileSync(path.join(workspaceRoot, file), 'utf-8');
|
|
87
|
+
// Check for imports referencing the target file
|
|
88
|
+
const importPattern = new RegExp(`(?:import|require).*(?:${escapeRegex(targetBasename)}|${escapeRegex(targetRelative.replace(/\.(ts|tsx|js|jsx)$/, ''))})`, 'i');
|
|
89
|
+
if (importPattern.test(content)) {
|
|
90
|
+
result.directDependents.push(file);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch { /* ignore read failures */ }
|
|
94
|
+
}
|
|
95
|
+
// Find indirect dependents (files that import from direct dependents)
|
|
96
|
+
const directSet = new Set(result.directDependents);
|
|
97
|
+
for (const depFile of result.directDependents) {
|
|
98
|
+
const depBasename = path.basename(depFile).replace(/\.(ts|tsx|js|jsx)$/, '');
|
|
99
|
+
for (const file of allFiles) {
|
|
100
|
+
if (directSet.has(file) || file === targetRelative)
|
|
101
|
+
continue;
|
|
102
|
+
try {
|
|
103
|
+
const content = fs.readFileSync(path.join(workspaceRoot, file), 'utf-8');
|
|
104
|
+
if (content.includes(depBasename)) {
|
|
105
|
+
result.indirectDependents.push(file);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch { /* ignore */ }
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// Deduplicate indirect
|
|
112
|
+
result.indirectDependents = [...new Set(result.indirectDependents)];
|
|
113
|
+
result.totalImpact = result.directDependents.length + result.indirectDependents.length;
|
|
114
|
+
// Risk level
|
|
115
|
+
if (result.totalImpact === 0)
|
|
116
|
+
result.riskLevel = 'LOW';
|
|
117
|
+
else if (result.totalImpact <= 3)
|
|
118
|
+
result.riskLevel = 'MEDIUM';
|
|
119
|
+
else if (result.totalImpact <= 8)
|
|
120
|
+
result.riskLevel = 'HIGH';
|
|
121
|
+
else
|
|
122
|
+
result.riskLevel = 'CRITICAL';
|
|
123
|
+
return result;
|
|
124
|
+
}
|
|
125
|
+
/** Format impact analysis for AI consumption */
|
|
126
|
+
function formatImpact(result) {
|
|
127
|
+
const riskEmoji = {
|
|
128
|
+
LOW: '🟢', MEDIUM: '🟡', HIGH: '🟠', CRITICAL: '🔴',
|
|
129
|
+
};
|
|
130
|
+
const lines = [
|
|
131
|
+
`# 💥 Impact Analysis: ${path.basename(result.targetFile)}`,
|
|
132
|
+
`\n**Risk Level:** ${riskEmoji[result.riskLevel]} ${result.riskLevel} (${result.totalImpact} files affected)`,
|
|
133
|
+
];
|
|
134
|
+
if (result.exports.length > 0) {
|
|
135
|
+
lines.push(`\n**Exports:** \`${result.exports.slice(0, 10).join('`, `')}\``);
|
|
136
|
+
}
|
|
137
|
+
if (result.directDependents.length > 0) {
|
|
138
|
+
lines.push(`\n## Direct Dependents (${result.directDependents.length} files import this)`);
|
|
139
|
+
result.directDependents.forEach(f => lines.push(`- 📁 ${f}`));
|
|
140
|
+
}
|
|
141
|
+
if (result.indirectDependents.length > 0) {
|
|
142
|
+
lines.push(`\n## Indirect Dependents (${result.indirectDependents.length} files)`);
|
|
143
|
+
result.indirectDependents.slice(0, 5).forEach(f => lines.push(`- 📁 ${f}`));
|
|
144
|
+
if (result.indirectDependents.length > 5) {
|
|
145
|
+
lines.push(`_...and ${result.indirectDependents.length - 5} more_`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (result.totalImpact === 0) {
|
|
149
|
+
lines.push('\n✅ **No dependents found.** Safe to modify.');
|
|
150
|
+
}
|
|
151
|
+
else if (result.riskLevel === 'CRITICAL' || result.riskLevel === 'HIGH') {
|
|
152
|
+
lines.push('\n> ⚠️ **Caution:** Many files depend on this. Changing exports or signatures may cause cascading failures.');
|
|
153
|
+
}
|
|
154
|
+
return lines.join('\n');
|
|
155
|
+
}
|
|
156
|
+
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
157
|
+
function getAllSourceFiles(root, maxFiles = 200) {
|
|
158
|
+
const files = [];
|
|
159
|
+
const ignore = new Set(['node_modules', '.git', 'dist', 'coverage', '.next', 'build', 'out']);
|
|
160
|
+
const exts = new Set(['.ts', '.tsx', '.js', '.jsx']);
|
|
161
|
+
function walk(dir, depth) {
|
|
162
|
+
if (depth > 4 || files.length >= maxFiles)
|
|
163
|
+
return;
|
|
164
|
+
try {
|
|
165
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
166
|
+
for (const entry of entries) {
|
|
167
|
+
if (ignore.has(entry.name) || entry.name.startsWith('.'))
|
|
168
|
+
continue;
|
|
169
|
+
const full = path.join(dir, entry.name);
|
|
170
|
+
if (entry.isDirectory()) {
|
|
171
|
+
walk(full, depth + 1);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
const ext = path.extname(entry.name);
|
|
175
|
+
if (exts.has(ext) && !entry.name.endsWith('.d.ts')) {
|
|
176
|
+
files.push(path.relative(root, full).replace(/\\/g, '/'));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
catch { /* ignore */ }
|
|
182
|
+
}
|
|
183
|
+
walk(root, 0);
|
|
184
|
+
return files;
|
|
185
|
+
}
|
|
186
|
+
function escapeRegex(str) {
|
|
187
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=impact-analyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impact-analyzer.js","sourceRoot":"","sources":["../../src/memory/impact-analyzer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,sCA+EC;AAGD,oCAiCC;AA5ID;;;;;;;;GAQG;AACH,uCAAyB;AACzB,2CAA6B;AAW7B;;;GAGG;AACH,SAAgB,aAAa,CACzB,UAAkB,EAClB,aAAqB;IAErB,MAAM,MAAM,GAAiB;QACzB,UAAU;QACV,gBAAgB,EAAE,EAAE;QACpB,kBAAkB,EAAE,EAAE;QACtB,WAAW,EAAE,CAAC;QACd,OAAO,EAAE,EAAE;QACX,SAAS,EAAE,KAAK;KACnB,CAAC;IAEF,IAAI,CAAC,aAAa,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC;QAAE,OAAO,MAAM,CAAC;IAEnE,gCAAgC;IAChC,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;IACnF,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAEpF,uBAAuB;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extual Instructions Generator — Converts raw memories into direct DO/DON'T rules.
|
|
3
|
+
*
|
|
4
|
+
* THE GAP THIS FILLS:
|
|
5
|
+
* Currently, force_recall dumps memories like:
|
|
6
|
+
* "[CONVENTION] Arrow functions preferred over function declarations"
|
|
7
|
+
* But the AI has to interpret this. What it actually needs is:
|
|
8
|
+
* "DO: Use arrow functions. DON'T: Use function declarations."
|
|
9
|
+
*
|
|
10
|
+
* This module converts conventions, corrections, and preferences into
|
|
11
|
+
* imperative instructions that the AI can follow without thinking.
|
|
12
|
+
*
|
|
13
|
+
* Like a military briefing: clear, direct, no interpretation needed.
|
|
14
|
+
*/
|
|
15
|
+
import { MemoryStore } from '../db/memory-store';
|
|
16
|
+
export interface InstructionSet {
|
|
17
|
+
dos: string[];
|
|
18
|
+
donts: string[];
|
|
19
|
+
watchOuts: string[];
|
|
20
|
+
style: string[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Generate contextual instructions from stored memories.
|
|
24
|
+
*/
|
|
25
|
+
export declare function generateInstructions(memoryStore: MemoryStore): InstructionSet;
|
|
26
|
+
/**
|
|
27
|
+
* Format instructions as a clear, imperative briefing.
|
|
28
|
+
*/
|
|
29
|
+
export declare function formatInstructions(instructions: InstructionSet): string;
|
|
30
|
+
//# sourceMappingURL=instructions-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions-generator.d.ts","sourceRoot":"","sources":["../../src/memory/instructions-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,WAAW,cAAc;IAC3B,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,cAAc,CAiF7E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,cAAc,GAAG,MAAM,CAwBvE"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateInstructions = generateInstructions;
|
|
4
|
+
exports.formatInstructions = formatInstructions;
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
/**
|
|
7
|
+
* Generate contextual instructions from stored memories.
|
|
8
|
+
*/
|
|
9
|
+
function generateInstructions(memoryStore) {
|
|
10
|
+
const instructions = {
|
|
11
|
+
dos: [],
|
|
12
|
+
donts: [],
|
|
13
|
+
watchOuts: [],
|
|
14
|
+
style: [],
|
|
15
|
+
};
|
|
16
|
+
const active = memoryStore.getActive(200);
|
|
17
|
+
for (const m of active) {
|
|
18
|
+
const intent = m.intent.toLowerCase();
|
|
19
|
+
const full = `${m.intent} ${m.action || ''} ${m.reason || ''}`;
|
|
20
|
+
// ─── Corrections → DON'Ts ──────────────────────────────────────
|
|
21
|
+
if (m.type === types_1.MemoryType.CORRECTION) {
|
|
22
|
+
// Extract the "don't do X" from corrections
|
|
23
|
+
const noMatch = full.match(/(?:no[,.]?\s+use|don'?t\s+use|never\s+use|avoid|instead\s+of)\s+(\w[\w\s]{3,40})/i);
|
|
24
|
+
const yesMatch = full.match(/(?:use|prefer|always\s+use|should\s+use|switch\s+to)\s+(\w[\w\s]{3,40})/i);
|
|
25
|
+
if (noMatch) {
|
|
26
|
+
instructions.donts.push(`DON'T: ${noMatch[1].trim()}`);
|
|
27
|
+
}
|
|
28
|
+
if (yesMatch) {
|
|
29
|
+
instructions.dos.push(`DO: ${yesMatch[1].trim()}`);
|
|
30
|
+
}
|
|
31
|
+
if (!noMatch && !yesMatch) {
|
|
32
|
+
instructions.watchOuts.push(`⚠️ Past correction: ${m.intent.slice(0, 80)}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// ─── Conventions → DOs ─────────────────────────────────────────
|
|
36
|
+
if (m.type === types_1.MemoryType.CONVENTION) {
|
|
37
|
+
// Check if this is a preference (communication style)
|
|
38
|
+
if (m.tags?.includes('preference')) {
|
|
39
|
+
instructions.style.push(m.intent.slice(0, 80));
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
// Auto-detected conventions → direct rules
|
|
43
|
+
if (m.tags?.includes('auto-detected')) {
|
|
44
|
+
if (intent.includes('arrow function')) {
|
|
45
|
+
instructions.dos.push('DO: Use arrow functions (const fn = () => {})');
|
|
46
|
+
}
|
|
47
|
+
else if (intent.includes('function declaration')) {
|
|
48
|
+
instructions.dos.push('DO: Use function declarations (function fn() {})');
|
|
49
|
+
}
|
|
50
|
+
else if (intent.includes('const over let')) {
|
|
51
|
+
instructions.dos.push('DO: Use const by default, let only when reassignment needed');
|
|
52
|
+
}
|
|
53
|
+
else if (intent.includes('semicolon')) {
|
|
54
|
+
if (intent.includes('always'))
|
|
55
|
+
instructions.dos.push('DO: Always use semicolons');
|
|
56
|
+
else
|
|
57
|
+
instructions.dos.push('DO: Omit semicolons (ASI style)');
|
|
58
|
+
}
|
|
59
|
+
else if (intent.includes('single quote')) {
|
|
60
|
+
instructions.dos.push('DO: Use single quotes for strings');
|
|
61
|
+
}
|
|
62
|
+
else if (intent.includes('double quote')) {
|
|
63
|
+
instructions.dos.push('DO: Use double quotes for strings');
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
instructions.dos.push(`DO: ${m.intent.slice(0, 80)}`);
|
|
67
|
+
}
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
instructions.dos.push(`DO: ${m.intent.slice(0, 80)}`);
|
|
71
|
+
}
|
|
72
|
+
// ─── Bug Fixes → Watch Outs ───────────────────────────────────
|
|
73
|
+
if (m.type === types_1.MemoryType.BUG_FIX) {
|
|
74
|
+
if (m.tags?.includes('error-pattern')) {
|
|
75
|
+
// These are TS error lessons
|
|
76
|
+
instructions.watchOuts.push(`⚠️ ${m.intent.replace('[ERROR PATTERN] ', '').slice(0, 80)}`);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
instructions.watchOuts.push(`⚠️ Known bug: ${m.intent.slice(0, 80)}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Deduplicate
|
|
84
|
+
instructions.dos = [...new Set(instructions.dos)].slice(0, 15);
|
|
85
|
+
instructions.donts = [...new Set(instructions.donts)].slice(0, 10);
|
|
86
|
+
instructions.watchOuts = [...new Set(instructions.watchOuts)].slice(0, 10);
|
|
87
|
+
instructions.style = [...new Set(instructions.style)].slice(0, 5);
|
|
88
|
+
return instructions;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Format instructions as a clear, imperative briefing.
|
|
92
|
+
*/
|
|
93
|
+
function formatInstructions(instructions) {
|
|
94
|
+
const sections = [];
|
|
95
|
+
if (instructions.dos.length > 0) {
|
|
96
|
+
sections.push('## ✅ Project Rules (DO)');
|
|
97
|
+
for (const d of instructions.dos)
|
|
98
|
+
sections.push(`- ${d}`);
|
|
99
|
+
}
|
|
100
|
+
if (instructions.donts.length > 0) {
|
|
101
|
+
sections.push('\n## ❌ Avoid (DON\'T)');
|
|
102
|
+
for (const d of instructions.donts)
|
|
103
|
+
sections.push(`- ${d}`);
|
|
104
|
+
}
|
|
105
|
+
if (instructions.watchOuts.length > 0) {
|
|
106
|
+
sections.push('\n## ⚠️ Watch Out');
|
|
107
|
+
for (const w of instructions.watchOuts)
|
|
108
|
+
sections.push(`- ${w}`);
|
|
109
|
+
}
|
|
110
|
+
if (instructions.style.length > 0) {
|
|
111
|
+
sections.push('\n## 🎯 Communication Style');
|
|
112
|
+
for (const s of instructions.style)
|
|
113
|
+
sections.push(`- ${s}`);
|
|
114
|
+
}
|
|
115
|
+
return sections.length > 0 ? sections.join('\n') : '';
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=instructions-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions-generator.js","sourceRoot":"","sources":["../../src/memory/instructions-generator.ts"],"names":[],"mappings":";;AA2BA,oDAiFC;AAKD,gDAwBC;AA1HD,oCAAsC;AAStC;;GAEG;AACH,SAAgB,oBAAoB,CAAC,WAAwB;IACzD,MAAM,YAAY,GAAmB;QACjC,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,EAAE;KACZ,CAAC;IAEF,MAAM,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAE1C,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,IAAI,EAAE,IAAI,CAAC,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;QAE/D,kEAAkE;QAClE,IAAI,CAAC,CAAC,IAAI,KAAK,kBAAU,CAAC,UAAU,EAAE,CAAC;YACnC,4CAA4C;YAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,mFAAmF,CAAC,CAAC;YAChH,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,0EAA0E,CAAC,CAAC;YAExG,IAAI,OAAO,EAAE,CAAC;gBACV,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC3D,CAAC;YACD,IAAI,QAAQ,EAAE,CAAC;gBACX,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACvD,CAAC;YACD,IAAI,CAAC,OAAO,IAAI,CAA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C,IAAI,YAAY,CAAC,SAAS;YAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,IAAI,YAAY,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,QAAQ,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;QAC7C,KAAK,MAAM,CAAC,IAAI,YAAY,CAAC,KAAK;YAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pre-Flight Checks — Convention check BEFORE writing code.
|
|
3
|
+
*
|
|
4
|
+
* Instead of reviewing code AFTER it's written (review_code),
|
|
5
|
+
* this tells the AI what conventions and gotchas exist for a file/task
|
|
6
|
+
* BEFORE a single line is written.
|
|
7
|
+
*
|
|
8
|
+
* Like a pilot's pre-flight checklist — don't take off without checking.
|
|
9
|
+
*/
|
|
10
|
+
import { MemoryStore } from '../db/memory-store';
|
|
11
|
+
export interface PreFlightResult {
|
|
12
|
+
conventions: string[];
|
|
13
|
+
gotchas: string[];
|
|
14
|
+
pastBugs: string[];
|
|
15
|
+
fileNotes: string[];
|
|
16
|
+
recentCorrections: string[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get everything the AI needs to know BEFORE writing/editing code for a file.
|
|
20
|
+
*/
|
|
21
|
+
export declare function preFlightCheck(memoryStore: MemoryStore, filename?: string, task?: string): PreFlightResult;
|
|
22
|
+
/** Format pre-flight results for AI consumption */
|
|
23
|
+
export declare function formatPreFlight(result: PreFlightResult): string;
|
|
24
|
+
//# sourceMappingURL=pre-flight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pre-flight.d.ts","sourceRoot":"","sources":["../../src/memory/pre-flight.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,WAAW,eAAe;IAC5B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC1B,WAAW,EAAE,WAAW,EACxB,QAAQ,CAAC,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,MAAM,GACd,eAAe,CA4EjB;AAED,mDAAmD;AACnD,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CA8C/D"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.preFlightCheck = preFlightCheck;
|
|
4
|
+
exports.formatPreFlight = formatPreFlight;
|
|
5
|
+
/**
|
|
6
|
+
* Get everything the AI needs to know BEFORE writing/editing code for a file.
|
|
7
|
+
*/
|
|
8
|
+
function preFlightCheck(memoryStore, filename, task) {
|
|
9
|
+
const result = {
|
|
10
|
+
conventions: [],
|
|
11
|
+
gotchas: [],
|
|
12
|
+
pastBugs: [],
|
|
13
|
+
fileNotes: [],
|
|
14
|
+
recentCorrections: [],
|
|
15
|
+
};
|
|
16
|
+
// 1. Get ALL conventions (these apply everywhere)
|
|
17
|
+
const conventions = memoryStore.getByType('CONVENTION', 50);
|
|
18
|
+
for (const conv of conventions) {
|
|
19
|
+
// Filter by relevance to file type if filename provided
|
|
20
|
+
if (filename) {
|
|
21
|
+
const ext = filename.split('.').pop()?.toLowerCase() || '';
|
|
22
|
+
const intentLower = conv.intent.toLowerCase();
|
|
23
|
+
const fileTypeKeywords = {
|
|
24
|
+
ts: ['typescript', 'type', 'interface', 'const', 'let', 'var', 'import', 'export'],
|
|
25
|
+
tsx: ['react', 'component', 'hook', 'jsx', 'state', 'prop'],
|
|
26
|
+
css: ['style', 'css', 'class', 'color', 'font'],
|
|
27
|
+
py: ['python', 'def', 'class', 'import'],
|
|
28
|
+
js: ['javascript', 'require', 'module', 'function'],
|
|
29
|
+
};
|
|
30
|
+
const keywords = fileTypeKeywords[ext] || [];
|
|
31
|
+
const isRelevant = keywords.length === 0 || keywords.some(k => intentLower.includes(k))
|
|
32
|
+
|| !Object.values(fileTypeKeywords).flat().some(k => intentLower.includes(k)); // Generic convention
|
|
33
|
+
if (!isRelevant)
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
result.conventions.push(`[${conv.id.slice(0, 8)}] ${conv.intent}`);
|
|
37
|
+
}
|
|
38
|
+
// 2. Get GOTCHA memories (dangerous patterns)
|
|
39
|
+
const gotchas = memoryStore.getByType('GOTCHA', 20);
|
|
40
|
+
for (const g of gotchas) {
|
|
41
|
+
result.gotchas.push(`⚠️ [${g.id.slice(0, 8)}] ${g.intent}`);
|
|
42
|
+
}
|
|
43
|
+
// 3. Get past BUG_FIX patterns for this file
|
|
44
|
+
const bugFixes = memoryStore.getByType('BUG_FIX', 30);
|
|
45
|
+
for (const bug of bugFixes) {
|
|
46
|
+
if (filename && bug.relatedFiles?.some(f => f.includes(filename.split(/[\\/]/).pop() || ''))) {
|
|
47
|
+
result.pastBugs.push(`🐛 [${bug.id.slice(0, 8)}] ${bug.intent}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// 4. File-specific memories
|
|
51
|
+
if (filename) {
|
|
52
|
+
const fileMemories = memoryStore.getByFile(filename, 10);
|
|
53
|
+
for (const fm of fileMemories) {
|
|
54
|
+
result.fileNotes.push(`📄 [${fm.type}] ${fm.intent}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// 5. Recent CORRECTIONS (last 20 — most likely to be repeated)
|
|
58
|
+
const corrections = memoryStore.getByType('CORRECTION', 20);
|
|
59
|
+
for (const corr of corrections) {
|
|
60
|
+
// Only include recent ones (last 7 days)
|
|
61
|
+
if (Date.now() - corr.timestamp < 7 * 24 * 60 * 60 * 1000) {
|
|
62
|
+
result.recentCorrections.push(`🔄 [${corr.id.slice(0, 8)}] ${corr.intent}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Task-specific memories via FTS search
|
|
66
|
+
if (task) {
|
|
67
|
+
try {
|
|
68
|
+
const taskResults = memoryStore.searchFTS(task, 5);
|
|
69
|
+
for (const r of taskResults) {
|
|
70
|
+
const m = r.memory;
|
|
71
|
+
if (m.type === 'FAILED_ATTEMPT') {
|
|
72
|
+
result.gotchas.push(`❌ [FAILED] ${m.intent}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch { /* FTS failure is non-fatal */ }
|
|
77
|
+
}
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
/** Format pre-flight results for AI consumption */
|
|
81
|
+
function formatPreFlight(result) {
|
|
82
|
+
const sections = ['# ✈️ Pre-Flight Check\n'];
|
|
83
|
+
let hasContent = false;
|
|
84
|
+
if (result.recentCorrections.length > 0) {
|
|
85
|
+
sections.push('## 🔴 Recent Corrections (DON\'T repeat these)\n');
|
|
86
|
+
result.recentCorrections.forEach(c => sections.push(c));
|
|
87
|
+
sections.push('');
|
|
88
|
+
hasContent = true;
|
|
89
|
+
}
|
|
90
|
+
if (result.gotchas.length > 0) {
|
|
91
|
+
sections.push('## ⚠️ Gotchas & Failed Attempts\n');
|
|
92
|
+
result.gotchas.forEach(g => sections.push(g));
|
|
93
|
+
sections.push('');
|
|
94
|
+
hasContent = true;
|
|
95
|
+
}
|
|
96
|
+
if (result.pastBugs.length > 0) {
|
|
97
|
+
sections.push('## 🐛 Past Bugs in This File\n');
|
|
98
|
+
result.pastBugs.forEach(b => sections.push(b));
|
|
99
|
+
sections.push('');
|
|
100
|
+
hasContent = true;
|
|
101
|
+
}
|
|
102
|
+
if (result.fileNotes.length > 0) {
|
|
103
|
+
sections.push('## 📄 File Context\n');
|
|
104
|
+
result.fileNotes.forEach(f => sections.push(f));
|
|
105
|
+
sections.push('');
|
|
106
|
+
hasContent = true;
|
|
107
|
+
}
|
|
108
|
+
if (result.conventions.length > 0) {
|
|
109
|
+
sections.push(`## 📏 Conventions (${result.conventions.length})\n`);
|
|
110
|
+
result.conventions.slice(0, 10).forEach(c => sections.push(c));
|
|
111
|
+
if (result.conventions.length > 10) {
|
|
112
|
+
sections.push(`_...and ${result.conventions.length - 10} more_`);
|
|
113
|
+
}
|
|
114
|
+
hasContent = true;
|
|
115
|
+
}
|
|
116
|
+
if (!hasContent) {
|
|
117
|
+
return '# ✈️ Pre-Flight Check\n\n✅ No conventions, gotchas, or past bugs found. Clear for takeoff.';
|
|
118
|
+
}
|
|
119
|
+
return sections.join('\n');
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=pre-flight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pre-flight.js","sourceRoot":"","sources":["../../src/memory/pre-flight.ts"],"names":[],"mappings":";;AAuBA,wCAgFC;AAGD,0CA8CC;AApID;;GAEG;AACH,SAAgB,cAAc,CAC1B,WAAwB,EACxB,QAAiB,EACjB,IAAa;IAEb,MAAM,MAAM,GAAoB;QAC5B,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,EAAE;QACb,iBAAiB,EAAE,EAAE;KACxB,CAAC;IAEF,kDAAkD;IAClD,MAAM,WAAW,GAAG,WAAW,CAAC,SAAS,CAAC,YAA0B,EAAE,EAAE,CAAC,CAAC;IAC1E,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;QAC7B,wDAAwD;QACxD,IA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AAC;QAChC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,MAAM,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC;QACpE,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/D,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;YACjC,QAAQ,CAAC,IAAI,CAAC,WAAW,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,EAAE,QAAQ,CAAC,CAAC;QACrE,CAAC;QACD,UAAU,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,UAAU,EAAE,CAAC;QACd,OAAO,4FAA4F,CAAC;IACxG,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preference Learner — Learns how the user likes to work.
|
|
3
|
+
*
|
|
4
|
+
* Detects communication and coding preferences from user messages:
|
|
5
|
+
* - Verbose vs concise responses
|
|
6
|
+
* - Asks before changing vs just do it
|
|
7
|
+
* - Wants explanations vs just code
|
|
8
|
+
* - Framework/library preferences
|
|
9
|
+
*
|
|
10
|
+
* Stores as PREFERENCE memories for AI to adapt to.
|
|
11
|
+
*/
|
|
12
|
+
import { MemoryStore } from '../db/memory-store';
|
|
13
|
+
export interface DetectedPreference {
|
|
14
|
+
category: 'communication' | 'coding' | 'workflow' | 'style';
|
|
15
|
+
preference: string;
|
|
16
|
+
confidence: number;
|
|
17
|
+
evidence: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Detect user preferences from their message text.
|
|
21
|
+
* Call this from auto_learn when context is provided.
|
|
22
|
+
*/
|
|
23
|
+
export declare function detectPreferences(userText: string): DetectedPreference[];
|
|
24
|
+
/**
|
|
25
|
+
* Get all stored preferences for injection into force_recall.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getStoredPreferences(memoryStore: MemoryStore): string;
|
|
28
|
+
//# sourceMappingURL=preference-learner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-learner.d.ts","sourceRoot":"","sources":["../../src/memory/preference-learner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,EAAE,eAAe,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;IAC5D,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAyGD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAwBxE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAkBrE"}
|