monomind 1.18.9 → 1.18.10
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/package.json +1 -1
- package/packages/@monomind/cli/dist/src/commands/hooks-coverage-commands.d.ts +1 -2
- package/packages/@monomind/cli/dist/src/commands/hooks-coverage-commands.js +1 -2
- package/packages/@monomind/cli/dist/src/commands/hooks-coverage-gaps.d.ts +1 -2
- package/packages/@monomind/cli/dist/src/commands/hooks-coverage-gaps.js +2 -117
- package/packages/@monomind/cli/dist/src/commands/hooks.js +1 -2
- package/packages/@monomind/cli/dist/src/commands/index.d.ts +0 -1
- package/packages/@monomind/cli/dist/src/commands/index.js +0 -1
- package/packages/@monomind/cli/dist/src/init/executor.d.ts +3 -0
- package/packages/@monomind/cli/dist/src/init/executor.js +20 -111
- package/packages/@monomind/cli/dist/src/mcp-client.js +0 -2
- package/packages/@monomind/cli/dist/src/mcp-tools/index.d.ts +0 -1
- package/packages/@monomind/cli/dist/src/mcp-tools/index.js +0 -1
- package/packages/@monomind/cli/dist/src/mcp-tools/quality/coverage-analysis/track-trends.d.ts +4 -4
- package/packages/@monomind/cli/dist/src/mcp-tools/quality/test-generation/suggest-tests.d.ts +4 -4
- package/packages/@monomind/cli/package.json +1 -1
- package/packages/@monomind/cli/dist/src/benchmarks/benchmark-runner.d.ts +0 -134
- package/packages/@monomind/cli/dist/src/benchmarks/benchmark-runner.js +0 -340
- package/packages/@monomind/cli/dist/src/benchmarks/metric-evaluators.d.ts +0 -36
- package/packages/@monomind/cli/dist/src/benchmarks/metric-evaluators.js +0 -125
- package/packages/@monomind/cli/dist/src/commands/benchmark.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/commands/benchmark.js +0 -586
- package/packages/@monomind/cli/dist/src/commands/migrate.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/migrate.js +0 -789
- package/packages/@monomind/cli/dist/src/commands/monovector/backup.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/monovector/backup.js +0 -752
- package/packages/@monomind/cli/dist/src/commands/monovector/benchmark.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/monovector/benchmark.js +0 -502
- package/packages/@monomind/cli/dist/src/commands/monovector/import.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/commands/monovector/import.js +0 -374
- package/packages/@monomind/cli/dist/src/commands/monovector/index.d.ts +0 -29
- package/packages/@monomind/cli/dist/src/commands/monovector/index.js +0 -129
- package/packages/@monomind/cli/dist/src/commands/monovector/init.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/monovector/init.js +0 -481
- package/packages/@monomind/cli/dist/src/commands/monovector/migrate.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/monovector/migrate.js +0 -500
- package/packages/@monomind/cli/dist/src/commands/monovector/optimize.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/monovector/optimize.js +0 -515
- package/packages/@monomind/cli/dist/src/commands/monovector/setup.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/commands/monovector/setup.js +0 -775
- package/packages/@monomind/cli/dist/src/commands/monovector/status.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/monovector/status.js +0 -491
- package/packages/@monomind/cli/dist/src/commands/progress.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/progress.js +0 -261
- package/packages/@monomind/cli/dist/src/mcp-tools/progress-tools.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/mcp-tools/progress-tools.js +0 -353
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v1 Progress CLI Command
|
|
3
|
-
*
|
|
4
|
-
* Check and manage v1 implementation progress.
|
|
5
|
-
*
|
|
6
|
-
* @module @monoes/cli/commands/progress
|
|
7
|
-
*/
|
|
8
|
-
import { output } from '../output.js';
|
|
9
|
-
import { callMCPTool, MCPClientError } from '../mcp-client.js';
|
|
10
|
-
function progressBar(percent, width = 20) {
|
|
11
|
-
const filled = Math.round((percent / 100) * width);
|
|
12
|
-
const empty = width - filled;
|
|
13
|
-
const bar = output.success('█'.repeat(filled)) + output.dim('░'.repeat(empty));
|
|
14
|
-
return `[${bar}] ${percent}%`;
|
|
15
|
-
}
|
|
16
|
-
// Check subcommand
|
|
17
|
-
const checkCommand = {
|
|
18
|
-
name: 'check',
|
|
19
|
-
description: 'Check current progress (default)',
|
|
20
|
-
options: [
|
|
21
|
-
{
|
|
22
|
-
name: 'detailed',
|
|
23
|
-
short: 'd',
|
|
24
|
-
description: 'Show detailed breakdown',
|
|
25
|
-
type: 'boolean',
|
|
26
|
-
default: false,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
action: async (ctx) => {
|
|
30
|
-
const detailed = ctx.flags.detailed;
|
|
31
|
-
const spinner = output.createSpinner({ text: 'Checking v1 progress...' });
|
|
32
|
-
try {
|
|
33
|
-
spinner.start();
|
|
34
|
-
const result = (await callMCPTool('progress_check', { detailed }));
|
|
35
|
-
spinner.stop();
|
|
36
|
-
if (ctx.flags.format === 'json') {
|
|
37
|
-
output.printJson(result);
|
|
38
|
-
return { success: true, data: result };
|
|
39
|
-
}
|
|
40
|
-
const progressValue = result.overall ?? result.progress ?? 0;
|
|
41
|
-
output.writeln();
|
|
42
|
-
output.writeln(output.bold('v1 Implementation Progress'));
|
|
43
|
-
output.writeln();
|
|
44
|
-
output.writeln(progressBar(progressValue, 30));
|
|
45
|
-
output.writeln();
|
|
46
|
-
if (detailed && result.cli) {
|
|
47
|
-
output.writeln(output.highlight('CLI Commands:') +
|
|
48
|
-
` ${result.cli.progress}% (${result.cli.commands}/${result.cli.target})`);
|
|
49
|
-
output.writeln(output.highlight('MCP Tools:') +
|
|
50
|
-
` ${result.mcp?.progress ?? 0}% (${result.mcp?.tools ?? 0}/${result.mcp?.target ?? 0})`);
|
|
51
|
-
output.writeln(output.highlight('Hooks:') +
|
|
52
|
-
` ${result.hooks?.progress ?? 0}% (${result.hooks?.subcommands ?? 0}/${result.hooks?.target ?? 0})`);
|
|
53
|
-
output.writeln(output.highlight('Packages:') +
|
|
54
|
-
` ${result.packages?.progress ?? 0}% (${result.packages?.total ?? 0}/${result.packages?.target ?? 0})`);
|
|
55
|
-
output.writeln(output.highlight('DDD Structure:') +
|
|
56
|
-
` ${result.ddd?.progress ?? 0}% (${result.packages?.withDDD ?? 0}/${result.packages?.total ?? 0})`);
|
|
57
|
-
output.writeln();
|
|
58
|
-
if (result.codebase) {
|
|
59
|
-
output.writeln(output.dim(`Codebase: ${result.codebase.totalFiles} files, ${result.codebase.totalLines.toLocaleString()} lines`));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
else if (result.breakdown) {
|
|
63
|
-
output.writeln('Breakdown:');
|
|
64
|
-
for (const [category, value] of Object.entries(result.breakdown)) {
|
|
65
|
-
output.writeln(` ${output.highlight(category)}: ${value}`);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
if (result.lastUpdated) {
|
|
69
|
-
output.writeln(output.dim(`Last updated: ${result.lastUpdated}`));
|
|
70
|
-
}
|
|
71
|
-
return { success: true, data: result };
|
|
72
|
-
}
|
|
73
|
-
catch (error) {
|
|
74
|
-
spinner.fail('Progress check failed');
|
|
75
|
-
if (error instanceof MCPClientError) {
|
|
76
|
-
output.printError(`Error: ${error.message}`);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
output.printError(`Unexpected error: ${String(error)}`);
|
|
80
|
-
}
|
|
81
|
-
return { success: false, exitCode: 1 };
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
// Sync subcommand
|
|
86
|
-
const syncCommand = {
|
|
87
|
-
name: 'sync',
|
|
88
|
-
description: 'Calculate and persist progress',
|
|
89
|
-
action: async (ctx) => {
|
|
90
|
-
const spinner = output.createSpinner({ text: 'Syncing progress...' });
|
|
91
|
-
try {
|
|
92
|
-
spinner.start();
|
|
93
|
-
const result = (await callMCPTool('progress_sync', {}));
|
|
94
|
-
spinner.stop();
|
|
95
|
-
if (ctx.flags.format === 'json') {
|
|
96
|
-
output.printJson(result);
|
|
97
|
-
return { success: true, data: result };
|
|
98
|
-
}
|
|
99
|
-
output.writeln();
|
|
100
|
-
output.printSuccess(`Progress synced: ${result.progress}%`);
|
|
101
|
-
output.writeln(output.dim(` Persisted to .monomind/metrics/v1-progress.json`));
|
|
102
|
-
output.writeln(output.dim(` Last updated: ${result.lastUpdated}`));
|
|
103
|
-
return { success: true, data: result };
|
|
104
|
-
}
|
|
105
|
-
catch (error) {
|
|
106
|
-
spinner.fail('Progress sync failed');
|
|
107
|
-
if (error instanceof MCPClientError) {
|
|
108
|
-
output.printError(`Error: ${error.message}`);
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
output.printError(`Unexpected error: ${String(error)}`);
|
|
112
|
-
}
|
|
113
|
-
return { success: false, exitCode: 1 };
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
// Summary subcommand
|
|
118
|
-
const summaryCommand = {
|
|
119
|
-
name: 'summary',
|
|
120
|
-
description: 'Show human-readable summary',
|
|
121
|
-
action: async (ctx) => {
|
|
122
|
-
const spinner = output.createSpinner({ text: 'Getting progress summary...' });
|
|
123
|
-
try {
|
|
124
|
-
spinner.start();
|
|
125
|
-
const result = (await callMCPTool('progress_summary', {}));
|
|
126
|
-
spinner.stop();
|
|
127
|
-
if (ctx.flags.format === 'json') {
|
|
128
|
-
output.printJson(result);
|
|
129
|
-
return { success: true, data: result };
|
|
130
|
-
}
|
|
131
|
-
output.writeln();
|
|
132
|
-
output.writeln(result.summary ?? '');
|
|
133
|
-
return { success: true, data: result };
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
spinner.fail('Summary fetch failed');
|
|
137
|
-
if (error instanceof MCPClientError) {
|
|
138
|
-
output.printError(`Error: ${error.message}`);
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
output.printError(`Unexpected error: ${String(error)}`);
|
|
142
|
-
}
|
|
143
|
-
return { success: false, exitCode: 1 };
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
|
-
// Watch subcommand
|
|
148
|
-
const watchCommand = {
|
|
149
|
-
name: 'watch',
|
|
150
|
-
description: 'Watch for progress changes',
|
|
151
|
-
options: [
|
|
152
|
-
{
|
|
153
|
-
name: 'interval',
|
|
154
|
-
short: 'i',
|
|
155
|
-
description: 'Update interval in milliseconds',
|
|
156
|
-
type: 'number',
|
|
157
|
-
default: 5000,
|
|
158
|
-
},
|
|
159
|
-
],
|
|
160
|
-
action: async (ctx) => {
|
|
161
|
-
const rawInterval = ctx.flags.interval || 5000;
|
|
162
|
-
const interval = Number.isFinite(rawInterval) ? Math.max(500, Math.min(rawInterval, 3_600_000)) : 5000; // min 500ms, max 1h
|
|
163
|
-
output.writeln(output.highlight(`Watching progress (interval: ${interval}ms). Press Ctrl+C to stop.`));
|
|
164
|
-
output.writeln();
|
|
165
|
-
let lastProgress = 0;
|
|
166
|
-
const check = async () => {
|
|
167
|
-
try {
|
|
168
|
-
const result = (await callMCPTool('progress_check', {}));
|
|
169
|
-
const currentProgress = result.overall ?? result.progress ?? 0;
|
|
170
|
-
if (currentProgress !== lastProgress) {
|
|
171
|
-
output.writeln(`${output.warning('→')} Progress changed: ${lastProgress}% → ${output.success(currentProgress + '%')}`);
|
|
172
|
-
lastProgress = currentProgress;
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
process.stdout.write(`\r${progressBar(currentProgress, 20)} ${output.dim(new Date().toLocaleTimeString())}`);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
catch (error) {
|
|
179
|
-
output.printError(`Check failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
await check();
|
|
183
|
-
const timer = setInterval(check, interval);
|
|
184
|
-
// Handle Ctrl+C — use once so repeated calls don't accumulate SIGINT handlers
|
|
185
|
-
// (which would trigger MaxListenersExceededWarning and a memory leak).
|
|
186
|
-
process.once('SIGINT', () => {
|
|
187
|
-
clearInterval(timer);
|
|
188
|
-
output.writeln();
|
|
189
|
-
output.writeln(output.dim('Stopped watching.'));
|
|
190
|
-
process.exit(0);
|
|
191
|
-
});
|
|
192
|
-
// Keep running
|
|
193
|
-
return new Promise(() => { });
|
|
194
|
-
},
|
|
195
|
-
};
|
|
196
|
-
// Main progress command
|
|
197
|
-
export const progressCommand = {
|
|
198
|
-
name: 'progress',
|
|
199
|
-
description: 'Check v1 implementation progress',
|
|
200
|
-
aliases: ['prog'],
|
|
201
|
-
subcommands: [checkCommand, syncCommand, summaryCommand, watchCommand],
|
|
202
|
-
options: [
|
|
203
|
-
{
|
|
204
|
-
name: 'detailed',
|
|
205
|
-
short: 'd',
|
|
206
|
-
description: 'Show detailed breakdown',
|
|
207
|
-
type: 'boolean',
|
|
208
|
-
default: false,
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
name: 'sync',
|
|
212
|
-
short: 's',
|
|
213
|
-
description: 'Sync and persist progress',
|
|
214
|
-
type: 'boolean',
|
|
215
|
-
default: false,
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
name: 'watch',
|
|
219
|
-
short: 'w',
|
|
220
|
-
description: 'Watch for changes',
|
|
221
|
-
type: 'boolean',
|
|
222
|
-
default: false,
|
|
223
|
-
},
|
|
224
|
-
],
|
|
225
|
-
examples: [
|
|
226
|
-
{
|
|
227
|
-
command: 'monomind progress',
|
|
228
|
-
description: 'Check current progress',
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
command: 'monomind progress --detailed',
|
|
232
|
-
description: 'Show detailed breakdown',
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
command: 'monomind progress sync',
|
|
236
|
-
description: 'Sync and persist progress',
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
command: 'monomind progress watch',
|
|
240
|
-
description: 'Watch for changes',
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
command: 'monomind progress --json',
|
|
244
|
-
description: 'Output as JSON',
|
|
245
|
-
},
|
|
246
|
-
],
|
|
247
|
-
action: async (ctx) => {
|
|
248
|
-
// Handle --sync flag
|
|
249
|
-
if (ctx.flags.sync) {
|
|
250
|
-
return (await syncCommand.action(ctx));
|
|
251
|
-
}
|
|
252
|
-
// Handle --watch flag
|
|
253
|
-
if (ctx.flags.watch) {
|
|
254
|
-
return (await watchCommand.action(ctx));
|
|
255
|
-
}
|
|
256
|
-
// Default to check
|
|
257
|
-
return (await checkCommand.action(ctx));
|
|
258
|
-
},
|
|
259
|
-
};
|
|
260
|
-
export default progressCommand;
|
|
261
|
-
//# sourceMappingURL=progress.js.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* V1 Progress MCP Tools
|
|
3
|
-
*
|
|
4
|
-
* Provides MCP tools for checking and syncing V1 implementation progress.
|
|
5
|
-
*
|
|
6
|
-
* @module @monomind/cli/mcp-tools/progress
|
|
7
|
-
*/
|
|
8
|
-
import type { MCPTool } from './types.js';
|
|
9
|
-
/**
|
|
10
|
-
* All progress tools
|
|
11
|
-
*/
|
|
12
|
-
export declare const progressTools: MCPTool[];
|
|
13
|
-
export default progressTools;
|
|
14
|
-
//# sourceMappingURL=progress-tools.d.ts.map
|
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* V1 Progress MCP Tools
|
|
3
|
-
*
|
|
4
|
-
* Provides MCP tools for checking and syncing V1 implementation progress.
|
|
5
|
-
*
|
|
6
|
-
* @module @monomind/cli/mcp-tools/progress
|
|
7
|
-
*/
|
|
8
|
-
import { existsSync, readdirSync, readFileSync, writeFileSync, renameSync, mkdirSync, statSync } from 'fs';
|
|
9
|
-
import { join, basename, dirname } from 'path';
|
|
10
|
-
import { fileURLToPath } from 'url';
|
|
11
|
-
// Get project root - handles both src and dist paths
|
|
12
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
-
const __dirname = dirname(__filename);
|
|
14
|
-
// From dist/src/mcp-tools or src/mcp-tools, navigate to v1 directory
|
|
15
|
-
// CLI is at packages/@monomind/cli, so go up 2 levels from cli to get to v1
|
|
16
|
-
const CLI_ROOT = join(__dirname, '../../..');
|
|
17
|
-
const MONOMIND_DIR = join(CLI_ROOT, '..'); // @monomind directory
|
|
18
|
-
const PACKAGES_DIR = join(MONOMIND_DIR, '..'); // v1 directory
|
|
19
|
-
const PROJECT_ROOT = join(PACKAGES_DIR, '..');
|
|
20
|
-
// Utility/service packages follow DDD differently - their services ARE the application layer
|
|
21
|
-
const UTILITY_PACKAGES = new Set([
|
|
22
|
-
'cli', 'hooks', 'mcp', 'shared', 'testing', 'agents', 'integration',
|
|
23
|
-
'embeddings', 'deployment', 'performance', 'providers'
|
|
24
|
-
]);
|
|
25
|
-
// Target metrics for 100% completion
|
|
26
|
-
const TARGETS = {
|
|
27
|
-
CLI_COMMANDS: 28,
|
|
28
|
-
MCP_TOOLS: 100,
|
|
29
|
-
HOOKS_SUBCOMMANDS: 27, // 27 hooks documented in CLAUDE.md
|
|
30
|
-
PACKAGES: 17,
|
|
31
|
-
};
|
|
32
|
-
// Weight distribution for overall progress
|
|
33
|
-
const WEIGHTS = {
|
|
34
|
-
CLI: 0.25,
|
|
35
|
-
MCP: 0.25,
|
|
36
|
-
HOOKS: 0.20,
|
|
37
|
-
PACKAGES: 0.15,
|
|
38
|
-
DDD: 0.15,
|
|
39
|
-
};
|
|
40
|
-
function countFilesAndLines(dir, ext = '.ts') {
|
|
41
|
-
let files = 0;
|
|
42
|
-
let lines = 0;
|
|
43
|
-
function walk(currentDir) {
|
|
44
|
-
if (!existsSync(currentDir))
|
|
45
|
-
return;
|
|
46
|
-
try {
|
|
47
|
-
const entries = readdirSync(currentDir, { withFileTypes: true });
|
|
48
|
-
for (const entry of entries) {
|
|
49
|
-
const fullPath = join(currentDir, entry.name);
|
|
50
|
-
if (entry.isDirectory() && !entry.name.includes('node_modules') && !entry.name.startsWith('.')) {
|
|
51
|
-
walk(fullPath);
|
|
52
|
-
}
|
|
53
|
-
else if (entry.isFile() && entry.name.endsWith(ext)) {
|
|
54
|
-
files++;
|
|
55
|
-
try {
|
|
56
|
-
// Skip files > 1 MB to avoid loading generated/minified bundles into memory.
|
|
57
|
-
if (statSync(fullPath).size > 1024 * 1024)
|
|
58
|
-
continue;
|
|
59
|
-
const content = readFileSync(fullPath, 'utf-8');
|
|
60
|
-
lines += content.split('\n').length;
|
|
61
|
-
}
|
|
62
|
-
catch (_e) { /* ignore */ }
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
catch (_e) { /* ignore */ }
|
|
67
|
-
}
|
|
68
|
-
walk(dir);
|
|
69
|
-
return { files, lines };
|
|
70
|
-
}
|
|
71
|
-
function calculateModuleProgress(moduleDir) {
|
|
72
|
-
if (!existsSync(moduleDir))
|
|
73
|
-
return 0;
|
|
74
|
-
const moduleName = basename(moduleDir);
|
|
75
|
-
// Utility packages are 100% complete by design
|
|
76
|
-
if (UTILITY_PACKAGES.has(moduleName)) {
|
|
77
|
-
return 100;
|
|
78
|
-
}
|
|
79
|
-
let progress = 0;
|
|
80
|
-
// Check for DDD structure
|
|
81
|
-
if (existsSync(join(moduleDir, 'src/domain')))
|
|
82
|
-
progress += 30;
|
|
83
|
-
if (existsSync(join(moduleDir, 'src/application')))
|
|
84
|
-
progress += 30;
|
|
85
|
-
if (existsSync(join(moduleDir, 'src')))
|
|
86
|
-
progress += 10;
|
|
87
|
-
if (existsSync(join(moduleDir, 'src/index.ts')) || existsSync(join(moduleDir, 'index.ts')))
|
|
88
|
-
progress += 10;
|
|
89
|
-
if (existsSync(join(moduleDir, '__tests__')) || existsSync(join(moduleDir, 'tests')))
|
|
90
|
-
progress += 10;
|
|
91
|
-
if (existsSync(join(moduleDir, 'package.json')))
|
|
92
|
-
progress += 10;
|
|
93
|
-
return Math.min(progress, 100);
|
|
94
|
-
}
|
|
95
|
-
async function calculateProgress() {
|
|
96
|
-
const now = new Date().toISOString();
|
|
97
|
-
// Count V1 modules
|
|
98
|
-
const modulesDir = join(PACKAGES_DIR, '@monomind');
|
|
99
|
-
const modules = [];
|
|
100
|
-
let totalProgress = 0;
|
|
101
|
-
let explicitDDD = 0;
|
|
102
|
-
let utilityDDD = 0;
|
|
103
|
-
if (existsSync(modulesDir)) {
|
|
104
|
-
const entries = readdirSync(modulesDir, { withFileTypes: true });
|
|
105
|
-
for (const entry of entries) {
|
|
106
|
-
if (entry.isDirectory() && !entry.name.startsWith('.')) {
|
|
107
|
-
const moduleDir = join(modulesDir, entry.name);
|
|
108
|
-
const { files, lines } = countFilesAndLines(moduleDir);
|
|
109
|
-
const progress = calculateModuleProgress(moduleDir);
|
|
110
|
-
modules.push({ name: entry.name, files, lines, progress });
|
|
111
|
-
totalProgress += progress;
|
|
112
|
-
if (UTILITY_PACKAGES.has(entry.name)) {
|
|
113
|
-
utilityDDD++;
|
|
114
|
-
}
|
|
115
|
-
else if (progress >= 60) {
|
|
116
|
-
explicitDDD++;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
const avgProgress = modules.length > 0 ? Math.round(totalProgress / modules.length) : 0;
|
|
122
|
-
const totalStats = countFilesAndLines(PACKAGES_DIR);
|
|
123
|
-
// Count CLI commands (from commands/index.ts)
|
|
124
|
-
let cliCommands = 28; // Default to known count
|
|
125
|
-
const commandsIndexPath = join(PACKAGES_DIR, '@monomind/cli/src/commands/index.ts');
|
|
126
|
-
if (existsSync(commandsIndexPath) && statSync(commandsIndexPath).size <= 1024 * 1024) {
|
|
127
|
-
try {
|
|
128
|
-
const content = readFileSync(commandsIndexPath, 'utf-8');
|
|
129
|
-
const matches = content.match(/export const commands.*\[([^\]]+)\]/s);
|
|
130
|
-
if (matches) {
|
|
131
|
-
cliCommands = (matches[1].match(/Command/g) || []).length || 28;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
catch (_e) { /* ignore */ }
|
|
135
|
-
}
|
|
136
|
-
// Count MCP tools
|
|
137
|
-
let mcpTools = 100; // Approximate
|
|
138
|
-
const toolsIndexPath = join(PACKAGES_DIR, '@monomind/cli/src/mcp-tools/index.ts');
|
|
139
|
-
if (existsSync(toolsIndexPath) && statSync(toolsIndexPath).size <= 1024 * 1024) {
|
|
140
|
-
try {
|
|
141
|
-
const content = readFileSync(toolsIndexPath, 'utf-8');
|
|
142
|
-
mcpTools = (content.match(/export.*Tools/g) || []).length * 10 || 100;
|
|
143
|
-
}
|
|
144
|
-
catch (_e) { /* ignore */ }
|
|
145
|
-
}
|
|
146
|
-
// Count hooks subcommands (count const *Command definitions)
|
|
147
|
-
let hooksSubcommands = 27; // Default to documented count
|
|
148
|
-
const hooksPath = join(PACKAGES_DIR, '@monomind/cli/src/commands/hooks.ts');
|
|
149
|
-
if (existsSync(hooksPath) && statSync(hooksPath).size <= 1024 * 1024) {
|
|
150
|
-
try {
|
|
151
|
-
const content = readFileSync(hooksPath, 'utf-8');
|
|
152
|
-
// Count command definitions like "const fooCommand: Command = {"
|
|
153
|
-
const commandDefs = content.match(/const\s+\w+Command\s*:\s*Command\s*=/g);
|
|
154
|
-
if (commandDefs && commandDefs.length > 0) {
|
|
155
|
-
hooksSubcommands = commandDefs.length;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
catch (_e) { /* ignore */ }
|
|
159
|
-
}
|
|
160
|
-
// Calculate component progress
|
|
161
|
-
const cliProgress = Math.min(100, Math.round((cliCommands / TARGETS.CLI_COMMANDS) * 100));
|
|
162
|
-
const mcpProgress = Math.min(100, Math.round((mcpTools / TARGETS.MCP_TOOLS) * 100));
|
|
163
|
-
const hooksProgress = Math.min(100, Math.round((hooksSubcommands / TARGETS.HOOKS_SUBCOMMANDS) * 100));
|
|
164
|
-
const packagesProgress = Math.min(100, Math.round((modules.length / TARGETS.PACKAGES) * 100));
|
|
165
|
-
// Calculate overall weighted progress
|
|
166
|
-
const overall = Math.round(cliProgress * WEIGHTS.CLI +
|
|
167
|
-
mcpProgress * WEIGHTS.MCP +
|
|
168
|
-
hooksProgress * WEIGHTS.HOOKS +
|
|
169
|
-
packagesProgress * WEIGHTS.PACKAGES +
|
|
170
|
-
avgProgress * WEIGHTS.DDD);
|
|
171
|
-
return {
|
|
172
|
-
overall,
|
|
173
|
-
cli: { commands: cliCommands, target: TARGETS.CLI_COMMANDS, progress: cliProgress },
|
|
174
|
-
mcp: { tools: mcpTools, target: TARGETS.MCP_TOOLS, progress: mcpProgress },
|
|
175
|
-
hooks: { subcommands: hooksSubcommands, target: TARGETS.HOOKS_SUBCOMMANDS, progress: hooksProgress },
|
|
176
|
-
packages: {
|
|
177
|
-
total: modules.length,
|
|
178
|
-
withDDD: explicitDDD + utilityDDD,
|
|
179
|
-
target: TARGETS.PACKAGES,
|
|
180
|
-
progress: packagesProgress,
|
|
181
|
-
list: modules.map(m => m.name),
|
|
182
|
-
},
|
|
183
|
-
ddd: { explicit: explicitDDD, utility: utilityDDD, progress: avgProgress },
|
|
184
|
-
codebase: { totalFiles: totalStats.files, totalLines: totalStats.lines },
|
|
185
|
-
lastUpdated: now,
|
|
186
|
-
source: 'ProgressService',
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
async function syncProgress() {
|
|
190
|
-
const metrics = await calculateProgress();
|
|
191
|
-
// Persist to file
|
|
192
|
-
const metricsDir = join(PROJECT_ROOT, '.monomind/metrics');
|
|
193
|
-
if (!existsSync(metricsDir)) {
|
|
194
|
-
mkdirSync(metricsDir, { recursive: true });
|
|
195
|
-
}
|
|
196
|
-
const outputPath = join(metricsDir, 'v1-progress.json');
|
|
197
|
-
const outputTmp = outputPath + '.tmp';
|
|
198
|
-
writeFileSync(outputTmp, JSON.stringify({
|
|
199
|
-
domains: { completed: Math.floor(metrics.packages.withDDD / 3), total: 5 },
|
|
200
|
-
ddd: {
|
|
201
|
-
progress: metrics.ddd.progress,
|
|
202
|
-
modules: metrics.packages.total,
|
|
203
|
-
totalFiles: metrics.codebase.totalFiles,
|
|
204
|
-
totalLines: metrics.codebase.totalLines,
|
|
205
|
-
},
|
|
206
|
-
swarm: { activeAgents: 0, totalAgents: 15 },
|
|
207
|
-
lastUpdated: metrics.lastUpdated,
|
|
208
|
-
source: 'ProgressService',
|
|
209
|
-
}, null, 2));
|
|
210
|
-
renameSync(outputTmp, outputPath);
|
|
211
|
-
return metrics;
|
|
212
|
-
}
|
|
213
|
-
function getSummary(metrics) {
|
|
214
|
-
const lines = [
|
|
215
|
-
'═══════════════════════════════════════════════════',
|
|
216
|
-
' V1 Implementation Progress',
|
|
217
|
-
'═══════════════════════════════════════════════════',
|
|
218
|
-
'',
|
|
219
|
-
` Overall Progress: ${metrics.overall}%`,
|
|
220
|
-
'',
|
|
221
|
-
` CLI Commands: ${metrics.cli.progress}% (${metrics.cli.commands}/${metrics.cli.target})`,
|
|
222
|
-
` MCP Tools: ${metrics.mcp.progress}% (${metrics.mcp.tools}/${metrics.mcp.target})`,
|
|
223
|
-
` Hooks: ${metrics.hooks.progress}% (${metrics.hooks.subcommands}/${metrics.hooks.target})`,
|
|
224
|
-
` Packages: ${metrics.packages.progress}% (${metrics.packages.total}/${metrics.packages.target})`,
|
|
225
|
-
` DDD Structure: ${metrics.ddd.progress}%`,
|
|
226
|
-
'',
|
|
227
|
-
` Codebase: ${metrics.codebase.totalFiles} files, ${metrics.codebase.totalLines.toLocaleString()} lines`,
|
|
228
|
-
'',
|
|
229
|
-
` Last Updated: ${metrics.lastUpdated}`,
|
|
230
|
-
'═══════════════════════════════════════════════════',
|
|
231
|
-
];
|
|
232
|
-
return lines.join('\n');
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* progress/check - Get current V1 implementation progress
|
|
236
|
-
*/
|
|
237
|
-
const progressCheck = {
|
|
238
|
-
name: 'progress_check',
|
|
239
|
-
description: 'Get current V1 implementation progress percentage and metrics',
|
|
240
|
-
inputSchema: {
|
|
241
|
-
type: 'object',
|
|
242
|
-
properties: {
|
|
243
|
-
detailed: {
|
|
244
|
-
type: 'boolean',
|
|
245
|
-
description: 'Include detailed breakdown by category',
|
|
246
|
-
},
|
|
247
|
-
},
|
|
248
|
-
required: [],
|
|
249
|
-
},
|
|
250
|
-
handler: async (params) => {
|
|
251
|
-
const detailed = params.detailed;
|
|
252
|
-
const metrics = await calculateProgress();
|
|
253
|
-
if (detailed) {
|
|
254
|
-
return {
|
|
255
|
-
overall: metrics.overall,
|
|
256
|
-
cli: metrics.cli,
|
|
257
|
-
mcp: metrics.mcp,
|
|
258
|
-
hooks: metrics.hooks,
|
|
259
|
-
packages: metrics.packages,
|
|
260
|
-
ddd: metrics.ddd,
|
|
261
|
-
codebase: metrics.codebase,
|
|
262
|
-
lastUpdated: metrics.lastUpdated,
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
return {
|
|
266
|
-
progress: metrics.overall,
|
|
267
|
-
summary: `Implementation: ${metrics.overall}% complete`,
|
|
268
|
-
breakdown: {
|
|
269
|
-
cli: `${metrics.cli.progress}%`,
|
|
270
|
-
mcp: `${metrics.mcp.progress}%`,
|
|
271
|
-
hooks: `${metrics.hooks.progress}%`,
|
|
272
|
-
packages: `${metrics.packages.progress}%`,
|
|
273
|
-
ddd: `${metrics.ddd.progress}%`,
|
|
274
|
-
},
|
|
275
|
-
};
|
|
276
|
-
},
|
|
277
|
-
};
|
|
278
|
-
/**
|
|
279
|
-
* progress/sync - Calculate and persist V1 progress
|
|
280
|
-
*/
|
|
281
|
-
const progressSync = {
|
|
282
|
-
name: 'progress_sync',
|
|
283
|
-
description: 'Calculate and persist V1 progress metrics to file',
|
|
284
|
-
inputSchema: {
|
|
285
|
-
type: 'object',
|
|
286
|
-
properties: {},
|
|
287
|
-
required: [],
|
|
288
|
-
},
|
|
289
|
-
handler: async () => {
|
|
290
|
-
const metrics = await syncProgress();
|
|
291
|
-
return {
|
|
292
|
-
progress: metrics.overall,
|
|
293
|
-
message: `Progress synced: ${metrics.overall}%`,
|
|
294
|
-
persisted: true,
|
|
295
|
-
lastUpdated: metrics.lastUpdated,
|
|
296
|
-
};
|
|
297
|
-
},
|
|
298
|
-
};
|
|
299
|
-
/**
|
|
300
|
-
* progress/summary - Get human-readable progress summary
|
|
301
|
-
*/
|
|
302
|
-
const progressSummary = {
|
|
303
|
-
name: 'progress_summary',
|
|
304
|
-
description: 'Get human-readable V1 implementation progress summary',
|
|
305
|
-
inputSchema: {
|
|
306
|
-
type: 'object',
|
|
307
|
-
properties: {},
|
|
308
|
-
required: [],
|
|
309
|
-
},
|
|
310
|
-
handler: async () => {
|
|
311
|
-
const metrics = await calculateProgress();
|
|
312
|
-
return {
|
|
313
|
-
summary: getSummary(metrics),
|
|
314
|
-
};
|
|
315
|
-
},
|
|
316
|
-
};
|
|
317
|
-
/**
|
|
318
|
-
* progress/watch - Watch progress (status check)
|
|
319
|
-
*/
|
|
320
|
-
const progressWatch = {
|
|
321
|
-
name: 'progress_watch',
|
|
322
|
-
description: 'Get current watch status for progress monitoring',
|
|
323
|
-
inputSchema: {
|
|
324
|
-
type: 'object',
|
|
325
|
-
properties: {
|
|
326
|
-
action: {
|
|
327
|
-
type: 'string',
|
|
328
|
-
enum: ['status'],
|
|
329
|
-
description: 'Action to perform (status only for MCP)',
|
|
330
|
-
},
|
|
331
|
-
},
|
|
332
|
-
required: [],
|
|
333
|
-
},
|
|
334
|
-
handler: async () => {
|
|
335
|
-
const metrics = await calculateProgress();
|
|
336
|
-
return {
|
|
337
|
-
hasMetrics: true,
|
|
338
|
-
lastProgress: metrics.overall,
|
|
339
|
-
lastUpdated: metrics.lastUpdated,
|
|
340
|
-
};
|
|
341
|
-
},
|
|
342
|
-
};
|
|
343
|
-
/**
|
|
344
|
-
* All progress tools
|
|
345
|
-
*/
|
|
346
|
-
export const progressTools = [
|
|
347
|
-
progressCheck,
|
|
348
|
-
progressSync,
|
|
349
|
-
progressSummary,
|
|
350
|
-
progressWatch,
|
|
351
|
-
];
|
|
352
|
-
export default progressTools;
|
|
353
|
-
//# sourceMappingURL=progress-tools.js.map
|