vibeteam 0.2.2 → 0.2.3
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/bin/cli.js +143 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -866,7 +866,149 @@ console.log(`
|
|
|
866
866
|
╰─────────────────────────────────────╯
|
|
867
867
|
`)
|
|
868
868
|
|
|
869
|
-
//
|
|
869
|
+
// ============================================================================
|
|
870
|
+
// Critical Dependency Check (blocks startup if missing)
|
|
871
|
+
// ============================================================================
|
|
872
|
+
|
|
873
|
+
function detectPackageManager() {
|
|
874
|
+
const platform = process.platform
|
|
875
|
+
|
|
876
|
+
if (platform === 'darwin') {
|
|
877
|
+
// macOS - check for brew
|
|
878
|
+
try {
|
|
879
|
+
execSync('which brew', { stdio: 'ignore' })
|
|
880
|
+
return { name: 'brew', install: (pkg) => `brew install ${pkg}` }
|
|
881
|
+
} catch {
|
|
882
|
+
return null
|
|
883
|
+
}
|
|
884
|
+
} else if (platform === 'linux') {
|
|
885
|
+
// Linux - check for apt, then yum/dnf
|
|
886
|
+
try {
|
|
887
|
+
execSync('which apt', { stdio: 'ignore' })
|
|
888
|
+
return { name: 'apt', install: (pkg) => `sudo apt install -y ${pkg}` }
|
|
889
|
+
} catch {
|
|
890
|
+
try {
|
|
891
|
+
execSync('which dnf', { stdio: 'ignore' })
|
|
892
|
+
return { name: 'dnf', install: (pkg) => `sudo dnf install -y ${pkg}` }
|
|
893
|
+
} catch {
|
|
894
|
+
try {
|
|
895
|
+
execSync('which yum', { stdio: 'ignore' })
|
|
896
|
+
return { name: 'yum', install: (pkg) => `sudo yum install -y ${pkg}` }
|
|
897
|
+
} catch {
|
|
898
|
+
return null
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
return null
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
async function installDependency(pkgManager, depName) {
|
|
907
|
+
const cmd = pkgManager.install(depName)
|
|
908
|
+
console.log(` Running: ${cmd}`)
|
|
909
|
+
console.log()
|
|
910
|
+
|
|
911
|
+
try {
|
|
912
|
+
execSync(cmd, { stdio: 'inherit' })
|
|
913
|
+
return true
|
|
914
|
+
} catch (e) {
|
|
915
|
+
console.log(` ✗ Failed to install ${depName}`)
|
|
916
|
+
return false
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
async function checkRequiredDependencies() {
|
|
921
|
+
const missing = []
|
|
922
|
+
|
|
923
|
+
// Check tmux (REQUIRED - agents won't spawn without it)
|
|
924
|
+
if (!checkTmux()) {
|
|
925
|
+
missing.push({
|
|
926
|
+
name: 'tmux',
|
|
927
|
+
reason: 'Required for running Claude agents in background sessions',
|
|
928
|
+
})
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
// Check jq (REQUIRED - hooks won't work without it)
|
|
932
|
+
if (!checkJq()) {
|
|
933
|
+
missing.push({
|
|
934
|
+
name: 'jq',
|
|
935
|
+
reason: 'Required for Claude Code hooks to capture events',
|
|
936
|
+
})
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
if (missing.length === 0) {
|
|
940
|
+
return true // All good
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
// Show what's missing
|
|
944
|
+
console.log(' ╭─────────────────────────────────────╮')
|
|
945
|
+
console.log(' │ Missing Required Dependencies │')
|
|
946
|
+
console.log(' ╰─────────────────────────────────────╯')
|
|
947
|
+
console.log()
|
|
948
|
+
|
|
949
|
+
for (const dep of missing) {
|
|
950
|
+
console.log(` ✗ ${dep.name} - ${dep.reason}`)
|
|
951
|
+
}
|
|
952
|
+
console.log()
|
|
953
|
+
|
|
954
|
+
// Detect package manager
|
|
955
|
+
const pkgManager = detectPackageManager()
|
|
956
|
+
|
|
957
|
+
if (pkgManager) {
|
|
958
|
+
const answer = await askQuestion(` Install missing dependencies using ${pkgManager.name}? (y/n): `)
|
|
959
|
+
|
|
960
|
+
if (answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes') {
|
|
961
|
+
console.log()
|
|
962
|
+
|
|
963
|
+
let allInstalled = true
|
|
964
|
+
for (const dep of missing) {
|
|
965
|
+
const success = await installDependency(pkgManager, dep.name)
|
|
966
|
+
if (!success) {
|
|
967
|
+
allInstalled = false
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
if (allInstalled) {
|
|
972
|
+
console.log()
|
|
973
|
+
console.log(' ✓ All dependencies installed successfully!')
|
|
974
|
+
console.log()
|
|
975
|
+
return true
|
|
976
|
+
} else {
|
|
977
|
+
console.log()
|
|
978
|
+
console.log(' Some dependencies failed to install. Please install them manually.')
|
|
979
|
+
process.exit(1)
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
} else {
|
|
983
|
+
// No package manager detected - show manual instructions
|
|
984
|
+
console.log(' Could not detect package manager. Please install manually:')
|
|
985
|
+
console.log()
|
|
986
|
+
console.log(' macOS: brew install tmux jq')
|
|
987
|
+
console.log(' Ubuntu: sudo apt install tmux jq')
|
|
988
|
+
console.log(' Fedora: sudo dnf install tmux jq')
|
|
989
|
+
console.log()
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
// Ask if they want to continue anyway
|
|
993
|
+
const continueAnswer = await askQuestion(' Continue without these dependencies? (y/n): ')
|
|
994
|
+
|
|
995
|
+
if (continueAnswer.toLowerCase() === 'y' || continueAnswer.toLowerCase() === 'yes') {
|
|
996
|
+
console.log()
|
|
997
|
+
console.log(' ⚠ Continuing without all dependencies - some features may not work!')
|
|
998
|
+
console.log()
|
|
999
|
+
return true
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
console.log()
|
|
1003
|
+
console.log(' Install the missing dependencies and run vibeteam again.')
|
|
1004
|
+
console.log()
|
|
1005
|
+
process.exit(1)
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
// Check dependencies before starting
|
|
1009
|
+
await checkRequiredDependencies()
|
|
1010
|
+
|
|
1011
|
+
// Run health checks (warnings only)
|
|
870
1012
|
printHealthCheck()
|
|
871
1013
|
|
|
872
1014
|
console.log(`Starting server on port ${port}...`)
|