vibeteam 0.2.0 → 0.2.2

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 CHANGED
@@ -25,10 +25,102 @@ import { dirname, resolve, join, basename } from 'path'
25
25
  import { fileURLToPath } from 'url'
26
26
  import { existsSync, mkdirSync, readFileSync } from 'fs'
27
27
  import { homedir } from 'os'
28
+ import * as readline from 'readline'
28
29
 
29
30
  const __dirname = dirname(fileURLToPath(import.meta.url))
30
31
  const ROOT = resolve(__dirname, '..')
31
32
 
33
+ // ============================================================================
34
+ // Update Check
35
+ // ============================================================================
36
+
37
+ async function checkForUpdates() {
38
+ // Skip update check for certain commands
39
+ const args = process.argv.slice(2)
40
+ if (args.includes('--help') || args.includes('-h') ||
41
+ args.includes('--version') || args.includes('-v') ||
42
+ args.includes('--hook-path') ||
43
+ args.includes('--skip-update-check')) {
44
+ return
45
+ }
46
+
47
+ try {
48
+ // Get current version
49
+ const pkg = JSON.parse(readFileSync(resolve(ROOT, 'package.json'), 'utf-8'))
50
+ const currentVersion = pkg.version
51
+
52
+ // Get latest version from npm (with timeout)
53
+ let latestVersion
54
+ try {
55
+ latestVersion = execSync('npm show vibeteam version 2>/dev/null', {
56
+ encoding: 'utf-8',
57
+ timeout: 5000
58
+ }).trim()
59
+ } catch {
60
+ // Network error or timeout - skip update check silently
61
+ return
62
+ }
63
+
64
+ if (!latestVersion || latestVersion === currentVersion) {
65
+ return
66
+ }
67
+
68
+ // Compare versions (simple semver comparison)
69
+ const current = currentVersion.split('.').map(Number)
70
+ const latest = latestVersion.split('.').map(Number)
71
+
72
+ let needsUpdate = false
73
+ for (let i = 0; i < 3; i++) {
74
+ if ((latest[i] || 0) > (current[i] || 0)) {
75
+ needsUpdate = true
76
+ break
77
+ } else if ((latest[i] || 0) < (current[i] || 0)) {
78
+ break
79
+ }
80
+ }
81
+
82
+ if (!needsUpdate) {
83
+ return
84
+ }
85
+
86
+ // Prompt user
87
+ console.log(`\n New version available: ${currentVersion} → ${latestVersion}`)
88
+
89
+ const answer = await askQuestion(' Update now? (y/n): ')
90
+
91
+ if (answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes') {
92
+ console.log('\n Updating vibeteam...\n')
93
+ try {
94
+ execSync('npm install -g vibeteam@latest', { stdio: 'inherit' })
95
+ console.log('\n Update complete! Please run vibeteam again.\n')
96
+ process.exit(0)
97
+ } catch (e) {
98
+ console.error('\n Update failed. Try manually: npm install -g vibeteam@latest\n')
99
+ }
100
+ } else {
101
+ console.log() // Add spacing
102
+ }
103
+ } catch {
104
+ // Any error in update check - continue silently
105
+ }
106
+ }
107
+
108
+ function askQuestion(question) {
109
+ return new Promise((resolve) => {
110
+ const rl = readline.createInterface({
111
+ input: process.stdin,
112
+ output: process.stdout
113
+ })
114
+ rl.question(question, (answer) => {
115
+ rl.close()
116
+ resolve(answer)
117
+ })
118
+ })
119
+ }
120
+
121
+ // Run update check before anything else
122
+ await checkForUpdates()
123
+
32
124
  // ============================================================================
33
125
  // Health Checks
34
126
  // ============================================================================
@@ -124,6 +216,7 @@ Options:
124
216
  --help, -h Show this help message
125
217
  --version, -v Show version
126
218
  --hook-path Print path to hook script (for manual setup)
219
+ --skip-update-check Skip the automatic update check
127
220
 
128
221
  Environment Variables:
129
222
  VIBETEAM_PORT WebSocket server port (default: 4003)
@@ -79,13 +79,14 @@ const EXEC_PATH = [
79
79
  '/usr/local/bin', // macOS Intel Homebrew / Linux local
80
80
  process.env.PATH || '',
81
81
  ].join(':');
82
- /** Simplified PATH for tmux spawn (avoid shell quoting issues with long PATH) */
82
+ /** PATH for tmux spawn - includes common locations plus original PATH */
83
83
  const TMUX_SPAWN_PATH = [
84
84
  `${HOME}/.local/bin`,
85
85
  '/opt/homebrew/bin',
86
86
  '/usr/local/bin',
87
87
  '/usr/bin',
88
88
  '/bin',
89
+ process.env.PATH || '',
89
90
  ].join(':');
90
91
  /** Options for exec() with extended PATH */
91
92
  const EXEC_OPTIONS = { env: { ...process.env, PATH: EXEC_PATH } };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibeteam",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "3D visualization of Claude Code as an interactive workshop",
5
5
  "author": "asara",
6
6
  "license": "MIT",
Binary file