@codebakers/cli 3.3.8 → 3.3.9

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.
@@ -75,6 +75,44 @@ class CodeBakersServer {
75
75
  this.checkAndAutoUpdate().catch(() => {
76
76
  // Silently ignore errors - don't interrupt user
77
77
  });
78
+ // Check for CLI version updates (non-blocking)
79
+ this.checkCliVersion().catch(() => {
80
+ // Silently ignore errors
81
+ });
82
+ }
83
+ /**
84
+ * Check if a newer CLI version is available and notify user
85
+ */
86
+ async checkCliVersion() {
87
+ try {
88
+ const currentVersion = (0, api_js_1.getCliVersion)();
89
+ // Fetch latest version from npm
90
+ const response = await fetch('https://registry.npmjs.org/@codebakers/cli/latest', {
91
+ headers: { 'Accept': 'application/json' },
92
+ });
93
+ if (!response.ok)
94
+ return;
95
+ const data = await response.json();
96
+ const latestVersion = data.version;
97
+ if (latestVersion && latestVersion !== currentVersion) {
98
+ // Compare versions (simple comparison - assumes semver)
99
+ const current = currentVersion.split('.').map(Number);
100
+ const latest = latestVersion.split('.').map(Number);
101
+ const isNewer = latest[0] > current[0] ||
102
+ (latest[0] === current[0] && latest[1] > current[1]) ||
103
+ (latest[0] === current[0] && latest[1] === current[1] && latest[2] > current[2]);
104
+ if (isNewer) {
105
+ console.error(`\n╔════════════════════════════════════════════════════════════╗`);
106
+ console.error(`║ 🆕 CodeBakers CLI Update Available: v${currentVersion} → v${latestVersion.padEnd(10)}║`);
107
+ console.error(`║ ║`);
108
+ console.error(`║ Restart Cursor/Claude Code to get the latest features! ║`);
109
+ console.error(`╚════════════════════════════════════════════════════════════╝\n`);
110
+ }
111
+ }
112
+ }
113
+ catch {
114
+ // Silently ignore - don't interrupt user experience
115
+ }
78
116
  }
79
117
  /**
80
118
  * Get authorization headers for API requests
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebakers/cli",
3
- "version": "3.3.8",
3
+ "version": "3.3.9",
4
4
  "description": "CodeBakers CLI - Production patterns for AI-assisted development",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
package/src/mcp/server.ts CHANGED
@@ -90,6 +90,50 @@ class CodeBakersServer {
90
90
  this.checkAndAutoUpdate().catch(() => {
91
91
  // Silently ignore errors - don't interrupt user
92
92
  });
93
+
94
+ // Check for CLI version updates (non-blocking)
95
+ this.checkCliVersion().catch(() => {
96
+ // Silently ignore errors
97
+ });
98
+ }
99
+
100
+ /**
101
+ * Check if a newer CLI version is available and notify user
102
+ */
103
+ private async checkCliVersion(): Promise<void> {
104
+ try {
105
+ const currentVersion = getCliVersion();
106
+
107
+ // Fetch latest version from npm
108
+ const response = await fetch('https://registry.npmjs.org/@codebakers/cli/latest', {
109
+ headers: { 'Accept': 'application/json' },
110
+ });
111
+
112
+ if (!response.ok) return;
113
+
114
+ const data = await response.json();
115
+ const latestVersion = data.version;
116
+
117
+ if (latestVersion && latestVersion !== currentVersion) {
118
+ // Compare versions (simple comparison - assumes semver)
119
+ const current = currentVersion.split('.').map(Number);
120
+ const latest = latestVersion.split('.').map(Number);
121
+
122
+ const isNewer = latest[0] > current[0] ||
123
+ (latest[0] === current[0] && latest[1] > current[1]) ||
124
+ (latest[0] === current[0] && latest[1] === current[1] && latest[2] > current[2]);
125
+
126
+ if (isNewer) {
127
+ console.error(`\n╔════════════════════════════════════════════════════════════╗`);
128
+ console.error(`║ 🆕 CodeBakers CLI Update Available: v${currentVersion} → v${latestVersion.padEnd(10)}║`);
129
+ console.error(`║ ║`);
130
+ console.error(`║ Restart Cursor/Claude Code to get the latest features! ║`);
131
+ console.error(`╚════════════════════════════════════════════════════════════╝\n`);
132
+ }
133
+ }
134
+ } catch {
135
+ // Silently ignore - don't interrupt user experience
136
+ }
93
137
  }
94
138
 
95
139
  /**