monomind 1.18.8 → 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.
Files changed (49) hide show
  1. package/package.json +1 -1
  2. package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.d.ts +1 -0
  3. package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.js +17 -1
  4. package/packages/@monomind/cli/dist/src/commands/doctor.js +15 -1
  5. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-commands.d.ts +1 -2
  6. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-commands.js +1 -2
  7. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-gaps.d.ts +1 -2
  8. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-gaps.js +2 -117
  9. package/packages/@monomind/cli/dist/src/commands/hooks.js +1 -2
  10. package/packages/@monomind/cli/dist/src/commands/index.d.ts +0 -4
  11. package/packages/@monomind/cli/dist/src/commands/index.js +0 -22
  12. package/packages/@monomind/cli/dist/src/init/executor.d.ts +3 -0
  13. package/packages/@monomind/cli/dist/src/init/executor.js +20 -111
  14. package/packages/@monomind/cli/dist/src/mcp-client.js +0 -2
  15. package/packages/@monomind/cli/dist/src/mcp-tools/index.d.ts +0 -1
  16. package/packages/@monomind/cli/dist/src/mcp-tools/index.js +0 -1
  17. package/packages/@monomind/cli/dist/src/mcp-tools/quality/coverage-analysis/track-trends.d.ts +4 -4
  18. package/packages/@monomind/cli/dist/src/mcp-tools/quality/test-generation/suggest-tests.d.ts +4 -4
  19. package/packages/@monomind/cli/package.json +1 -1
  20. package/packages/@monomind/cli/dist/src/benchmarks/benchmark-runner.d.ts +0 -134
  21. package/packages/@monomind/cli/dist/src/benchmarks/benchmark-runner.js +0 -340
  22. package/packages/@monomind/cli/dist/src/benchmarks/metric-evaluators.d.ts +0 -36
  23. package/packages/@monomind/cli/dist/src/benchmarks/metric-evaluators.js +0 -125
  24. package/packages/@monomind/cli/dist/src/commands/benchmark.d.ts +0 -10
  25. package/packages/@monomind/cli/dist/src/commands/benchmark.js +0 -586
  26. package/packages/@monomind/cli/dist/src/commands/migrate.d.ts +0 -8
  27. package/packages/@monomind/cli/dist/src/commands/migrate.js +0 -789
  28. package/packages/@monomind/cli/dist/src/commands/monovector/backup.d.ts +0 -11
  29. package/packages/@monomind/cli/dist/src/commands/monovector/backup.js +0 -752
  30. package/packages/@monomind/cli/dist/src/commands/monovector/benchmark.d.ts +0 -11
  31. package/packages/@monomind/cli/dist/src/commands/monovector/benchmark.js +0 -502
  32. package/packages/@monomind/cli/dist/src/commands/monovector/import.d.ts +0 -18
  33. package/packages/@monomind/cli/dist/src/commands/monovector/import.js +0 -374
  34. package/packages/@monomind/cli/dist/src/commands/monovector/index.d.ts +0 -29
  35. package/packages/@monomind/cli/dist/src/commands/monovector/index.js +0 -129
  36. package/packages/@monomind/cli/dist/src/commands/monovector/init.d.ts +0 -11
  37. package/packages/@monomind/cli/dist/src/commands/monovector/init.js +0 -481
  38. package/packages/@monomind/cli/dist/src/commands/monovector/migrate.d.ts +0 -11
  39. package/packages/@monomind/cli/dist/src/commands/monovector/migrate.js +0 -500
  40. package/packages/@monomind/cli/dist/src/commands/monovector/optimize.d.ts +0 -11
  41. package/packages/@monomind/cli/dist/src/commands/monovector/optimize.js +0 -515
  42. package/packages/@monomind/cli/dist/src/commands/monovector/setup.d.ts +0 -18
  43. package/packages/@monomind/cli/dist/src/commands/monovector/setup.js +0 -775
  44. package/packages/@monomind/cli/dist/src/commands/monovector/status.d.ts +0 -11
  45. package/packages/@monomind/cli/dist/src/commands/monovector/status.js +0 -491
  46. package/packages/@monomind/cli/dist/src/commands/progress.d.ts +0 -11
  47. package/packages/@monomind/cli/dist/src/commands/progress.js +0 -261
  48. package/packages/@monomind/cli/dist/src/mcp-tools/progress-tools.d.ts +0 -14
  49. package/packages/@monomind/cli/dist/src/mcp-tools/progress-tools.js +0 -353
@@ -1,515 +0,0 @@
1
- /**
2
- * CLI MonoVector Optimize Command
3
- * Optimization analysis and recommendations
4
- */
5
- import { output } from '../../output.js';
6
- import { confirm } from '../../prompt.js';
7
- /**
8
- * Get PostgreSQL connection config from context
9
- */
10
- function getConnectionConfig(ctx) {
11
- return {
12
- host: ctx.flags.host || process.env.PGHOST || 'localhost',
13
- port: parseInt(ctx.flags.port || process.env.PGPORT || '5432', 10),
14
- database: ctx.flags.database || process.env.PGDATABASE || '',
15
- user: ctx.flags.user || process.env.PGUSER || 'postgres',
16
- password: ctx.flags.password || process.env.PGPASSWORD || '',
17
- ssl: ctx.flags.ssl || process.env.PGSSLMODE === 'require',
18
- schema: ctx.flags.schema || 'monomind',
19
- };
20
- }
21
- /**
22
- * MonoVector optimize command
23
- */
24
- export const optimizeCommand = {
25
- name: 'optimize',
26
- description: 'Optimization analysis and recommendations',
27
- options: [
28
- {
29
- name: 'analyze',
30
- short: 'a',
31
- description: 'Analyze current performance',
32
- type: 'boolean',
33
- default: true,
34
- },
35
- {
36
- name: 'apply',
37
- description: 'Apply suggested optimizations',
38
- type: 'boolean',
39
- default: false,
40
- },
41
- {
42
- name: 'index',
43
- short: 'i',
44
- description: 'Optimize specific index',
45
- type: 'string',
46
- },
47
- {
48
- name: 'vacuum',
49
- description: 'Run VACUUM ANALYZE',
50
- type: 'boolean',
51
- default: false,
52
- },
53
- {
54
- name: 'reindex',
55
- description: 'Rebuild indexes',
56
- type: 'boolean',
57
- default: false,
58
- },
59
- {
60
- name: 'host',
61
- short: 'h',
62
- description: 'PostgreSQL host',
63
- type: 'string',
64
- default: 'localhost',
65
- },
66
- {
67
- name: 'port',
68
- short: 'p',
69
- description: 'PostgreSQL port',
70
- type: 'number',
71
- default: 5432,
72
- },
73
- {
74
- name: 'database',
75
- short: 'd',
76
- description: 'Database name',
77
- type: 'string',
78
- },
79
- {
80
- name: 'user',
81
- short: 'u',
82
- description: 'Database user',
83
- type: 'string',
84
- },
85
- {
86
- name: 'password',
87
- description: 'Database password',
88
- type: 'string',
89
- },
90
- {
91
- name: 'ssl',
92
- description: 'Enable SSL',
93
- type: 'boolean',
94
- default: false,
95
- },
96
- {
97
- name: 'schema',
98
- short: 's',
99
- description: 'Schema name',
100
- type: 'string',
101
- default: 'monomind',
102
- },
103
- ],
104
- examples: [
105
- { command: 'monomind monovector optimize --analyze', description: 'Analyze and show recommendations' },
106
- { command: 'monomind monovector optimize --apply', description: 'Apply optimizations' },
107
- { command: 'monomind monovector optimize --vacuum', description: 'Run VACUUM ANALYZE' },
108
- { command: 'monomind monovector optimize --reindex', description: 'Rebuild all indexes' },
109
- ],
110
- action: async (ctx) => {
111
- const config = getConnectionConfig(ctx);
112
- const applyOptimizations = ctx.flags.apply;
113
- const runVacuum = ctx.flags.vacuum;
114
- const runReindex = ctx.flags.reindex;
115
- const specificIndex = ctx.flags.index;
116
- output.writeln();
117
- output.writeln(output.bold('MonoVector Optimization Analysis'));
118
- output.writeln(output.dim('='.repeat(60)));
119
- output.writeln();
120
- if (!config.database) {
121
- output.printError('Database name is required. Use --database or -d flag, or set PGDATABASE env.');
122
- return { success: false, exitCode: 1 };
123
- }
124
- // Validate schema identifier to prevent SQL injection
125
- const IDENT_RE = /^[a-zA-Z_][a-zA-Z0-9_]{0,62}$/;
126
- if (!IDENT_RE.test(config.schema)) {
127
- output.printError('Invalid schema name. Only alphanumeric characters and underscores are allowed.');
128
- return { success: false, exitCode: 1 };
129
- }
130
- // Validate --index flag if provided
131
- if (specificIndex !== undefined && !IDENT_RE.test(specificIndex)) {
132
- output.printError('Invalid index name. Only alphanumeric characters and underscores are allowed.');
133
- return { success: false, exitCode: 1 };
134
- }
135
- const spinner = output.createSpinner({ text: 'Connecting to PostgreSQL...', spinner: 'dots' });
136
- spinner.start();
137
- const recommendations = [];
138
- try {
139
- // Import pg
140
- let pg = null;
141
- try {
142
- pg = await import('pg');
143
- }
144
- catch {
145
- spinner.fail('PostgreSQL driver not found');
146
- output.printError('Install pg package: npm install pg');
147
- return { success: false, exitCode: 1 };
148
- }
149
- const client = new pg.Client({
150
- host: config.host,
151
- port: config.port,
152
- database: config.database,
153
- user: config.user,
154
- password: config.password,
155
- ssl: config.ssl ? { rejectUnauthorized: false } : false,
156
- });
157
- await client.connect();
158
- spinner.succeed('Connected to PostgreSQL');
159
- // Check schema exists
160
- const schemaResult = await client.query(`
161
- SELECT schema_name FROM information_schema.schemata WHERE schema_name = $1
162
- `, [config.schema]);
163
- if (schemaResult.rows.length === 0) {
164
- output.printError(`Schema "${config.schema}" not found`);
165
- await client.end();
166
- return { success: false, exitCode: 1 };
167
- }
168
- // Run VACUUM if requested
169
- if (runVacuum) {
170
- spinner.setText('Running VACUUM ANALYZE...');
171
- spinner.start();
172
- const tables = await client.query(`
173
- SELECT table_name FROM information_schema.tables
174
- WHERE table_schema = $1 AND table_type = 'BASE TABLE'
175
- `, [config.schema]);
176
- for (const row of tables.rows) {
177
- await client.query(`VACUUM ANALYZE ${config.schema}.${row.table_name}`);
178
- }
179
- spinner.succeed('VACUUM ANALYZE completed');
180
- }
181
- // Rebuild indexes if requested
182
- if (runReindex) {
183
- spinner.setText('Rebuilding indexes...');
184
- spinner.start();
185
- if (specificIndex) {
186
- await client.query(`REINDEX INDEX ${config.schema}.${specificIndex}`);
187
- spinner.succeed(`Index ${specificIndex} rebuilt`);
188
- }
189
- else {
190
- await client.query(`REINDEX SCHEMA ${config.schema}`);
191
- spinner.succeed('All indexes rebuilt');
192
- }
193
- }
194
- // Analyze table statistics
195
- spinner.setText('Analyzing table statistics...');
196
- spinner.start();
197
- const tableStatsResult = await client.query(`
198
- SELECT
199
- relname as table_name,
200
- n_live_tup as live_rows,
201
- n_dead_tup as dead_rows,
202
- last_vacuum,
203
- last_autovacuum,
204
- last_analyze,
205
- last_autoanalyze
206
- FROM pg_stat_user_tables
207
- WHERE schemaname = $1
208
- `, [config.schema]);
209
- for (const row of tableStatsResult.rows) {
210
- const deadRatio = row.live_rows > 0 ? row.dead_rows / row.live_rows : 0;
211
- // Check for high dead tuple ratio
212
- if (deadRatio > 0.1) {
213
- recommendations.push({
214
- category: 'Table Bloat',
215
- priority: deadRatio > 0.3 ? 'critical' : 'high',
216
- issue: `Table "${row.table_name}" has ${(deadRatio * 100).toFixed(1)}% dead tuples`,
217
- recommendation: 'Run VACUUM to reclaim space',
218
- sql: `VACUUM ANALYZE ${config.schema}.${row.table_name}`,
219
- impact: 'Reduces storage and improves query performance',
220
- });
221
- }
222
- // Check for missing statistics
223
- if (!row.last_analyze && !row.last_autoanalyze) {
224
- recommendations.push({
225
- category: 'Statistics',
226
- priority: 'medium',
227
- issue: `Table "${row.table_name}" has never been analyzed`,
228
- recommendation: 'Run ANALYZE to collect statistics',
229
- sql: `ANALYZE ${config.schema}.${row.table_name}`,
230
- impact: 'Improves query planner decisions',
231
- });
232
- }
233
- }
234
- spinner.succeed('Table statistics analyzed');
235
- // Analyze indexes
236
- spinner.setText('Analyzing index health...');
237
- spinner.start();
238
- const indexStatsResult = await client.query(`
239
- SELECT
240
- i.relname as index_name,
241
- t.relname as table_name,
242
- am.amname as index_type,
243
- pg_relation_size(i.oid) as index_size,
244
- idx.indisvalid as is_valid,
245
- idx.indisready as is_ready,
246
- idx.indislive as is_live,
247
- pg_stat_user_indexes.idx_scan as scans,
248
- pg_stat_user_indexes.idx_tup_read as tuples_read,
249
- pg_stat_user_indexes.idx_tup_fetch as tuples_fetched
250
- FROM pg_index idx
251
- JOIN pg_class i ON i.oid = idx.indexrelid
252
- JOIN pg_class t ON t.oid = idx.indrelid
253
- JOIN pg_namespace n ON n.oid = t.relnamespace
254
- JOIN pg_am am ON am.oid = i.relam
255
- LEFT JOIN pg_stat_user_indexes ON pg_stat_user_indexes.indexrelid = i.oid
256
- WHERE n.nspname = $1
257
- `, [config.schema]);
258
- for (const row of indexStatsResult.rows) {
259
- // Check for invalid indexes
260
- if (!row.is_valid) {
261
- recommendations.push({
262
- category: 'Index Health',
263
- priority: 'critical',
264
- issue: `Index "${row.index_name}" is invalid`,
265
- recommendation: 'Rebuild the index',
266
- sql: `REINDEX INDEX ${config.schema}.${row.index_name}`,
267
- impact: 'Index is not being used for queries',
268
- });
269
- }
270
- // Check for unused indexes (skip vector indexes as they may be new)
271
- if (row.scans === 0 && row.index_type !== 'hnsw' && row.index_type !== 'ivfflat') {
272
- const sizeKB = parseInt(row.index_size, 10) / 1024;
273
- if (sizeKB > 100) {
274
- recommendations.push({
275
- category: 'Unused Index',
276
- priority: 'low',
277
- issue: `Index "${row.index_name}" has never been used (${(sizeKB / 1024).toFixed(2)} MB)`,
278
- recommendation: 'Consider dropping if not needed',
279
- sql: `-- DROP INDEX IF EXISTS ${config.schema}.${row.index_name}`,
280
- impact: 'Reduces storage and write overhead',
281
- });
282
- }
283
- }
284
- }
285
- spinner.succeed('Index health analyzed');
286
- // Analyze vector index parameters
287
- spinner.setText('Analyzing vector index configuration...');
288
- spinner.start();
289
- const vectorIndexes = indexStatsResult.rows.filter(r => r.index_type === 'hnsw' || r.index_type === 'ivfflat');
290
- for (const idx of vectorIndexes) {
291
- // Get index options
292
- const optionsResult = await client.query(`
293
- SELECT reloptions FROM pg_class
294
- WHERE relname = $1 AND relnamespace = (
295
- SELECT oid FROM pg_namespace WHERE nspname = $2
296
- )
297
- `, [idx.index_name, config.schema]);
298
- const options = optionsResult.rows[0]?.reloptions || [];
299
- if (idx.index_type === 'hnsw') {
300
- // Check HNSW parameters
301
- const m = options.find((o) => o.startsWith('m='));
302
- const efConstruction = options.find((o) => o.startsWith('ef_construction='));
303
- const mValue = m ? parseInt(m.split('=')[1], 10) : 16;
304
- const efValue = efConstruction ? parseInt(efConstruction.split('=')[1], 10) : 64;
305
- // Get table row count
306
- const countResult = await client.query(`
307
- SELECT count(*) as cnt FROM ${config.schema}.${idx.table_name}
308
- `);
309
- const rowCount = parseInt(countResult.rows[0].cnt, 10);
310
- // Recommend higher ef_construction for large datasets
311
- if (rowCount > 100000 && efValue < 100) {
312
- recommendations.push({
313
- category: 'HNSW Tuning',
314
- priority: 'medium',
315
- issue: `HNSW index "${idx.index_name}" has ef_construction=${efValue} for ${rowCount.toLocaleString()} vectors`,
316
- recommendation: 'Consider rebuilding with higher ef_construction for better recall',
317
- sql: `-- Rebuild with: CREATE INDEX ... WITH (m = ${mValue}, ef_construction = 128)`,
318
- impact: 'Improves recall at slight build time cost',
319
- });
320
- }
321
- // Recommend higher m for very large datasets
322
- if (rowCount > 1000000 && mValue < 24) {
323
- recommendations.push({
324
- category: 'HNSW Tuning',
325
- priority: 'medium',
326
- issue: `HNSW index "${idx.index_name}" has m=${mValue} for ${rowCount.toLocaleString()} vectors`,
327
- recommendation: 'Consider rebuilding with higher m for better connectivity',
328
- sql: `-- Rebuild with: CREATE INDEX ... WITH (m = 24, ef_construction = ${efValue})`,
329
- impact: 'Improves recall and query performance',
330
- });
331
- }
332
- }
333
- if (idx.index_type === 'ivfflat') {
334
- // Check IVFFlat lists parameter
335
- const lists = options.find((o) => o.startsWith('lists='));
336
- const listsValue = lists ? parseInt(lists.split('=')[1], 10) : 100;
337
- // Get table row count
338
- const countResult = await client.query(`
339
- SELECT count(*) as cnt FROM ${config.schema}.${idx.table_name}
340
- `);
341
- const rowCount = parseInt(countResult.rows[0].cnt, 10);
342
- // Recommended lists = sqrt(n)
343
- const recommendedLists = Math.floor(Math.sqrt(rowCount));
344
- if (Math.abs(listsValue - recommendedLists) / recommendedLists > 0.5) {
345
- recommendations.push({
346
- category: 'IVFFlat Tuning',
347
- priority: 'medium',
348
- issue: `IVFFlat index "${idx.index_name}" has lists=${listsValue} (recommended: ~${recommendedLists})`,
349
- recommendation: 'Consider rebuilding with optimal lists parameter',
350
- sql: `-- Rebuild with: CREATE INDEX ... WITH (lists = ${recommendedLists})`,
351
- impact: 'Balances query speed and recall',
352
- });
353
- }
354
- }
355
- }
356
- spinner.succeed('Vector index configuration analyzed');
357
- // Check memory settings
358
- spinner.setText('Checking PostgreSQL settings...');
359
- spinner.start();
360
- const settingsResult = await client.query(`
361
- SELECT name, setting, unit, context
362
- FROM pg_settings
363
- WHERE name IN (
364
- 'shared_buffers', 'effective_cache_size', 'work_mem',
365
- 'maintenance_work_mem', 'max_parallel_workers_per_gather'
366
- )
367
- `);
368
- const settings = {};
369
- for (const row of settingsResult.rows) {
370
- settings[row.name] = row.setting + (row.unit || '');
371
- }
372
- // Check work_mem for vector operations
373
- const workMemMB = parseInt(settings.work_mem || '4096', 10) / 1024;
374
- if (workMemMB < 64) {
375
- recommendations.push({
376
- category: 'Memory Settings',
377
- priority: 'medium',
378
- issue: `work_mem is ${workMemMB.toFixed(0)}MB (recommended: 64MB+ for vector ops)`,
379
- recommendation: 'Increase work_mem for better vector search performance',
380
- sql: `SET work_mem = '64MB'`,
381
- impact: 'Improves sorting and index build performance',
382
- });
383
- }
384
- // Check maintenance_work_mem for index building
385
- const maintMemMB = parseInt(settings.maintenance_work_mem || '65536', 10) / 1024;
386
- if (maintMemMB < 256) {
387
- recommendations.push({
388
- category: 'Memory Settings',
389
- priority: 'low',
390
- issue: `maintenance_work_mem is ${maintMemMB.toFixed(0)}MB`,
391
- recommendation: 'Increase for faster index builds',
392
- sql: `SET maintenance_work_mem = '256MB'`,
393
- impact: 'Faster VACUUM and index creation',
394
- });
395
- }
396
- spinner.succeed('PostgreSQL settings checked');
397
- await client.end();
398
- // Display recommendations
399
- output.writeln();
400
- if (recommendations.length === 0) {
401
- output.printSuccess('No optimization recommendations - your setup looks good!');
402
- output.writeln();
403
- output.printBox([
404
- 'All tables have been analyzed',
405
- 'Indexes are valid and properly configured',
406
- 'Memory settings are adequate',
407
- '',
408
- 'Tips for maintaining performance:',
409
- ' - Run VACUUM ANALYZE regularly',
410
- ' - Monitor dead tuple ratio',
411
- ' - Rebuild indexes after large batch inserts',
412
- ].join('\n'), 'Status: Optimal');
413
- return { success: true, data: { recommendations: [] } };
414
- }
415
- // Group by priority
416
- const critical = recommendations.filter(r => r.priority === 'critical');
417
- const high = recommendations.filter(r => r.priority === 'high');
418
- const medium = recommendations.filter(r => r.priority === 'medium');
419
- const low = recommendations.filter(r => r.priority === 'low');
420
- output.writeln(output.bold(`Found ${recommendations.length} optimization recommendations:`));
421
- output.writeln();
422
- // Display by priority
423
- const displayRecommendations = (recs, label, color) => {
424
- if (recs.length === 0)
425
- return;
426
- output.writeln(color(`${label} Priority (${recs.length}):`));
427
- output.writeln();
428
- for (const rec of recs) {
429
- output.writeln(` ${output.bold(rec.category)}: ${rec.issue}`);
430
- output.writeln(` ${output.dim('Recommendation:')} ${rec.recommendation}`);
431
- output.writeln(` ${output.dim('Impact:')} ${rec.impact}`);
432
- if (rec.sql) {
433
- output.writeln(` ${output.dim('SQL:')} ${output.highlight(rec.sql)}`);
434
- }
435
- output.writeln();
436
- }
437
- };
438
- displayRecommendations(critical, 'CRITICAL', output.error.bind(output));
439
- displayRecommendations(high, 'HIGH', output.warning.bind(output));
440
- displayRecommendations(medium, 'MEDIUM', output.highlight.bind(output));
441
- displayRecommendations(low, 'LOW', output.dim.bind(output));
442
- // Apply optimizations if requested
443
- if (applyOptimizations && (critical.length > 0 || high.length > 0)) {
444
- output.writeln(output.dim('-'.repeat(60)));
445
- output.writeln();
446
- if (ctx.interactive) {
447
- const confirmApply = await confirm({
448
- message: `Apply ${critical.length + high.length} critical/high priority optimizations?`,
449
- default: false,
450
- });
451
- if (confirmApply) {
452
- const applyClient = new pg.Client({
453
- host: config.host,
454
- port: config.port,
455
- database: config.database,
456
- user: config.user,
457
- password: config.password,
458
- ssl: config.ssl ? { rejectUnauthorized: false } : false,
459
- });
460
- await applyClient.connect();
461
- for (const rec of [...critical, ...high]) {
462
- if (rec.sql && !rec.sql.startsWith('--')) {
463
- spinner.setText(`Applying: ${rec.issue}...`);
464
- spinner.start();
465
- try {
466
- await applyClient.query(rec.sql);
467
- spinner.succeed(`Applied: ${rec.category}`);
468
- }
469
- catch (error) {
470
- spinner.fail(`Failed: ${rec.category}`);
471
- output.printError(error instanceof Error ? error.message : String(error));
472
- }
473
- }
474
- }
475
- await applyClient.end();
476
- output.writeln();
477
- output.printSuccess('Optimizations applied');
478
- }
479
- }
480
- }
481
- // Summary
482
- output.printBox([
483
- `Total Recommendations: ${recommendations.length}`,
484
- ` Critical: ${critical.length}`,
485
- ` High: ${high.length}`,
486
- ` Medium: ${medium.length}`,
487
- ` Low: ${low.length}`,
488
- '',
489
- 'Quick commands:',
490
- ` monomind monovector optimize --vacuum # Clean up tables`,
491
- ` monomind monovector optimize --reindex # Rebuild indexes`,
492
- ` monomind monovector optimize --apply # Apply critical fixes`,
493
- ].join('\n'), 'Optimization Summary');
494
- return {
495
- success: true,
496
- data: {
497
- recommendations,
498
- summary: {
499
- critical: critical.length,
500
- high: high.length,
501
- medium: medium.length,
502
- low: low.length,
503
- },
504
- },
505
- };
506
- }
507
- catch (error) {
508
- spinner.fail('Optimization analysis failed');
509
- output.printError(error instanceof Error ? error.message : String(error));
510
- return { success: false, exitCode: 1 };
511
- }
512
- },
513
- };
514
- export default optimizeCommand;
515
- //# sourceMappingURL=optimize.js.map
@@ -1,18 +0,0 @@
1
- /**
2
- * CLI MonoVector Setup Command
3
- * Outputs Docker files and SQL for easy MonoVector PostgreSQL setup
4
- *
5
- * Usage:
6
- * npx monomind monovector setup # Output to ./monovector-postgres/
7
- * npx monomind monovector setup --output /path/to/dir
8
- * npx monomind monovector setup --print # Print to stdout only
9
- *
10
- * https://github.com/monoes/monomind
11
- */
12
- import type { Command } from '../../types.js';
13
- /**
14
- * MonoVector Setup command - outputs Docker files and SQL
15
- */
16
- export declare const setupCommand: Command;
17
- export default setupCommand;
18
- //# sourceMappingURL=setup.d.ts.map