claude-flow-novice 2.2.4 → 2.2.5
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 +9 -8
- package/scripts/.claude-flow/metrics/agent-metrics.json +1 -0
- package/scripts/.claude-flow/metrics/performance.json +9 -0
- package/scripts/.claude-flow/metrics/task-metrics.json +10 -0
- package/scripts/CLEANUP_OPTIMIZATION_REPORT.json +312 -0
- package/scripts/CLEANUP_PERFORMANCE_OPTIMIZATION.md +387 -0
- package/scripts/CLEANUP_QUICK_START.md +268 -0
- package/scripts/CLEANUP_TEST_RESULTS.md +205 -0
- package/scripts/README.md +339 -0
- package/scripts/ace-query.sh +384 -0
- package/scripts/agent-token-analysis.js +430 -0
- package/scripts/auto-setup.js +332 -0
- package/scripts/build/README.md +167 -0
- package/scripts/build/build-config.js +27 -0
- package/scripts/build/build-prompt-copier.sh +30 -0
- package/scripts/build/performance-monitor.js +869 -0
- package/scripts/build/prepare-publish.js +150 -0
- package/scripts/build/typescript-fixer.js +621 -0
- package/scripts/build/unified-builder.sh +428 -0
- package/scripts/build/update-bin-version.js +32 -0
- package/scripts/build/validate-agents.js +238 -0
- package/scripts/build-index.js +43 -0
- package/scripts/build-orchestrator.js +320 -0
- package/scripts/check-routing-stats.cjs +122 -0
- package/scripts/ci-validation.js +375 -0
- package/scripts/cleanup-blocking-coordination.sh +420 -0
- package/scripts/cleanup-idle-sessions.sh +59 -0
- package/scripts/collect-build-metrics.js +65 -0
- package/scripts/demo/README.md +79 -0
- package/scripts/demo/autoscaling-demo-simplified.js +963 -0
- package/scripts/demo/comprehensive-dashboard-test.js +693 -0
- package/scripts/demo/confidence-log.js +87 -0
- package/scripts/demo/confidence-report.js +82 -0
- package/scripts/demo/demo-multi-swarm-coordination.js +325 -0
- package/scripts/demo/demo-production-deployment.js +399 -0
- package/scripts/demo/demo-visualization-system.js +149 -0
- package/scripts/demo/performance-analysis.cjs +71 -0
- package/scripts/demo/performance-analysis.js +71 -0
- package/scripts/demo/test-autoscaling-demo.js +314 -0
- package/scripts/dependency-optimizer.js +349 -0
- package/scripts/dependency-security-assessment.js +331 -0
- package/scripts/deploy-sdk.sh +176 -0
- package/scripts/deployment-readiness-report.json +179 -0
- package/scripts/dev/README.md +264 -0
- package/scripts/dev/claude-flow-wrapper.sh +35 -0
- package/scripts/dev/claude-monitor.py +419 -0
- package/scripts/dev/claude-sparc.sh +562 -0
- package/scripts/dev/claude-wrapper.sh +17 -0
- package/scripts/dev/demo-phase3-compliance.js +172 -0
- package/scripts/dev/demo-task-system.ts +224 -0
- package/scripts/dev/deployment-validator.js +315 -0
- package/scripts/dev/spawn-claude-terminal.sh +32 -0
- package/scripts/dev/start-portal.sh +506 -0
- package/scripts/dev/start-web-ui.js +15 -0
- package/scripts/dev/stop-portal.sh +311 -0
- package/scripts/dev/validate-examples.ts +288 -0
- package/scripts/dev/validate-phase2.cjs +451 -0
- package/scripts/dev/validate-phase2.js +785 -0
- package/scripts/dev/validate-phase3.cjs +208 -0
- package/scripts/dev/validate-security-remediation.js +1 -0
- package/scripts/ecosystem.config.cjs +90 -0
- package/scripts/fix-js-extensions.js +167 -0
- package/scripts/generate-basic-types.js +73 -0
- package/scripts/generate-changelog.js +318 -0
- package/scripts/git-hooks/pre-commit.sh +143 -0
- package/scripts/health-checks.js +634 -0
- package/scripts/hook-wrapper.sh +54 -0
- package/scripts/install/README.md +375 -0
- package/scripts/install/REDIS_SETUP_VALIDATION.json +245 -0
- package/scripts/install/check-prerequisites.js +303 -0
- package/scripts/install/config-wizard.js +606 -0
- package/scripts/install/dependency-checker.js +385 -0
- package/scripts/install/health-check.js +765 -0
- package/scripts/install/install.js +256 -0
- package/scripts/install/installation-benchmark.js +461 -0
- package/scripts/install/quick-install.js +720 -0
- package/scripts/install/quick-start-wizard.js +295 -0
- package/scripts/install/redis-cli.js +289 -0
- package/scripts/install/redis-install-guides.md +407 -0
- package/scripts/install/redis-setup.js +559 -0
- package/scripts/install/redis-test.js +278 -0
- package/scripts/install/service-manager.js +672 -0
- package/scripts/install/setup.js +832 -0
- package/scripts/install/uninstall.js +526 -0
- package/scripts/install/update.js +461 -0
- package/scripts/install-pre-commit-hook.sh +127 -0
- package/scripts/legacy/README.md +272 -0
- package/scripts/legacy/batch-fix-ts.sh +54 -0
- package/scripts/legacy/build-migration.sh +105 -0
- package/scripts/legacy/build-monitor.js +209 -0
- package/scripts/legacy/build-with-filter.sh +84 -0
- package/scripts/legacy/build-workaround.sh +71 -0
- package/scripts/legacy/fix-ts-advanced.js +358 -0
- package/scripts/legacy/fix-ts-final.sh +50 -0
- package/scripts/legacy/fix-ts-targeted.sh +49 -0
- package/scripts/legacy/fix-typescript-errors.js +305 -0
- package/scripts/legacy/force-build.sh +63 -0
- package/scripts/legacy/optimize-performance.js +400 -0
- package/scripts/legacy/performance-monitor.js +263 -0
- package/scripts/legacy/performance-monitoring.js +532 -0
- package/scripts/legacy/performance-test-runner.js +645 -0
- package/scripts/legacy/quick-fix-ts.js +281 -0
- package/scripts/legacy/safe-build.sh +63 -0
- package/scripts/memory-monitor-coordinator.js +322 -0
- package/scripts/migrate-to-sdk.sh +520 -0
- package/scripts/migration/QUICK-START.md +189 -0
- package/scripts/migration/QUICK-START.md.backup-1760135091363 +189 -0
- package/scripts/migration/README.md +464 -0
- package/scripts/migration/TASK-1.3.2-COMPLETION-REPORT.md +500 -0
- package/scripts/migration/TASK-1.3.2-COMPLETION-REPORT.md.backup-1760135091348 +500 -0
- package/scripts/migration/UPDATE-PATHS-README.md +464 -0
- package/scripts/migration/UPDATE-PATHS-README.md.backup-1760135091337 +464 -0
- package/scripts/migration/example-patterns.json +19 -0
- package/scripts/migration/install-arm64.js +78 -0
- package/scripts/migration/install.js +83 -0
- package/scripts/migration/migrate-hooks.js +173 -0
- package/scripts/migration/migration-examples.ts +318 -0
- package/scripts/migration/reorganize-workspace.js +504 -0
- package/scripts/migration/test-update-paths.js +359 -0
- package/scripts/migration/update-paths.js +664 -0
- package/scripts/migration/validate-migration.js +647 -0
- package/scripts/monitor-loop.sh +65 -0
- package/scripts/monitor-memory.sh +47 -0
- package/scripts/monitor-migration.js +339 -0
- package/scripts/monitor.py +43 -0
- package/scripts/monitoring/README.md +178 -0
- package/scripts/monitoring/alert-monitor.sh +220 -0
- package/scripts/monitoring/analyze-resources.sh +199 -0
- package/scripts/monitoring/dashboards/rate-limiting-dashboard.json +211 -0
- package/scripts/monitoring/dynamic-monitor.sh +85 -0
- package/scripts/monitoring/launch-stability-test.sh +184 -0
- package/scripts/monitoring/monitor-test.sh +93 -0
- package/scripts/monitoring/pre-test-validation.sh +208 -0
- package/scripts/monitoring/quick-test-alerting.sh +118 -0
- package/scripts/monitoring/quick-test-rate-limiting.sh +206 -0
- package/scripts/monitoring/rate-limiting-monitor.sh +380 -0
- package/scripts/monitoring/resource-monitor.sh +126 -0
- package/scripts/monitoring/stability-monitor.js +429 -0
- package/scripts/monitoring/test-monitor-quick.sh +54 -0
- package/scripts/monitoring/view-alerts.sh +307 -0
- package/scripts/npm-metrics-collector.js +482 -0
- package/scripts/npm-package-validation.cjs +299 -0
- package/scripts/optimization/build-optimizer.js +438 -0
- package/scripts/optimization/config-validator.js +761 -0
- package/scripts/optimization/test-optimization.js +432 -0
- package/scripts/optimization/unified-activation.js +839 -0
- package/scripts/optimize-package-swarm.js +54 -0
- package/scripts/performance/ACTIVATION_COMMANDS.md +292 -0
- package/scripts/performance/sqlite-enhanced-activation.sh +583 -0
- package/scripts/performance/test-enhanced-backend.sh +504 -0
- package/scripts/performance-monitor.js +644 -0
- package/scripts/performance-test-runner.js +698 -0
- package/scripts/post-deployment-monitoring.js +350 -0
- package/scripts/post-edit-pipeline.js +2091 -0
- package/scripts/post-install-claude-md.js +78 -0
- package/scripts/postinstall.js +79 -0
- package/scripts/pre-publish-validation.cjs +212 -0
- package/scripts/pre-publish-validation.js +429 -0
- package/scripts/redis-lua/cleanup-blocking-coordination.lua +198 -0
- package/scripts/release-announcement.js +425 -0
- package/scripts/release-notification.js +248 -0
- package/scripts/release-rollback.js +376 -0
- package/scripts/release-validation.js +460 -0
- package/scripts/rollback-sdk.sh +66 -0
- package/scripts/run-production-validation.ts +590 -0
- package/scripts/run-stability-validation.sh +687 -0
- package/scripts/security/README.md +339 -0
- package/scripts/security/deployment-validation.cjs +279 -0
- package/scripts/security/envelope-encryption-confidence-report.cjs +422 -0
- package/scripts/security/install-git-hooks.sh +132 -0
- package/scripts/security/install-git-secrets.sh +295 -0
- package/scripts/security/rotate-api-keys.js +469 -0
- package/scripts/security/ruv-swarm-safe.js +74 -0
- package/scripts/security/security-audit.cjs +538 -0
- package/scripts/security/setup-redis-auth.sh +397 -0
- package/scripts/security/validate-envelope-encryption.cjs +340 -0
- package/scripts/security-scan.js +492 -0
- package/scripts/src/web/frontend/.claude-flow/metrics/agent-metrics.json +1 -0
- package/scripts/src/web/frontend/.claude-flow/metrics/performance.json +9 -0
- package/scripts/src/web/frontend/.claude-flow/metrics/task-metrics.json +10 -0
- package/scripts/switch-api.sh +158 -0
- package/scripts/sync-agents.js +290 -0
- package/scripts/test/50-agent-test.js +625 -0
- package/scripts/test/NEW_STABILITY_TEST_GUIDE.md +407 -0
- package/scripts/test/README.md +236 -0
- package/scripts/test/STABILITY_TEST_EXAMPLE.md +347 -0
- package/scripts/test/STABILITY_TEST_README.md +480 -0
- package/scripts/test/agent-worker.js +309 -0
- package/scripts/test/ai-coordination-test.js +650 -0
- package/scripts/test/ai-mesh-coordination-test.js +416 -0
- package/scripts/test/check-links.ts +274 -0
- package/scripts/test/check-performance-regression.ts +168 -0
- package/scripts/test/cli-agent-coordination-test.js +313 -0
- package/scripts/test/coordinator-multilingual-test.js +396 -0
- package/scripts/test/coordinator-transparency-demo.js +585 -0
- package/scripts/test/coverage-report.ts +692 -0
- package/scripts/test/generate-swarm-tests.js +633 -0
- package/scripts/test/integration-test-validation.cjs +253 -0
- package/scripts/test/load-test-swarm.js +576 -0
- package/scripts/test/mesh-coordination-zero-overlap-test.js +740 -0
- package/scripts/test/multilingual-hello-world-test.js +390 -0
- package/scripts/test/quick-multilingual-demo.js +464 -0
- package/scripts/test/real-agent-test.js +312 -0
- package/scripts/test/run-phase3-compliance-tests.js +427 -0
- package/scripts/test/run-stability-test-examples.sh +292 -0
- package/scripts/test/stability-results/stability-metrics.jsonl +83 -0
- package/scripts/test/stability-results/stability-test-report.json +128 -0
- package/scripts/test/stability-results/stability-test.log +1827 -0
- package/scripts/test/stability-test-50-agents.js +734 -0
- package/scripts/test/test-batch-tasks.ts +29 -0
- package/scripts/test/test-byzantine-resolution.js +246 -0
- package/scripts/test/test-claude-spawn-options.sh +63 -0
- package/scripts/test/test-cli-wizard.js +331 -0
- package/scripts/test/test-comprehensive.js +401 -0
- package/scripts/test/test-coordination-features.ts +238 -0
- package/scripts/test/test-fallback-systems.js +276 -0
- package/scripts/test/test-init-command.ts +302 -0
- package/scripts/test/test-mcp.ts +251 -0
- package/scripts/test/test-runner.ts +568 -0
- package/scripts/test/test-swarm-integration.sh +92 -0
- package/scripts/test/test-swarm.ts +142 -0
- package/scripts/test/validation-summary.ts +408 -0
- package/scripts/test-cleanup-performance.sh +416 -0
- package/scripts/test-dashboard-auth.cjs +203 -0
- package/scripts/test-docker-deployment.sh +207 -0
- package/scripts/test-npm-package.cjs +167 -0
- package/scripts/test-provider-routing.cjs +226 -0
- package/scripts/test-routing-telemetry.cjs +147 -0
- package/scripts/test-runner.cjs +154 -0
- package/scripts/test-zai-10k.cjs +81 -0
- package/scripts/test-zai-api.cjs +191 -0
- package/scripts/test-zai-diagnostic.cjs +151 -0
- package/scripts/test-zai-final.cjs +128 -0
- package/scripts/test-zai-with-env.cjs +85 -0
- package/scripts/utils/README.md +261 -0
- package/scripts/utils/clean-build-artifacts.sh +94 -0
- package/scripts/utils/cleanup-root.sh +69 -0
- package/scripts/utils/fix-cliffy-imports.js +307 -0
- package/scripts/utils/fix-duplicate-imports.js +114 -0
- package/scripts/utils/fix-error-handling.cjs +70 -0
- package/scripts/utils/fix-import-paths.js +104 -0
- package/scripts/utils/fix-imports.js +116 -0
- package/scripts/utils/fix-shebang.js +78 -0
- package/scripts/utils/fix-test-modules.js +27 -0
- package/scripts/utils/fix-timezone-issue-246.js +200 -0
- package/scripts/utils/fix-ts-comprehensive.py +182 -0
- package/scripts/utils/fix-ts-targeted-batch.js +250 -0
- package/scripts/utils/remove-benchmark-conflicts.sh +140 -0
- package/scripts/utils/simple-test-fixer.js +190 -0
- package/scripts/utils/validate-metrics-structure.cjs +144 -0
- package/scripts/validate-agent-hooks.js +506 -0
- package/scripts/validate-changelog.js +241 -0
- package/scripts/validate-coordination-cli.js +69 -0
- package/scripts/validate-coordination-toggle-integration.cjs +501 -0
- package/scripts/validate-docker-infrastructure.sh +502 -0
- package/scripts/validate-entry-points.js +300 -0
- package/scripts/validate-stage3-performance.ts +377 -0
- package/scripts/validate-template-bundling.js +180 -0
- package/scripts/validation/README.md +33 -0
- package/scripts/validation/acl-security-validation.cjs +214 -0
- package/scripts/validation/acl-security-validation.js +402 -0
- package/scripts/validation/byzantine-verification.js +407 -0
- package/scripts/validation/final-phase-2-consensus.cjs +219 -0
- package/scripts/validation/final-security-validation.js +791 -0
- package/scripts/validation/final-wasm-validation.cjs +840 -0
- package/scripts/validation/integration-test-analysis.js +105 -0
- package/scripts/validation/phase-0-comprehensive-validation.js +474 -0
- package/scripts/validation/phase-0-consensus-report.js +139 -0
- package/scripts/validation/phase-0-final-report.js +112 -0
- package/scripts/validation/phase-0-redis-consensus-report.js +129 -0
- package/scripts/validation/phase-0-validation-improved.js +490 -0
- package/scripts/validation/phase-0-validation-test.js +65 -0
- package/scripts/validation/phase-1-consensus-report.cjs +342 -0
- package/scripts/validation/phase-1-consensus-validation.cjs +551 -0
- package/scripts/validation/phase-1-consensus-validation.js +551 -0
- package/scripts/validation/phase-2-consensus-report.cjs +186 -0
- package/scripts/validation/phase-2-validation.cjs +171 -0
- package/scripts/validation/phase-2-validation.js +171 -0
- package/scripts/validation/phase-4-consensus-report.js +181 -0
- package/scripts/validation/phase-4-final-validation.js +351 -0
- package/scripts/validation/phase-5-consensus-report.cjs +113 -0
- package/scripts/validation/phase-5-consensus-report.js +113 -0
- package/scripts/validation/security-analysis.js +49 -0
- package/scripts/validation/security-validation.js +492 -0
- package/scripts/validation/simple-security-validation.js +464 -0
- package/scripts/verify-installation.js +112 -0
- package/scripts/verify-mcp-server.js +86 -0
- package/scripts/verify-sdk-phase1.cjs +293 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Claude Flow Novice - Dependency Checker
|
|
5
|
+
*
|
|
6
|
+
* Validates system requirements and dependencies before installation
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { execSync, spawn } from 'child_process';
|
|
10
|
+
import { existsSync, accessSync, constants } from 'fs';
|
|
11
|
+
import { join, resolve } from 'path';
|
|
12
|
+
import { homedir, platform, arch, totalmem, freemem, cpus } from 'os';
|
|
13
|
+
import chalk from 'chalk';
|
|
14
|
+
import ora from 'ora';
|
|
15
|
+
|
|
16
|
+
class DependencyChecker {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.platform = platform();
|
|
19
|
+
this.arch = arch();
|
|
20
|
+
this.requirements = {
|
|
21
|
+
node: { min: '20.0.0', recommended: '20.10.0' },
|
|
22
|
+
npm: { min: '9.0.0', recommended: '10.0.0' },
|
|
23
|
+
memory: { min: 1024 * 1024 * 1024, recommended: 2 * 1024 * 1024 * 1024 }, // 1GB min, 2GB recommended
|
|
24
|
+
disk: { min: 1024 * 1024 * 1024, recommended: 5 * 1024 * 1024 * 1024 }, // 1GB min, 5GB recommended
|
|
25
|
+
redis: { min: '6.0.0', recommended: '7.0.0' }
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
this.results = {
|
|
29
|
+
passed: [],
|
|
30
|
+
warnings: [],
|
|
31
|
+
errors: [],
|
|
32
|
+
recommendations: []
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async check() {
|
|
37
|
+
console.log(chalk.blue.bold('🔍 Claude Flow Novice - System Dependency Check\n'));
|
|
38
|
+
|
|
39
|
+
await this.checkNodeVersion();
|
|
40
|
+
await this.checkNpmVersion();
|
|
41
|
+
await this.checkMemoryRequirements();
|
|
42
|
+
await this.checkDiskSpace();
|
|
43
|
+
await this.checkRedisAvailability();
|
|
44
|
+
await this.checkPlatformCompatibility();
|
|
45
|
+
await this.checkNetworkConnectivity();
|
|
46
|
+
await this.checkDevelopmentTools();
|
|
47
|
+
|
|
48
|
+
this.displayResults();
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
success: this.results.errors.length === 0,
|
|
52
|
+
passed: this.results.passed,
|
|
53
|
+
warnings: this.results.warnings,
|
|
54
|
+
errors: this.results.errors,
|
|
55
|
+
recommendations: this.results.recommendations
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async checkNodeVersion() {
|
|
60
|
+
const spinner = ora('Checking Node.js version...').start();
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
const version = process.version;
|
|
64
|
+
const versionNum = version.slice(1); // Remove 'v' prefix
|
|
65
|
+
const minVersion = this.requirements.node.min;
|
|
66
|
+
const recommendedVersion = this.requirements.node.recommended;
|
|
67
|
+
|
|
68
|
+
if (this.compareVersions(versionNum, minVersion) >= 0) {
|
|
69
|
+
if (this.compareVersions(versionNum, recommendedVersion) >= 0) {
|
|
70
|
+
spinner.succeed(`Node.js ${version} (Recommended)`);
|
|
71
|
+
this.results.passed.push(`Node.js version ${version} meets requirements`);
|
|
72
|
+
} else {
|
|
73
|
+
spinner.succeed(`Node.js ${version} (Supported)`);
|
|
74
|
+
this.results.passed.push(`Node.js version ${version} meets minimum requirements`);
|
|
75
|
+
this.results.recommendations.push(`Consider upgrading to Node.js ${recommendedVersion} for better performance`);
|
|
76
|
+
}
|
|
77
|
+
} else {
|
|
78
|
+
spinner.fail(`Node.js ${version} (Unsupported)`);
|
|
79
|
+
this.results.errors.push(`Node.js version ${version} is too old. Requires ${minVersion} or later`);
|
|
80
|
+
}
|
|
81
|
+
} catch (error) {
|
|
82
|
+
spinner.fail('Node.js version check failed');
|
|
83
|
+
this.results.errors.push('Unable to determine Node.js version');
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async checkNpmVersion() {
|
|
88
|
+
const spinner = ora('Checking npm version...').start();
|
|
89
|
+
|
|
90
|
+
try {
|
|
91
|
+
const version = execSync('npm --version', { encoding: 'utf8' }).trim();
|
|
92
|
+
const minVersion = this.requirements.npm.min;
|
|
93
|
+
const recommendedVersion = this.requirements.npm.recommended;
|
|
94
|
+
|
|
95
|
+
if (this.compareVersions(version, minVersion) >= 0) {
|
|
96
|
+
if (this.compareVersions(version, recommendedVersion) >= 0) {
|
|
97
|
+
spinner.succeed(`npm ${version} (Recommended)`);
|
|
98
|
+
this.results.passed.push(`npm version ${version} meets requirements`);
|
|
99
|
+
} else {
|
|
100
|
+
spinner.succeed(`npm ${version} (Supported)`);
|
|
101
|
+
this.results.passed.push(`npm version ${version} meets minimum requirements`);
|
|
102
|
+
this.results.recommendations.push(`Consider upgrading to npm ${recommendedVersion} for better performance`);
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
spinner.fail(`npm ${version} (Unsupported)`);
|
|
106
|
+
this.results.errors.push(`npm version ${version} is too old. Requires ${minVersion} or later`);
|
|
107
|
+
}
|
|
108
|
+
} catch (error) {
|
|
109
|
+
spinner.fail('npm version check failed');
|
|
110
|
+
this.results.errors.push('Unable to determine npm version');
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
async checkMemoryRequirements() {
|
|
115
|
+
const spinner = ora('Checking memory requirements...').start();
|
|
116
|
+
|
|
117
|
+
try {
|
|
118
|
+
const free = freemem();
|
|
119
|
+
const total = totalmem();
|
|
120
|
+
const required = this.requirements.memory.min;
|
|
121
|
+
const recommended = this.requirements.memory.recommended;
|
|
122
|
+
|
|
123
|
+
const freeGB = Math.round(free / 1024 / 1024 / 1024 * 10) / 10;
|
|
124
|
+
const totalGB = Math.round(total / 1024 / 1024 / 1024 * 10) / 10;
|
|
125
|
+
|
|
126
|
+
if (free >= recommended) {
|
|
127
|
+
spinner.succeed(`Memory: ${freeGB}GB free (Excellent)`);
|
|
128
|
+
this.results.passed.push(`Memory: ${freeGB}GB free, ${totalGB}GB total`);
|
|
129
|
+
} else if (free >= required) {
|
|
130
|
+
spinner.succeed(`Memory: ${freeGB}GB free (Adequate)`);
|
|
131
|
+
this.results.passed.push(`Memory: ${freeGB}GB free, ${totalGB}GB total`);
|
|
132
|
+
this.results.warnings.push('Limited memory available - consider closing other applications');
|
|
133
|
+
} else {
|
|
134
|
+
spinner.fail(`Memory: ${freeGB}GB free (Insufficient)`);
|
|
135
|
+
this.results.errors.push(`Insufficient memory. Requires at least ${Math.round(required / 1024 / 1024 / 1024)}GB free`);
|
|
136
|
+
}
|
|
137
|
+
} catch (error) {
|
|
138
|
+
spinner.fail('Memory check failed');
|
|
139
|
+
this.results.warnings.push('Unable to determine memory usage');
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async checkDiskSpace() {
|
|
144
|
+
const spinner = ora('Checking disk space...').start();
|
|
145
|
+
|
|
146
|
+
try {
|
|
147
|
+
const homeDir = homedir();
|
|
148
|
+
|
|
149
|
+
// Simple disk space check (in production, use a proper library like 'diskusage')
|
|
150
|
+
let availableSpace = 10 * 1024 * 1024 * 1024; // Default to 10GB
|
|
151
|
+
|
|
152
|
+
try {
|
|
153
|
+
if (this.platform === 'win32') {
|
|
154
|
+
const output = execSync('wmic logicaldisk get freespace', { encoding: 'utf8' });
|
|
155
|
+
const lines = output.split('\n').filter(line => line.trim());
|
|
156
|
+
const freespace = parseInt(lines[1]) * 1024; // Convert to bytes
|
|
157
|
+
availableSpace = freespace;
|
|
158
|
+
} else {
|
|
159
|
+
const output = execSync('df -h ~', { encoding: 'utf8' });
|
|
160
|
+
const lines = output.split('\n');
|
|
161
|
+
const dataLine = lines[1];
|
|
162
|
+
const available = dataLine.split(/\s+/)[3];
|
|
163
|
+
availableSpace = this.parseDiskSpace(available);
|
|
164
|
+
}
|
|
165
|
+
} catch (error) {
|
|
166
|
+
// Fallback if disk space check fails
|
|
167
|
+
spinner.warn('Disk space check failed - assuming sufficient space');
|
|
168
|
+
this.results.warnings.push('Unable to determine available disk space');
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const required = this.requirements.disk.min;
|
|
173
|
+
const recommended = this.requirements.disk.recommended;
|
|
174
|
+
const availableGB = Math.round(availableSpace / 1024 / 1024 / 1024 * 10) / 10;
|
|
175
|
+
const requiredGB = Math.round(required / 1024 / 1024 / 1024);
|
|
176
|
+
const recommendedGB = Math.round(recommended / 1024 / 1024 / 1024);
|
|
177
|
+
|
|
178
|
+
if (availableSpace >= recommended) {
|
|
179
|
+
spinner.succeed(`Disk space: ${availableGB}GB available (Excellent)`);
|
|
180
|
+
this.results.passed.push(`Disk space: ${availableGB}GB available`);
|
|
181
|
+
} else if (availableSpace >= required) {
|
|
182
|
+
spinner.succeed(`Disk space: ${availableGB}GB available (Adequate)`);
|
|
183
|
+
this.results.passed.push(`Disk space: ${availableGB}GB available`);
|
|
184
|
+
this.results.warnings.push('Limited disk space available');
|
|
185
|
+
} else {
|
|
186
|
+
spinner.fail(`Disk space: ${availableGB}GB available (Insufficient)`);
|
|
187
|
+
this.results.errors.push(`Insufficient disk space. Requires at least ${requiredGB}GB`);
|
|
188
|
+
}
|
|
189
|
+
} catch (error) {
|
|
190
|
+
spinner.fail('Disk space check failed');
|
|
191
|
+
this.results.warnings.push('Unable to determine disk space availability');
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
parseDiskSpace(spaceStr) {
|
|
196
|
+
const units = { K: 1024, M: 1024 * 1024, G: 1024 * 1024 * 1024, T: 1024 * 1024 * 1024 * 1024 };
|
|
197
|
+
const match = spaceStr.match(/^(\d+\.?\d*)(K|M|G|T)?$/);
|
|
198
|
+
if (!match) return 0;
|
|
199
|
+
|
|
200
|
+
const [, value, unit] = match;
|
|
201
|
+
const multiplier = units[unit] || 1;
|
|
202
|
+
return parseFloat(value) * multiplier;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
async checkRedisAvailability() {
|
|
206
|
+
const spinner = ora('Checking Redis availability...').start();
|
|
207
|
+
|
|
208
|
+
try {
|
|
209
|
+
// Check if Redis is installed
|
|
210
|
+
execSync('redis-cli --version', { stdio: 'ignore' });
|
|
211
|
+
|
|
212
|
+
// Try to connect to Redis
|
|
213
|
+
const output = execSync('redis-cli ping', { encoding: 'utf8', timeout: 5000 });
|
|
214
|
+
|
|
215
|
+
if (output.trim() === 'PONG') {
|
|
216
|
+
spinner.succeed('Redis server is running and responsive');
|
|
217
|
+
this.results.passed.push('Redis server is available');
|
|
218
|
+
} else {
|
|
219
|
+
spinner.warn('Redis is installed but not responding');
|
|
220
|
+
this.results.warnings.push('Redis is installed but may need to be started');
|
|
221
|
+
}
|
|
222
|
+
} catch (error) {
|
|
223
|
+
spinner.warn('Redis not found or not running');
|
|
224
|
+
this.results.warnings.push('Redis not installed - will be installed during setup');
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
async checkPlatformCompatibility() {
|
|
229
|
+
const spinner = ora('Checking platform compatibility...').start();
|
|
230
|
+
|
|
231
|
+
try {
|
|
232
|
+
const platformInfo = `${this.platform}-${this.arch}`;
|
|
233
|
+
|
|
234
|
+
const supportedPlatforms = [
|
|
235
|
+
'darwin-x64', 'darwin-arm64',
|
|
236
|
+
'linux-x64', 'linux-arm64',
|
|
237
|
+
'win32-x64', 'win32-arm64'
|
|
238
|
+
];
|
|
239
|
+
|
|
240
|
+
if (supportedPlatforms.includes(platformInfo)) {
|
|
241
|
+
spinner.succeed(`Platform: ${platformInfo} (Supported)`);
|
|
242
|
+
this.results.passed.push(`Platform ${platformInfo} is supported`);
|
|
243
|
+
} else {
|
|
244
|
+
spinner.warn(`Platform: ${platformInfo} (Unknown)`);
|
|
245
|
+
this.results.warnings.push(`Platform ${platformInfo} may not be fully supported`);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Check for WSL on Windows
|
|
249
|
+
if (this.platform === 'linux' && process.env.WSL_DISTRO_NAME) {
|
|
250
|
+
spinner.succeed('WSL environment detected (Optimized)');
|
|
251
|
+
this.results.passed.push('WSL environment detected with optimizations');
|
|
252
|
+
}
|
|
253
|
+
} catch (error) {
|
|
254
|
+
spinner.fail('Platform check failed');
|
|
255
|
+
this.results.warnings.push('Unable to determine platform compatibility');
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
async checkNetworkConnectivity() {
|
|
260
|
+
const spinner = ora('Checking network connectivity...').start();
|
|
261
|
+
|
|
262
|
+
try {
|
|
263
|
+
// Check npm registry connectivity
|
|
264
|
+
execSync('npm ping', { stdio: 'ignore', timeout: 10000 });
|
|
265
|
+
|
|
266
|
+
// Check GitHub connectivity
|
|
267
|
+
execSync('curl -s https://api.github.com > /dev/null', { stdio: 'ignore', timeout: 10000 });
|
|
268
|
+
|
|
269
|
+
spinner.succeed('Network connectivity confirmed');
|
|
270
|
+
this.results.passed.push('Network connectivity is available');
|
|
271
|
+
} catch (error) {
|
|
272
|
+
spinner.warn('Network connectivity issues detected');
|
|
273
|
+
this.results.warnings.push('Network connectivity issues - may affect package installation');
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
async checkDevelopmentTools() {
|
|
278
|
+
const spinner = ora('Checking development tools...').start();
|
|
279
|
+
|
|
280
|
+
const tools = [
|
|
281
|
+
{ name: 'Git', command: 'git --version', recommended: true },
|
|
282
|
+
{ name: 'Python', command: 'python --version', recommended: false },
|
|
283
|
+
{ name: 'Docker', command: 'docker --version', recommended: false },
|
|
284
|
+
{ name: 'Make', command: 'make --version', recommended: false }
|
|
285
|
+
];
|
|
286
|
+
|
|
287
|
+
const availableTools = [];
|
|
288
|
+
const missingTools = [];
|
|
289
|
+
|
|
290
|
+
for (const tool of tools) {
|
|
291
|
+
try {
|
|
292
|
+
execSync(tool.command, { stdio: 'ignore' });
|
|
293
|
+
availableTools.push(tool.name);
|
|
294
|
+
} catch (error) {
|
|
295
|
+
if (tool.recommended) {
|
|
296
|
+
missingTools.push(tool.name);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (availableTools.length > 0) {
|
|
302
|
+
spinner.succeed(`Development tools: ${availableTools.join(', ')}`);
|
|
303
|
+
this.results.passed.push(`Available development tools: ${availableTools.join(', ')}`);
|
|
304
|
+
} else {
|
|
305
|
+
spinner.warn('Limited development tools available');
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
if (missingTools.length > 0) {
|
|
309
|
+
this.results.recommendations.push(`Consider installing: ${missingTools.join(', ')}`);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
displayResults() {
|
|
314
|
+
console.log('\n' + chalk.blue.bold('📊 Dependency Check Results\n'));
|
|
315
|
+
|
|
316
|
+
// Display passed checks
|
|
317
|
+
if (this.results.passed.length > 0) {
|
|
318
|
+
console.log(chalk.green.bold('✅ Passed:'));
|
|
319
|
+
this.results.passed.forEach(item => {
|
|
320
|
+
console.log(chalk.green(` • ${item}`));
|
|
321
|
+
});
|
|
322
|
+
console.log();
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Display warnings
|
|
326
|
+
if (this.results.warnings.length > 0) {
|
|
327
|
+
console.log(chalk.yellow.bold('⚠️ Warnings:'));
|
|
328
|
+
this.results.warnings.forEach(item => {
|
|
329
|
+
console.log(chalk.yellow(` • ${item}`));
|
|
330
|
+
});
|
|
331
|
+
console.log();
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// Display errors
|
|
335
|
+
if (this.results.errors.length > 0) {
|
|
336
|
+
console.log(chalk.red.bold('❌ Errors:'));
|
|
337
|
+
this.results.errors.forEach(item => {
|
|
338
|
+
console.log(chalk.red(` • ${item}`));
|
|
339
|
+
});
|
|
340
|
+
console.log();
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Display recommendations
|
|
344
|
+
if (this.results.recommendations.length > 0) {
|
|
345
|
+
console.log(chalk.cyan.bold('💡 Recommendations:'));
|
|
346
|
+
this.results.recommendations.forEach(item => {
|
|
347
|
+
console.log(chalk.cyan(` • ${item}`));
|
|
348
|
+
});
|
|
349
|
+
console.log();
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// Overall status
|
|
353
|
+
if (this.results.errors.length === 0) {
|
|
354
|
+
console.log(chalk.green.bold('🎉 All requirements met! You can proceed with installation.\n'));
|
|
355
|
+
} else {
|
|
356
|
+
console.log(chalk.red.bold('⚠️ Please resolve errors before proceeding with installation.\n'));
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
compareVersions(version1, version2) {
|
|
361
|
+
const v1parts = version1.split('.').map(Number);
|
|
362
|
+
const v2parts = version2.split('.').map(Number);
|
|
363
|
+
const maxLength = Math.max(v1parts.length, v2parts.length);
|
|
364
|
+
|
|
365
|
+
for (let i = 0; i < maxLength; i++) {
|
|
366
|
+
const v1part = v1parts[i] || 0;
|
|
367
|
+
const v2part = v2parts[i] || 0;
|
|
368
|
+
|
|
369
|
+
if (v1part > v2part) return 1;
|
|
370
|
+
if (v1part < v2part) return -1;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
return 0;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// Execute dependency checker
|
|
378
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
379
|
+
const checker = new DependencyChecker();
|
|
380
|
+
checker.check().then(result => {
|
|
381
|
+
process.exit(result.success ? 0 : 1);
|
|
382
|
+
}).catch(console.error);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export default DependencyChecker;
|