midas-mcp 3.0.0 → 3.2.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/LICENSE +21 -0
- package/dist/ai.d.ts +2 -0
- package/dist/ai.d.ts.map +1 -1
- package/dist/ai.js +28 -45
- package/dist/ai.js.map +1 -1
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +37 -87
- package/dist/analyzer.js.map +1 -1
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +109 -15
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +8 -1
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +76 -7
- package/dist/context.js.map +1 -1
- package/dist/providers.d.ts +46 -0
- package/dist/providers.d.ts.map +1 -0
- package/dist/providers.js +287 -0
- package/dist/providers.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +9 -2
- package/dist/server.js.map +1 -1
- package/dist/tools/config.d.ts +73 -0
- package/dist/tools/config.d.ts.map +1 -0
- package/dist/tools/config.js +94 -0
- package/dist/tools/config.js.map +1 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +240 -172
- package/dist/tui.js.map +1 -1
- package/package.json +17 -5
- package/dist/tests/analyze.test.d.ts +0 -2
- package/dist/tests/analyze.test.d.ts.map +0 -1
- package/dist/tests/analyze.test.js +0 -120
- package/dist/tests/analyze.test.js.map +0 -1
- package/dist/tests/context.test.d.ts +0 -2
- package/dist/tests/context.test.d.ts.map +0 -1
- package/dist/tests/context.test.js +0 -213
- package/dist/tests/context.test.js.map +0 -1
- package/dist/tests/edge-cases.test.d.ts +0 -2
- package/dist/tests/edge-cases.test.d.ts.map +0 -1
- package/dist/tests/edge-cases.test.js +0 -234
- package/dist/tests/edge-cases.test.js.map +0 -1
- package/dist/tests/journal.test.d.ts +0 -2
- package/dist/tests/journal.test.d.ts.map +0 -1
- package/dist/tests/journal.test.js +0 -184
- package/dist/tests/journal.test.js.map +0 -1
- package/dist/tests/metrics.test.d.ts +0 -2
- package/dist/tests/metrics.test.d.ts.map +0 -1
- package/dist/tests/metrics.test.js +0 -178
- package/dist/tests/metrics.test.js.map +0 -1
- package/dist/tests/phase.test.d.ts +0 -2
- package/dist/tests/phase.test.d.ts.map +0 -1
- package/dist/tests/phase.test.js +0 -110
- package/dist/tests/phase.test.js.map +0 -1
- package/dist/tests/prompts.test.d.ts +0 -2
- package/dist/tests/prompts.test.d.ts.map +0 -1
- package/dist/tests/prompts.test.js +0 -157
- package/dist/tests/prompts.test.js.map +0 -1
- package/dist/tests/search.test.d.ts +0 -2
- package/dist/tests/search.test.d.ts.map +0 -1
- package/dist/tests/search.test.js +0 -228
- package/dist/tests/search.test.js.map +0 -1
- package/dist/tests/security.test.d.ts +0 -2
- package/dist/tests/security.test.d.ts.map +0 -1
- package/dist/tests/security.test.js +0 -105
- package/dist/tests/security.test.js.map +0 -1
- package/dist/tests/server.test.d.ts +0 -2
- package/dist/tests/server.test.d.ts.map +0 -1
- package/dist/tests/server.test.js +0 -93
- package/dist/tests/server.test.js.map +0 -1
- package/dist/tests/techstack.test.d.ts +0 -2
- package/dist/tests/techstack.test.d.ts.map +0 -1
- package/dist/tests/techstack.test.js +0 -187
- package/dist/tests/techstack.test.js.map +0 -1
- package/dist/tests/tools.test.d.ts +0 -2
- package/dist/tests/tools.test.d.ts.map +0 -1
- package/dist/tests/tools.test.js +0 -137
- package/dist/tests/tools.test.js.map +0 -1
- package/dist/tests/tracker.test.d.ts +0 -2
- package/dist/tests/tracker.test.d.ts.map +0 -1
- package/dist/tests/tracker.test.js +0 -197
- package/dist/tests/tracker.test.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "midas-mcp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "MCP server for Golden Code methodology - everything you vibecode turns to gold",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dev": "tsc --watch",
|
|
13
13
|
"start": "node dist/index.js",
|
|
14
14
|
"test": "npm run build && node --test dist/tests/*.test.js",
|
|
15
|
-
"prepublishOnly": "npm
|
|
15
|
+
"prepublishOnly": "npm test"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
18
18
|
"mcp",
|
|
@@ -20,10 +20,20 @@
|
|
|
20
20
|
"vibecoding",
|
|
21
21
|
"cursor",
|
|
22
22
|
"ai-assistant",
|
|
23
|
-
"developer-tools"
|
|
23
|
+
"developer-tools",
|
|
24
|
+
"golden-code",
|
|
25
|
+
"methodology"
|
|
24
26
|
],
|
|
25
|
-
"author": "",
|
|
27
|
+
"author": "Christian Cattaneo",
|
|
26
28
|
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/christiancattaneo/midas-mcp.git"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/christiancattaneo/midas-mcp#readme",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/christiancattaneo/midas-mcp/issues"
|
|
36
|
+
},
|
|
27
37
|
"dependencies": {
|
|
28
38
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
29
39
|
"zod": "^3.23.0"
|
|
@@ -37,7 +47,9 @@
|
|
|
37
47
|
},
|
|
38
48
|
"files": [
|
|
39
49
|
"dist",
|
|
50
|
+
"!dist/tests",
|
|
40
51
|
"docs",
|
|
41
|
-
"README.md"
|
|
52
|
+
"README.md",
|
|
53
|
+
"LICENSE"
|
|
42
54
|
]
|
|
43
55
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.test.d.ts","sourceRoot":"","sources":["../../src/tests/analyze.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { describe, it, beforeEach, afterEach } from 'node:test';
|
|
2
|
-
import assert from 'node:assert';
|
|
3
|
-
import { mkdirSync, rmSync } from 'fs';
|
|
4
|
-
import { join } from 'path';
|
|
5
|
-
import { tmpdir } from 'os';
|
|
6
|
-
import { suggestPrompt, advancePhase } from '../tools/analyze.js';
|
|
7
|
-
import { setPhase, loadState } from '../state/phase.js';
|
|
8
|
-
describe('Analyze Tools', () => {
|
|
9
|
-
const testDir = join(tmpdir(), 'midas-analyze-test-' + Date.now());
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
mkdirSync(testDir, { recursive: true });
|
|
12
|
-
});
|
|
13
|
-
afterEach(() => {
|
|
14
|
-
rmSync(testDir, { recursive: true, force: true });
|
|
15
|
-
});
|
|
16
|
-
describe('suggestPrompt', () => {
|
|
17
|
-
it('returns IDLE prompt for new project', () => {
|
|
18
|
-
const result = suggestPrompt({ projectPath: testDir });
|
|
19
|
-
assert.strictEqual(result.phase, 'IDLE');
|
|
20
|
-
assert.strictEqual(result.prompt.includes('start a new project'), true);
|
|
21
|
-
});
|
|
22
|
-
it('returns phase-specific prompt for EAGLE_SIGHT', () => {
|
|
23
|
-
setPhase(testDir, { phase: 'EAGLE_SIGHT', step: 'IDEA' });
|
|
24
|
-
const result = suggestPrompt({ projectPath: testDir });
|
|
25
|
-
assert.strictEqual(result.phase, 'EAGLE_SIGHT');
|
|
26
|
-
assert.strictEqual(result.step, 'IDEA');
|
|
27
|
-
assert.strictEqual(result.prompt.includes('want to build'), true);
|
|
28
|
-
});
|
|
29
|
-
it('returns phase-specific prompt for BUILD', () => {
|
|
30
|
-
setPhase(testDir, { phase: 'BUILD', step: 'IMPLEMENT' });
|
|
31
|
-
const result = suggestPrompt({ projectPath: testDir });
|
|
32
|
-
assert.strictEqual(result.phase, 'BUILD');
|
|
33
|
-
assert.strictEqual(result.step, 'IMPLEMENT');
|
|
34
|
-
assert.strictEqual(result.prompt.includes('Implement'), true);
|
|
35
|
-
});
|
|
36
|
-
it('returns phase-specific prompt for SHIP', () => {
|
|
37
|
-
setPhase(testDir, { phase: 'SHIP', step: 'REVIEW' });
|
|
38
|
-
const result = suggestPrompt({ projectPath: testDir });
|
|
39
|
-
assert.strictEqual(result.phase, 'SHIP');
|
|
40
|
-
assert.strictEqual(result.step, 'REVIEW');
|
|
41
|
-
assert.strictEqual(result.prompt.includes('security'), true);
|
|
42
|
-
});
|
|
43
|
-
it('returns phase-specific prompt for GROW', () => {
|
|
44
|
-
setPhase(testDir, { phase: 'GROW', step: 'FEEDBACK' });
|
|
45
|
-
const result = suggestPrompt({ projectPath: testDir });
|
|
46
|
-
assert.strictEqual(result.phase, 'GROW');
|
|
47
|
-
assert.strictEqual(result.step, 'FEEDBACK');
|
|
48
|
-
assert.strictEqual(result.prompt.includes('feedback'), true);
|
|
49
|
-
});
|
|
50
|
-
it('substitutes context into prompt placeholders', () => {
|
|
51
|
-
setPhase(testDir, { phase: 'BUILD', step: 'IMPLEMENT' });
|
|
52
|
-
const result = suggestPrompt({ projectPath: testDir, context: 'user authentication' });
|
|
53
|
-
assert.strictEqual(result.prompt.includes('user authentication'), true);
|
|
54
|
-
});
|
|
55
|
-
it('includes explanation with every prompt', () => {
|
|
56
|
-
setPhase(testDir, { phase: 'BUILD', step: 'TEST' });
|
|
57
|
-
const result = suggestPrompt({ projectPath: testDir });
|
|
58
|
-
assert.strictEqual(typeof result.explanation, 'string');
|
|
59
|
-
assert.strictEqual(result.explanation.length > 0, true);
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
describe('advancePhase', () => {
|
|
63
|
-
it('advances from IDLE to EAGLE_SIGHT:IDEA', () => {
|
|
64
|
-
const result = advancePhase({ projectPath: testDir });
|
|
65
|
-
assert.strictEqual(result.current.phase, 'EAGLE_SIGHT');
|
|
66
|
-
assert.strictEqual(result.current.step, 'IDEA');
|
|
67
|
-
assert.strictEqual(result.previous.phase, 'IDLE');
|
|
68
|
-
});
|
|
69
|
-
it('advances within EAGLE_SIGHT phase', () => {
|
|
70
|
-
setPhase(testDir, { phase: 'EAGLE_SIGHT', step: 'IDEA' });
|
|
71
|
-
const result = advancePhase({ projectPath: testDir });
|
|
72
|
-
assert.strictEqual(result.current.phase, 'EAGLE_SIGHT');
|
|
73
|
-
assert.strictEqual(result.current.step, 'RESEARCH');
|
|
74
|
-
assert.strictEqual(result.previous.step, 'IDEA');
|
|
75
|
-
});
|
|
76
|
-
it('transitions from EAGLE_SIGHT to BUILD', () => {
|
|
77
|
-
setPhase(testDir, { phase: 'EAGLE_SIGHT', step: 'GAMEPLAN' });
|
|
78
|
-
const result = advancePhase({ projectPath: testDir });
|
|
79
|
-
assert.strictEqual(result.current.phase, 'BUILD');
|
|
80
|
-
assert.strictEqual(result.current.step, 'RULES');
|
|
81
|
-
});
|
|
82
|
-
it('advances through BUILD steps', () => {
|
|
83
|
-
setPhase(testDir, { phase: 'BUILD', step: 'RULES' });
|
|
84
|
-
const result = advancePhase({ projectPath: testDir });
|
|
85
|
-
assert.strictEqual(result.current.step, 'INDEX');
|
|
86
|
-
});
|
|
87
|
-
it('transitions from BUILD to SHIP', () => {
|
|
88
|
-
setPhase(testDir, { phase: 'BUILD', step: 'DEBUG' });
|
|
89
|
-
const result = advancePhase({ projectPath: testDir });
|
|
90
|
-
assert.strictEqual(result.current.phase, 'SHIP');
|
|
91
|
-
assert.strictEqual(result.current.step, 'REVIEW');
|
|
92
|
-
});
|
|
93
|
-
it('transitions from SHIP to GROW', () => {
|
|
94
|
-
setPhase(testDir, { phase: 'SHIP', step: 'MONITOR' });
|
|
95
|
-
const result = advancePhase({ projectPath: testDir });
|
|
96
|
-
assert.strictEqual(result.current.phase, 'GROW');
|
|
97
|
-
assert.strictEqual(result.current.step, 'FEEDBACK');
|
|
98
|
-
});
|
|
99
|
-
it('loops from GROW back to EAGLE_SIGHT', () => {
|
|
100
|
-
setPhase(testDir, { phase: 'GROW', step: 'ITERATE' });
|
|
101
|
-
const result = advancePhase({ projectPath: testDir });
|
|
102
|
-
assert.strictEqual(result.current.phase, 'EAGLE_SIGHT');
|
|
103
|
-
assert.strictEqual(result.current.step, 'IDEA');
|
|
104
|
-
});
|
|
105
|
-
it('persists the new phase to state', () => {
|
|
106
|
-
setPhase(testDir, { phase: 'BUILD', step: 'IMPLEMENT' });
|
|
107
|
-
advancePhase({ projectPath: testDir });
|
|
108
|
-
const state = loadState(testDir);
|
|
109
|
-
assert.strictEqual(state.current.phase, 'BUILD');
|
|
110
|
-
assert.strictEqual(state.current.step, 'TEST');
|
|
111
|
-
});
|
|
112
|
-
it('returns descriptive message', () => {
|
|
113
|
-
const result = advancePhase({ projectPath: testDir });
|
|
114
|
-
assert.strictEqual(result.message.includes('Advanced from'), true);
|
|
115
|
-
assert.strictEqual(result.message.includes('IDLE'), true);
|
|
116
|
-
assert.strictEqual(result.message.includes('EAGLE_SIGHT'), true);
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
//# sourceMappingURL=analyze.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.test.js","sourceRoot":"","sources":["../../src/tests/analyze.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAiB,MAAM,IAAI,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAExD,QAAQ,CAAC,eAAe,EAAE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AC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.test.d.ts","sourceRoot":"","sources":["../../src/tests/context.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { describe, it, beforeEach, afterEach } from 'node:test';
|
|
2
|
-
import assert from 'node:assert';
|
|
3
|
-
import { mkdirSync, rmSync } from 'fs';
|
|
4
|
-
import { join } from 'path';
|
|
5
|
-
import { tmpdir } from 'os';
|
|
6
|
-
import { estimateTokens, truncateToTokens, extractKeyPoints, summarizeJournalEntries, buildCompressedContext, contextToString, getContextStats, getCachedSummary, setCachedSummary, getCacheStats, } from '../context.js';
|
|
7
|
-
import { saveToJournal } from '../tools/journal.js';
|
|
8
|
-
describe('Context Compression Module', () => {
|
|
9
|
-
const testDir = join(tmpdir(), 'midas-context-test-' + Date.now());
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
mkdirSync(testDir, { recursive: true });
|
|
12
|
-
});
|
|
13
|
-
afterEach(() => {
|
|
14
|
-
rmSync(testDir, { recursive: true, force: true });
|
|
15
|
-
});
|
|
16
|
-
describe('estimateTokens', () => {
|
|
17
|
-
it('estimates tokens correctly for short text', () => {
|
|
18
|
-
const text = 'Hello world';
|
|
19
|
-
const tokens = estimateTokens(text);
|
|
20
|
-
// 11 chars / 4 = ~3 tokens
|
|
21
|
-
assert.strictEqual(tokens >= 2 && tokens <= 4, true);
|
|
22
|
-
});
|
|
23
|
-
it('estimates tokens correctly for longer text', () => {
|
|
24
|
-
const text = 'This is a longer piece of text that should have more tokens.';
|
|
25
|
-
const tokens = estimateTokens(text);
|
|
26
|
-
// 60 chars / 4 = 15 tokens
|
|
27
|
-
assert.strictEqual(tokens >= 12 && tokens <= 18, true);
|
|
28
|
-
});
|
|
29
|
-
it('handles empty string', () => {
|
|
30
|
-
assert.strictEqual(estimateTokens(''), 0);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
describe('truncateToTokens', () => {
|
|
34
|
-
it('returns original if under limit', () => {
|
|
35
|
-
const text = 'Short text';
|
|
36
|
-
const result = truncateToTokens(text, 100);
|
|
37
|
-
assert.strictEqual(result, text);
|
|
38
|
-
});
|
|
39
|
-
it('truncates long text', () => {
|
|
40
|
-
const text = 'A'.repeat(1000);
|
|
41
|
-
const result = truncateToTokens(text, 50);
|
|
42
|
-
assert.strictEqual(result.length < text.length, true);
|
|
43
|
-
assert.strictEqual(result.endsWith('...'), true);
|
|
44
|
-
});
|
|
45
|
-
it('tries to end at sentence boundary', () => {
|
|
46
|
-
const text = 'First sentence. Second sentence. Third sentence. Fourth sentence.';
|
|
47
|
-
const result = truncateToTokens(text, 10);
|
|
48
|
-
// Should try to end at a period
|
|
49
|
-
assert.strictEqual(result.includes('.'), true);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
describe('extractKeyPoints', () => {
|
|
53
|
-
it('extracts key points from text', () => {
|
|
54
|
-
const text = `We implemented the feature.
|
|
55
|
-
Then we tested it thoroughly.
|
|
56
|
-
The build passed successfully.
|
|
57
|
-
All errors were fixed.`;
|
|
58
|
-
const points = extractKeyPoints(text, 3);
|
|
59
|
-
assert.strictEqual(points.length, 3);
|
|
60
|
-
});
|
|
61
|
-
it('prioritizes lines with key indicators', () => {
|
|
62
|
-
const text = `Random line here.
|
|
63
|
-
We implemented the new feature.
|
|
64
|
-
Another random line.
|
|
65
|
-
Then we fixed the error.`;
|
|
66
|
-
const points = extractKeyPoints(text, 2);
|
|
67
|
-
// Should prioritize lines with "implement" and "fix"
|
|
68
|
-
assert.strictEqual(points.some(p => p.includes('implement')), true);
|
|
69
|
-
});
|
|
70
|
-
it('limits line length', () => {
|
|
71
|
-
const text = 'A'.repeat(200);
|
|
72
|
-
const points = extractKeyPoints(text, 1);
|
|
73
|
-
assert.strictEqual(points[0].length <= 100, true);
|
|
74
|
-
});
|
|
75
|
-
it('returns empty for empty text', () => {
|
|
76
|
-
const points = extractKeyPoints('', 5);
|
|
77
|
-
assert.strictEqual(points.length, 0);
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
describe('summarizeJournalEntries', () => {
|
|
81
|
-
it('summarizes entries with dates', () => {
|
|
82
|
-
const entries = [
|
|
83
|
-
{ title: 'First entry', conversation: 'Content one', timestamp: '2024-01-15T10:00:00Z' },
|
|
84
|
-
{ title: 'Second entry', conversation: 'Content two', timestamp: '2024-01-16T10:00:00Z' },
|
|
85
|
-
];
|
|
86
|
-
const summary = summarizeJournalEntries(entries);
|
|
87
|
-
assert.strictEqual(summary.includes('2024-01-15'), true);
|
|
88
|
-
assert.strictEqual(summary.includes('First entry'), true);
|
|
89
|
-
});
|
|
90
|
-
it('returns message for empty entries', () => {
|
|
91
|
-
const summary = summarizeJournalEntries([]);
|
|
92
|
-
assert.strictEqual(summary, 'No journal entries.');
|
|
93
|
-
});
|
|
94
|
-
it('limits to 5 entries', () => {
|
|
95
|
-
const entries = Array(10).fill(null).map((_, i) => ({
|
|
96
|
-
title: `Entry ${i}`,
|
|
97
|
-
conversation: `Content ${i}`,
|
|
98
|
-
timestamp: `2024-01-${10 + i}T10:00:00Z`,
|
|
99
|
-
}));
|
|
100
|
-
const summary = summarizeJournalEntries(entries);
|
|
101
|
-
// Should not include all 10
|
|
102
|
-
assert.strictEqual(summary.includes('Entry 6'), false);
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
describe('buildCompressedContext', () => {
|
|
106
|
-
it('builds context with methodology layer', () => {
|
|
107
|
-
const context = buildCompressedContext(testDir);
|
|
108
|
-
assert.strictEqual(context.layers.some(l => l.name === 'methodology'), true);
|
|
109
|
-
});
|
|
110
|
-
it('includes current state layer', () => {
|
|
111
|
-
const context = buildCompressedContext(testDir);
|
|
112
|
-
assert.strictEqual(context.layers.some(l => l.name === 'current_state'), true);
|
|
113
|
-
});
|
|
114
|
-
it('calculates total tokens', () => {
|
|
115
|
-
const context = buildCompressedContext(testDir);
|
|
116
|
-
assert.strictEqual(context.totalTokens > 0, true);
|
|
117
|
-
assert.strictEqual(typeof context.totalTokens, 'number');
|
|
118
|
-
});
|
|
119
|
-
it('respects maxTokens option', () => {
|
|
120
|
-
const context = buildCompressedContext(testDir, { maxTokens: 500 });
|
|
121
|
-
assert.strictEqual(context.totalTokens <= 500, true);
|
|
122
|
-
});
|
|
123
|
-
it('includes journal summary when entries exist', () => {
|
|
124
|
-
saveToJournal({
|
|
125
|
-
projectPath: testDir,
|
|
126
|
-
title: 'Test entry',
|
|
127
|
-
conversation: 'Test content',
|
|
128
|
-
});
|
|
129
|
-
const context = buildCompressedContext(testDir);
|
|
130
|
-
assert.strictEqual(context.layers.some(l => l.name === 'journal_summary'), true);
|
|
131
|
-
});
|
|
132
|
-
it('includes task description when provided', () => {
|
|
133
|
-
const context = buildCompressedContext(testDir, {
|
|
134
|
-
taskDescription: 'Fix the authentication bug'
|
|
135
|
-
});
|
|
136
|
-
assert.strictEqual(context.layers.some(l => l.name === 'current_task'), true);
|
|
137
|
-
const taskLayer = context.layers.find(l => l.name === 'current_task');
|
|
138
|
-
assert.strictEqual(taskLayer?.content.includes('authentication bug'), true);
|
|
139
|
-
});
|
|
140
|
-
it('sets truncated flag when content exceeds budget', () => {
|
|
141
|
-
// Add a lot of journal entries
|
|
142
|
-
for (let i = 0; i < 20; i++) {
|
|
143
|
-
saveToJournal({
|
|
144
|
-
projectPath: testDir,
|
|
145
|
-
title: `Entry ${i}`,
|
|
146
|
-
conversation: 'A'.repeat(500),
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
const context = buildCompressedContext(testDir, { maxTokens: 200 });
|
|
150
|
-
// Might be truncated due to low token budget
|
|
151
|
-
assert.strictEqual(typeof context.truncated, 'boolean');
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
describe('contextToString', () => {
|
|
155
|
-
it('converts context to string with sections', () => {
|
|
156
|
-
const context = buildCompressedContext(testDir);
|
|
157
|
-
const str = contextToString(context);
|
|
158
|
-
assert.strictEqual(str.includes('# METHODOLOGY & STATE'), true);
|
|
159
|
-
});
|
|
160
|
-
it('groups layers by position', () => {
|
|
161
|
-
const context = buildCompressedContext(testDir);
|
|
162
|
-
const str = contextToString(context);
|
|
163
|
-
// Check structure
|
|
164
|
-
assert.strictEqual(typeof str, 'string');
|
|
165
|
-
assert.strictEqual(str.length > 0, true);
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
describe('getContextStats', () => {
|
|
169
|
-
it('returns token statistics', () => {
|
|
170
|
-
const stats = getContextStats(testDir);
|
|
171
|
-
assert.strictEqual(typeof stats.estimatedTokens, 'number');
|
|
172
|
-
assert.strictEqual(typeof stats.compressionRatio, 'number');
|
|
173
|
-
});
|
|
174
|
-
it('provides layer breakdown', () => {
|
|
175
|
-
const stats = getContextStats(testDir);
|
|
176
|
-
assert.strictEqual(typeof stats.layerBreakdown, 'object');
|
|
177
|
-
assert.strictEqual('methodology' in stats.layerBreakdown, true);
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
describe('Summary Caching', () => {
|
|
181
|
-
it('setCachedSummary stores summary', () => {
|
|
182
|
-
const content = 'This is the original content that would be summarized.';
|
|
183
|
-
const summary = 'Original summarized.';
|
|
184
|
-
setCachedSummary(testDir, content, 50, summary);
|
|
185
|
-
const cached = getCachedSummary(testDir, content, 50);
|
|
186
|
-
assert.strictEqual(cached, summary);
|
|
187
|
-
});
|
|
188
|
-
it('getCachedSummary returns null for uncached content', () => {
|
|
189
|
-
const cached = getCachedSummary(testDir, 'uncached content', 50);
|
|
190
|
-
assert.strictEqual(cached, null);
|
|
191
|
-
});
|
|
192
|
-
it('getCachedSummary returns null for different maxTokens', () => {
|
|
193
|
-
const content = 'Same content';
|
|
194
|
-
setCachedSummary(testDir, content, 50, 'summary for 50');
|
|
195
|
-
const cached = getCachedSummary(testDir, content, 100);
|
|
196
|
-
assert.strictEqual(cached, null);
|
|
197
|
-
});
|
|
198
|
-
it('getCacheStats tracks entries', () => {
|
|
199
|
-
setCachedSummary(testDir, 'Content 1', 50, 'Summary 1');
|
|
200
|
-
setCachedSummary(testDir, 'Content 2', 50, 'Summary 2');
|
|
201
|
-
const stats = getCacheStats(testDir);
|
|
202
|
-
assert.strictEqual(stats.entries, 2);
|
|
203
|
-
});
|
|
204
|
-
it('getCacheStats calculates token savings', () => {
|
|
205
|
-
const longContent = 'A'.repeat(1000); // ~250 tokens
|
|
206
|
-
const shortSummary = 'Short summary'; // ~3 tokens
|
|
207
|
-
setCachedSummary(testDir, longContent, 50, shortSummary);
|
|
208
|
-
const stats = getCacheStats(testDir);
|
|
209
|
-
assert.strictEqual(stats.tokensSaved > 200, true);
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
//# sourceMappingURL=context.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.test.js","sourceRoot":"","sources":["../../src/tests/context.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAiB,MAAM,IAAI,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAE5B,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,qBAAqB,GAAG,IAAI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