@mediaproc/cli 0.5.2 → 0.7.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.
Files changed (78) hide show
  1. package/README.md +202 -1297
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +21 -12
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/add.d.ts.map +1 -1
  6. package/dist/commands/add.js +1 -0
  7. package/dist/commands/add.js.map +1 -1
  8. package/dist/commands/batch.d.ts +3 -0
  9. package/dist/commands/batch.d.ts.map +1 -0
  10. package/dist/commands/batch.js +269 -0
  11. package/dist/commands/batch.js.map +1 -0
  12. package/dist/commands/benchmark.d.ts +3 -0
  13. package/dist/commands/benchmark.d.ts.map +1 -0
  14. package/dist/commands/benchmark.js +124 -0
  15. package/dist/commands/benchmark.js.map +1 -0
  16. package/dist/commands/compare.d.ts +3 -0
  17. package/dist/commands/compare.d.ts.map +1 -0
  18. package/dist/commands/compare.js +102 -0
  19. package/dist/commands/compare.js.map +1 -0
  20. package/dist/commands/detect.d.ts +6 -0
  21. package/dist/commands/detect.d.ts.map +1 -0
  22. package/dist/commands/detect.js +90 -0
  23. package/dist/commands/detect.js.map +1 -0
  24. package/dist/commands/doctor.d.ts +3 -0
  25. package/dist/commands/doctor.d.ts.map +1 -0
  26. package/dist/commands/doctor.js +222 -0
  27. package/dist/commands/doctor.js.map +1 -0
  28. package/dist/commands/history.d.ts +15 -0
  29. package/dist/commands/history.d.ts.map +1 -0
  30. package/dist/commands/history.js +215 -0
  31. package/dist/commands/history.js.map +1 -0
  32. package/dist/commands/remove.js +1 -1
  33. package/dist/commands/remove.js.map +1 -1
  34. package/dist/commands/search.d.ts +3 -0
  35. package/dist/commands/search.d.ts.map +1 -0
  36. package/dist/commands/search.js +193 -0
  37. package/dist/commands/search.js.map +1 -0
  38. package/dist/commands/stats.d.ts +3 -0
  39. package/dist/commands/stats.d.ts.map +1 -0
  40. package/dist/commands/stats.js +155 -0
  41. package/dist/commands/stats.js.map +1 -0
  42. package/dist/commands/template.d.ts +3 -0
  43. package/dist/commands/template.d.ts.map +1 -0
  44. package/dist/commands/template.js +184 -0
  45. package/dist/commands/template.js.map +1 -0
  46. package/dist/commands/watch.d.ts +3 -0
  47. package/dist/commands/watch.d.ts.map +1 -0
  48. package/dist/commands/watch.js +106 -0
  49. package/dist/commands/watch.js.map +1 -0
  50. package/dist/commands/workspace.d.ts +3 -0
  51. package/dist/commands/workspace.d.ts.map +1 -0
  52. package/dist/commands/workspace.js +201 -0
  53. package/dist/commands/workspace.js.map +1 -0
  54. package/dist/utils/branding.d.ts +11 -0
  55. package/dist/utils/branding.d.ts.map +1 -0
  56. package/dist/utils/branding.js +59 -0
  57. package/dist/utils/branding.js.map +1 -0
  58. package/package.json +2 -2
  59. package/dist/commands/convert.d.ts +0 -7
  60. package/dist/commands/convert.d.ts.map +0 -1
  61. package/dist/commands/convert.js +0 -96
  62. package/dist/commands/convert.js.map +0 -1
  63. package/dist/commands/info.d.ts +0 -7
  64. package/dist/commands/info.d.ts.map +0 -1
  65. package/dist/commands/info.js +0 -117
  66. package/dist/commands/info.js.map +0 -1
  67. package/dist/commands/optimize.d.ts +0 -7
  68. package/dist/commands/optimize.d.ts.map +0 -1
  69. package/dist/commands/optimize.js +0 -196
  70. package/dist/commands/optimize.js.map +0 -1
  71. package/dist/commands/run.d.ts +0 -3
  72. package/dist/commands/run.d.ts.map +0 -1
  73. package/dist/commands/run.js +0 -16
  74. package/dist/commands/run.js.map +0 -1
  75. package/dist/commands/validate.d.ts +0 -3
  76. package/dist/commands/validate.d.ts.map +0 -1
  77. package/dist/commands/validate.js +0 -16
  78. package/dist/commands/validate.js.map +0 -1
@@ -0,0 +1,102 @@
1
+ import { Command } from 'commander';
2
+ import * as fs from 'fs';
3
+ import * as path from 'path';
4
+ export const compareCommand = new Command()
5
+ .name('compare')
6
+ .description('Compare two files or before/after processing')
7
+ .argument('<file1>', 'First file path')
8
+ .argument('<file2>', 'Second file path')
9
+ .option('--preview', 'Show visual preview (images/videos)')
10
+ .option('--detailed', 'Show detailed comparison')
11
+ .option('--json', 'Output as JSON')
12
+ .action(async (file1, file2, options) => {
13
+ if (!fs.existsSync(file1)) {
14
+ console.log(`\n❌ File not found: ${file1}\n`);
15
+ return;
16
+ }
17
+ if (!fs.existsSync(file2)) {
18
+ console.log(`\n❌ File not found: ${file2}\n`);
19
+ return;
20
+ }
21
+ const comparison = await compareFiles(file1, file2, options.detailed);
22
+ if (options.json) {
23
+ console.log(JSON.stringify(comparison, null, 2));
24
+ return;
25
+ }
26
+ displayComparison(comparison, options.detailed);
27
+ if (options.preview) {
28
+ console.log('\n⚠️ Visual preview requires full implementation\n');
29
+ }
30
+ });
31
+ async function compareFiles(file1, file2, detailed) {
32
+ const stats1 = fs.statSync(file1);
33
+ const stats2 = fs.statSync(file2);
34
+ const sizeDiff = stats2.size - stats1.size;
35
+ const sizeReduction = ((1 - (stats2.size / stats1.size)) * 100);
36
+ const comparison = {
37
+ file1: path.basename(file1),
38
+ file2: path.basename(file2),
39
+ size1: stats1.size,
40
+ size2: stats2.size,
41
+ sizeDiff,
42
+ sizeReduction
43
+ };
44
+ // For images, we could extract dimensions using sharp
45
+ // This would require adding sharp as a dependency
46
+ if (detailed && isImageFile(file1)) {
47
+ // comparison.dimensions1 = await getImageDimensions(file1);
48
+ // comparison.dimensions2 = await getImageDimensions(file2);
49
+ }
50
+ return comparison;
51
+ }
52
+ function displayComparison(comparison, detailed) {
53
+ console.log('\n📊 File Comparison\n');
54
+ console.log('━'.repeat(60));
55
+ console.log('\n📁 Files:');
56
+ console.log(` Original: ${comparison.file1}`);
57
+ console.log(` Processed: ${comparison.file2}`);
58
+ console.log('\n📏 Size:');
59
+ console.log(` Original: ${formatBytes(comparison.size1)}`);
60
+ console.log(` Processed: ${formatBytes(comparison.size2)}`);
61
+ if (comparison.sizeDiff < 0) {
62
+ const saved = Math.abs(comparison.sizeDiff);
63
+ console.log(` \x1b[32m✓ Saved: ${formatBytes(saved)} (${comparison.sizeReduction.toFixed(1)}% reduction)\x1b[0m`);
64
+ }
65
+ else if (comparison.sizeDiff > 0) {
66
+ console.log(` \x1b[33m⚠ Increase: ${formatBytes(comparison.sizeDiff)} (${Math.abs(comparison.sizeReduction).toFixed(1)}% larger)\x1b[0m`);
67
+ }
68
+ else {
69
+ console.log(` = Same size`);
70
+ }
71
+ if (comparison.dimensions1 && comparison.dimensions2) {
72
+ console.log('\n📐 Dimensions:');
73
+ console.log(` Original: ${comparison.dimensions1.width}x${comparison.dimensions1.height}`);
74
+ console.log(` Processed: ${comparison.dimensions2.width}x${comparison.dimensions2.height}`);
75
+ }
76
+ if (detailed) {
77
+ console.log('\n📋 Additional Info:');
78
+ console.log(` Original path: ${comparison.file1}`);
79
+ console.log(` Processed path: ${comparison.file2}`);
80
+ }
81
+ console.log('\n' + '━'.repeat(60));
82
+ if (comparison.sizeReduction > 0) {
83
+ console.log('\n✅ Processing resulted in smaller file size\n');
84
+ }
85
+ else if (comparison.sizeReduction < 0) {
86
+ console.log('\n⚠️ Processing resulted in larger file size\n');
87
+ }
88
+ }
89
+ function isImageFile(file) {
90
+ const imageExts = ['.jpg', '.jpeg', '.png', '.webp', '.gif', '.bmp', '.tiff', '.avif'];
91
+ return imageExts.includes(path.extname(file).toLowerCase());
92
+ }
93
+ function formatBytes(bytes) {
94
+ if (bytes < 1024)
95
+ return `${bytes}B`;
96
+ if (bytes < 1024 * 1024)
97
+ return `${(bytes / 1024).toFixed(1)}KB`;
98
+ if (bytes < 1024 * 1024 * 1024)
99
+ return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
100
+ return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)}GB`;
101
+ }
102
+ //# sourceMappingURL=compare.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compare.js","sourceRoot":"","sources":["../../src/commands/compare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,O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AAO,GAAG,CAAC,KAAK,GAAG,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * Detect media file type and suggest appropriate plugin
4
+ */
5
+ export declare function detectCommand(program: Command): void;
6
+ //# sourceMappingURL=detect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/commands/detect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6FpD"}
@@ -0,0 +1,90 @@
1
+ import chalk from 'chalk';
2
+ import { existsSync } from 'fs';
3
+ import { extname } from 'path';
4
+ /**
5
+ * Detect media file type and suggest appropriate plugin
6
+ */
7
+ export function detectCommand(program) {
8
+ program
9
+ .command('detect <file>')
10
+ .description('Detect media file type and suggest appropriate plugin')
11
+ .option('-v, --verbose', 'Show detailed file information')
12
+ .action((file, options) => {
13
+ if (!existsSync(file)) {
14
+ console.error(chalk.red(`✗ File not found: ${file}`));
15
+ process.exit(1);
16
+ }
17
+ const ext = extname(file).toLowerCase().slice(1);
18
+ // Media type mappings
19
+ const mediaTypes = {
20
+ // Images
21
+ jpg: { type: 'Image', plugin: 'image', color: 'cyan' },
22
+ jpeg: { type: 'Image', plugin: 'image', color: 'cyan' },
23
+ png: { type: 'Image', plugin: 'image', color: 'cyan' },
24
+ webp: { type: 'Image', plugin: 'image', color: 'cyan' },
25
+ gif: { type: 'Image', plugin: 'image', color: 'cyan' },
26
+ bmp: { type: 'Image', plugin: 'image', color: 'cyan' },
27
+ tiff: { type: 'Image', plugin: 'image', color: 'cyan' },
28
+ avif: { type: 'Image', plugin: 'image', color: 'cyan' },
29
+ svg: { type: 'Image', plugin: 'image', color: 'cyan' },
30
+ // Videos
31
+ mp4: { type: 'Video', plugin: 'video', color: 'magenta' },
32
+ webm: { type: 'Video', plugin: 'video', color: 'magenta' },
33
+ mkv: { type: 'Video', plugin: 'video', color: 'magenta' },
34
+ avi: { type: 'Video', plugin: 'video', color: 'magenta' },
35
+ mov: { type: 'Video', plugin: 'video', color: 'magenta' },
36
+ flv: { type: 'Video', plugin: 'video', color: 'magenta' },
37
+ wmv: { type: 'Video', plugin: 'video', color: 'magenta' },
38
+ m4v: { type: 'Video', plugin: 'video', color: 'magenta' },
39
+ // Audio
40
+ mp3: { type: 'Audio', plugin: 'audio', color: 'green' },
41
+ wav: { type: 'Audio', plugin: 'audio', color: 'green' },
42
+ ogg: { type: 'Audio', plugin: 'audio', color: 'green' },
43
+ flac: { type: 'Audio', plugin: 'audio', color: 'green' },
44
+ aac: { type: 'Audio', plugin: 'audio', color: 'green' },
45
+ m4a: { type: 'Audio', plugin: 'audio', color: 'green' },
46
+ opus: { type: 'Audio', plugin: 'audio', color: 'green' },
47
+ // Documents
48
+ pdf: { type: 'Document', plugin: 'document', color: 'yellow' },
49
+ docx: { type: 'Document', plugin: 'document', color: 'yellow' },
50
+ pptx: { type: 'Document', plugin: 'document', color: 'yellow' },
51
+ txt: { type: 'Document', plugin: 'document', color: 'yellow' },
52
+ md: { type: 'Document', plugin: 'document', color: 'yellow' },
53
+ };
54
+ const detected = mediaTypes[ext];
55
+ if (!detected) {
56
+ console.log(chalk.yellow(`⚠ Unknown file type: ${ext}`));
57
+ console.log(chalk.dim('\\nNo plugin suggestions available.'));
58
+ return;
59
+ }
60
+ const colorFn = chalk[detected.color];
61
+ console.log(chalk.bold('\\n📁 File Detection Result:\\n'));
62
+ console.log(`File: ${chalk.cyan(file)}`);
63
+ console.log(`Type: ${colorFn(detected.type)}`);
64
+ console.log(`Extension: ${chalk.dim(ext)}`);
65
+ console.log(chalk.bold('\\n💡 Suggested Plugin:\\n'));
66
+ console.log(`Plugin: ${chalk.green(`@mediaproc/${detected.plugin}`)}`);
67
+ console.log(`Install: ${chalk.dim(`mediaproc add ${detected.plugin}`)}`);
68
+ console.log(chalk.bold('\\n🚀 Quick Commands:\\n'));
69
+ console.log(chalk.dim(`# View available commands for this file type:`));
70
+ console.log(chalk.cyan(`mediaproc ${detected.plugin} --help`));
71
+ if (options.verbose) {
72
+ console.log(chalk.bold('\\n📊 Available Operations:\\n'));
73
+ if (detected.type === 'Image') {
74
+ console.log(chalk.dim('• resize, convert, compress, optimize, crop, rotate'));
75
+ console.log(chalk.dim('• blur, sharpen, grayscale, watermark, thumbnail'));
76
+ }
77
+ else if (detected.type === 'Video') {
78
+ console.log(chalk.dim('• compress, transcode, trim, resize, merge, extract'));
79
+ }
80
+ else if (detected.type === 'Audio') {
81
+ console.log(chalk.dim('• convert, normalize, merge, extract, trim'));
82
+ }
83
+ else if (detected.type === 'Document') {
84
+ console.log(chalk.dim('• convert, compress, merge, extract'));
85
+ }
86
+ }
87
+ console.log('');
88
+ });
89
+ }
90
+ //# sourceMappingURL=detect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.js","sourceRoot":"","sources":["../../src/commands/detect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC1C,OAAO;SACF,OAAO,CAAC,eAAe,CAAC;SACxB,WAAW,CAAC,uDAAuD,CAAC;SACpE,MAAM,CAAC,eAAe,EAAE,gCAAgC,CAAC;SACzD,MAAM,CAAC,CAAC,IAAY,EAAE,OAA8B,EAAE,EAAE;QACrD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC,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CAAC;gBACnC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC,CAAC;YACzE,CAAC;iBAAM,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;gBACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC,CAAC;YAClE,CAAC;QACL,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const doctorCommand: Command;
3
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,eAAO,MAAM,aAAa,SA4EtB,CAAC"}
@@ -0,0 +1,222 @@
1
+ import { Command } from 'commander';
2
+ import { exec } from 'child_process';
3
+ import { promisify } from 'util';
4
+ import * as fs from 'fs';
5
+ import * as path from 'path';
6
+ import { showBranding } from '../utils/branding';
7
+ const execAsync = promisify(exec);
8
+ export const doctorCommand = new Command()
9
+ .name('doctor')
10
+ .description('Run system diagnostics and health checks')
11
+ .option('--verbose', 'Show detailed diagnostic information')
12
+ .option('--fix', 'Attempt to fix issues automatically')
13
+ .action(async (options) => {
14
+ console.log('\n🔍 MediaProc System Diagnostics\n');
15
+ console.log('━'.repeat(50));
16
+ const results = [];
17
+ // Check Node.js version
18
+ results.push(await checkNodeVersion());
19
+ // Check FFmpeg
20
+ results.push(await checkFFmpeg());
21
+ // Check Sharp/libvips
22
+ results.push(await checkSharp());
23
+ // Check installed plugins
24
+ results.push(await checkPlugins());
25
+ // Check system resources
26
+ results.push(await checkSystemResources());
27
+ // Check for conflicts
28
+ results.push(await checkConflicts());
29
+ // Display results
30
+ console.log('\n📊 Diagnostic Results:\n');
31
+ let passCount = 0;
32
+ let warnCount = 0;
33
+ let failCount = 0;
34
+ results.forEach((result) => {
35
+ const icon = result.status === 'pass' ? '✓' : result.status === 'warn' ? '⚠' : '✗';
36
+ const color = result.status === 'pass' ? '\x1b[32m' : result.status === 'warn' ? '\x1b[33m' : '\x1b[31m';
37
+ console.log(`${color}${icon} ${result.name}\x1b[0m`);
38
+ console.log(` ${result.message}`);
39
+ if (result.suggestion) {
40
+ console.log(` 💡 ${result.suggestion}`);
41
+ }
42
+ console.log('');
43
+ if (result.status === 'pass')
44
+ passCount++;
45
+ else if (result.status === 'warn')
46
+ warnCount++;
47
+ else
48
+ failCount++;
49
+ });
50
+ // Summary
51
+ console.log('━'.repeat(50));
52
+ console.log(`\n📈 Summary: ${passCount} passed, ${warnCount} warnings, ${failCount} failed\n`);
53
+ if (failCount > 0) {
54
+ console.log('❌ Some critical issues found. Please resolve them before using MediaProc.');
55
+ showBranding();
56
+ process.exit(1);
57
+ }
58
+ else if (warnCount > 0) {
59
+ console.log('⚠️ Some warnings found. MediaProc should work, but consider fixing warnings.');
60
+ }
61
+ else {
62
+ console.log('✅ All checks passed! MediaProc is ready to use.');
63
+ }
64
+ if (options.verbose) {
65
+ console.log('\n📝 Detailed Information:');
66
+ console.log(` Node.js: ${process.version}`);
67
+ console.log(` Platform: ${process.platform}`);
68
+ console.log(` Architecture: ${process.arch}`);
69
+ console.log(` Memory: ${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)}MB used`);
70
+ }
71
+ showBranding();
72
+ });
73
+ async function checkNodeVersion() {
74
+ const version = process.version;
75
+ const major = parseInt(version.slice(1).split('.')[0]);
76
+ if (major >= 18) {
77
+ return {
78
+ name: 'Node.js Version',
79
+ status: 'pass',
80
+ message: `${version} (compatible)`
81
+ };
82
+ }
83
+ else if (major >= 16) {
84
+ return {
85
+ name: 'Node.js Version',
86
+ status: 'warn',
87
+ message: `${version} (works but upgrade recommended)`,
88
+ suggestion: 'Upgrade to Node.js 18+ for best performance'
89
+ };
90
+ }
91
+ else {
92
+ return {
93
+ name: 'Node.js Version',
94
+ status: 'fail',
95
+ message: `${version} (incompatible)`,
96
+ suggestion: 'Please upgrade to Node.js 18 or higher'
97
+ };
98
+ }
99
+ }
100
+ async function checkFFmpeg() {
101
+ try {
102
+ const { stdout } = await execAsync('ffmpeg -version');
103
+ const version = stdout.split('\n')[0].match(/ffmpeg version (\S+)/)?.[1] || 'unknown';
104
+ return {
105
+ name: 'FFmpeg',
106
+ status: 'pass',
107
+ message: `Version ${version} installed`
108
+ };
109
+ }
110
+ catch (error) {
111
+ return {
112
+ name: 'FFmpeg',
113
+ status: 'fail',
114
+ message: 'Not installed',
115
+ suggestion: 'Install FFmpeg: brew install ffmpeg (macOS) or apt install ffmpeg (Linux)'
116
+ };
117
+ }
118
+ }
119
+ async function checkSharp() {
120
+ try {
121
+ require('sharp');
122
+ return {
123
+ name: 'Sharp (Image Processing)',
124
+ status: 'pass',
125
+ message: 'Installed and working'
126
+ };
127
+ }
128
+ catch (error) {
129
+ return {
130
+ name: 'Sharp (Image Processing)',
131
+ status: 'warn',
132
+ message: 'Not found',
133
+ suggestion: 'Install with: npm install -g sharp (optional but recommended for image processing)'
134
+ };
135
+ }
136
+ }
137
+ async function checkPlugins() {
138
+ try {
139
+ const packageJsonPath = path.join(process.cwd(), 'package.json');
140
+ if (!fs.existsSync(packageJsonPath)) {
141
+ return {
142
+ name: 'Installed Plugins',
143
+ status: 'warn',
144
+ message: 'No package.json found',
145
+ suggestion: 'Run commands from a project directory or install plugins globally'
146
+ };
147
+ }
148
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
149
+ const deps = { ...packageJson.dependencies, ...packageJson.devDependencies };
150
+ const mediaprocPlugins = Object.keys(deps).filter(dep => dep.startsWith('@mediaproc/'));
151
+ if (mediaprocPlugins.length === 0) {
152
+ return {
153
+ name: 'Installed Plugins',
154
+ status: 'warn',
155
+ message: 'No plugins found',
156
+ suggestion: 'Install plugins with: mediaproc add <plugin-name>'
157
+ };
158
+ }
159
+ return {
160
+ name: 'Installed Plugins',
161
+ status: 'pass',
162
+ message: `${mediaprocPlugins.length} plugin(s) installed: ${mediaprocPlugins.map(p => p.replace('@mediaproc/', '')).join(', ')}`
163
+ };
164
+ }
165
+ catch (error) {
166
+ return {
167
+ name: 'Installed Plugins',
168
+ status: 'warn',
169
+ message: 'Could not check plugins',
170
+ suggestion: 'Ensure you have proper permissions'
171
+ };
172
+ }
173
+ }
174
+ async function checkSystemResources() {
175
+ const totalMem = require('os').totalmem();
176
+ const freeMem = require('os').freemem();
177
+ const cpus = require('os').cpus().length;
178
+ const totalGB = (totalMem / 1024 / 1024 / 1024).toFixed(1);
179
+ const freeGB = (freeMem / 1024 / 1024 / 1024).toFixed(1);
180
+ if (freeMem < 1024 * 1024 * 1024) { // Less than 1GB free
181
+ return {
182
+ name: 'System Resources',
183
+ status: 'warn',
184
+ message: `${cpus} CPU cores, ${freeGB}GB/${totalGB}GB RAM available`,
185
+ suggestion: 'Low memory. Consider closing other applications for better performance'
186
+ };
187
+ }
188
+ return {
189
+ name: 'System Resources',
190
+ status: 'pass',
191
+ message: `${cpus} CPU cores, ${freeGB}GB/${totalGB}GB RAM available`
192
+ };
193
+ }
194
+ async function checkConflicts() {
195
+ // Check for common conflicts
196
+ const conflicts = [];
197
+ // Check for multiple sharp versions
198
+ try {
199
+ const { stdout } = await execAsync('npm ls sharp 2>/dev/null || true');
200
+ const sharpMatches = stdout.match(/sharp@/g);
201
+ if (sharpMatches && sharpMatches.length > 1) {
202
+ conflicts.push('Multiple Sharp versions detected');
203
+ }
204
+ }
205
+ catch (error) {
206
+ // Ignore errors
207
+ }
208
+ if (conflicts.length > 0) {
209
+ return {
210
+ name: 'Dependency Conflicts',
211
+ status: 'warn',
212
+ message: conflicts.join(', '),
213
+ suggestion: 'Run: npm dedupe to resolve conflicts'
214
+ };
215
+ }
216
+ return {
217
+ name: 'Dependency Conflicts',
218
+ status: 'pass',
219
+ message: 'No conflicts detected'
220
+ };
221
+ }
222
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AASlC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,EAAE;KACvC,IAAI,CAAC,QAAQ,CAAC;KACd,WAAW,CAAC,0CAA0C,CAAC;KACvD,MAAM,CAAC,WAAW,EAAE,sCAAsC,CAAC;KAC3D,MAAM,CAAC,OAAO,EAAE,qCAAqC,CAAC;KACtD,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAE5B,MAAM,OAAO,GAAuB,EAAE,CAAC;IAEvC,wBAAwB;IACxB,OAAO,CAAC,IAAI,CAAC,MAAM,gBAAgB,EAAE,CAAC,CAAC;IAEvC,eAAe;IACf,OAAO,CAAC,IAAI,CAAC,MAAM,WAAW,EAAE,CAAC,CAAC;IAElC,sBAAsB;IACtB,OAAO,CAAC,IAAI,CAAC,MAAM,UAAU,EAAE,CAAC,CAAC;IAEjC,0BAA0B;IAC1B,OAAO,CAAC,IAAI,CAAC,MAAM,YAAY,EAAE,CAAC,CAAC;IAEnC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AG,IAAI,eAAe,MAAM,MAAM,OAAO,kBAAkB;KACrE,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,cAAc;IAC3B,6BAA6B;IAC7B,MAAM,SAAS,GAAa,EAAE,CAAC;IAE/B,oCAAoC;IACpC,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,kCAAkC,CAAC,CAAC;QACvE,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,YAAY,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5C,SAAS,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,gBAAgB;IAClB,CAAC;IAED,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO;YACL,IAAI,EAAE,sBAAsB;YAC5B,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;YAC7B,UAAU,EAAE,sCAAsC;SACnD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,IAAI,EAAE,sBAAsB;QAC5B,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,uBAAuB;KACjC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Command } from 'commander';
2
+ interface HistoryEntry {
3
+ id: number;
4
+ timestamp: number;
5
+ command: string;
6
+ args: string[];
7
+ cwd: string;
8
+ success: boolean;
9
+ duration?: number;
10
+ }
11
+ export declare const historyCommand: Command;
12
+ export declare function getHistory(): HistoryEntry[];
13
+ export declare function saveHistoryEntry(entry: Omit<HistoryEntry, 'id' | 'timestamp'>): void;
14
+ export {};
15
+ //# sourceMappingURL=history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/commands/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAKD,eAAO,MAAM,cAAc,SAqCvB,CAAC;AAqHL,wBAAgB,UAAU,IAAI,YAAY,EAAE,CAE3C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,WAAW,CAAC,GAAG,IAAI,CAoBpF"}