snow-flow 4.6.0 → 4.6.1

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 (2) hide show
  1. package/dist/cli.js +74 -0
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -93,6 +93,76 @@ function checkFlowDeprecation(command, objective) {
93
93
  process.exit(1);
94
94
  }
95
95
  }
96
+
97
+ // Claude Code version management - ensure 1.0.95 is installed
98
+ async function ensureClaudeCodeVersion() {
99
+ try {
100
+ cliLogger.info('🔧 Checking Claude Code version compatibility...');
101
+
102
+ // Check if Claude Code is installed and get version
103
+ const checkVersionResult = (0, child_process_1.execSync)('claude --version 2>/dev/null || echo "not_installed"', {
104
+ encoding: 'utf8',
105
+ timeout: 10000
106
+ }).trim();
107
+
108
+ const currentVersion = checkVersionResult.includes('not_installed') ? null :
109
+ checkVersionResult.match(/(\d+\.\d+\.\d+)/)?.[1];
110
+
111
+ cliLogger.info(`🔍 Current Claude Code version: ${currentVersion || 'not installed'}`);
112
+
113
+ // Target version that works correctly
114
+ const targetVersion = '1.0.95';
115
+
116
+ if (currentVersion !== targetVersion) {
117
+ cliLogger.info(`⚠️ Version mismatch detected. Installing Claude Code ${targetVersion}...`);
118
+ cliLogger.info('📥 This prevents bugs in newer versions that cause hanging operations');
119
+
120
+ try {
121
+ // Install the specific version
122
+ cliLogger.info('🔄 Running: npm install -g @anthropic-ai/claude-code@1.0.95');
123
+ (0, child_process_1.execSync)('npm install -g @anthropic-ai/claude-code@1.0.95', {
124
+ stdio: 'inherit',
125
+ timeout: 120000 // 2 minutes timeout
126
+ });
127
+
128
+ // Verify installation
129
+ const verifyResult = (0, child_process_1.execSync)('claude --version', {
130
+ encoding: 'utf8',
131
+ timeout: 10000
132
+ }).trim();
133
+
134
+ const installedVersion = verifyResult.match(/(\d+\.\d+\.\d+)/)?.[1];
135
+
136
+ if (installedVersion === targetVersion) {
137
+ cliLogger.info(`✅ Claude Code ${targetVersion} installed successfully!`);
138
+ } else {
139
+ cliLogger.warn(`⚠️ Installation completed but version verification shows: ${installedVersion}`);
140
+ }
141
+ } catch (installError) {
142
+ cliLogger.error('❌ Failed to install Claude Code 1.0.95');
143
+ cliLogger.error('Please install manually: npm install -g @anthropic-ai/claude-code@1.0.95');
144
+ throw new Error(`Claude Code installation failed: ${installError.message}`);
145
+ }
146
+ } else {
147
+ cliLogger.info(`✅ Claude Code ${targetVersion} is already installed`);
148
+ }
149
+
150
+ cliLogger.info('🚀 Claude Code version check completed successfully');
151
+
152
+ } catch (error) {
153
+ cliLogger.error('❌ Claude Code version check failed:', error.message);
154
+
155
+ // Provide fallback guidance
156
+ cliLogger.info('');
157
+ cliLogger.info('🔧 Manual installation instructions:');
158
+ cliLogger.info(' npm install -g @anthropic-ai/claude-code@1.0.95');
159
+ cliLogger.info('');
160
+ cliLogger.info('⚠️ Note: Version 1.0.95 is required to avoid hanging operations in swarm mode');
161
+
162
+ // Don't fail completely, but warn user
163
+ cliLogger.warn('⚠️ Continuing with potentially incompatible Claude Code version');
164
+ }
165
+ }
96
166
  // Swarm command - the main orchestration command with EVERYTHING
97
167
  program
98
168
  .command('swarm <objective>')
@@ -152,6 +222,10 @@ program
152
222
  .action(async (objective, options) => {
153
223
  // Check for flow deprecation first
154
224
  checkFlowDeprecation('swarm', objective);
225
+
226
+ // Ensure Claude Code version 1.0.95 is installed before proceeding
227
+ await ensureClaudeCodeVersion();
228
+
155
229
  // Set debug levels based on options
156
230
  if (options.debugAll) {
157
231
  process.env.DEBUG = '*';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "4.6.0",
4
- "description": "Conversational ServiceNow development platform using Claude Code. Multi-agent orchestration with 20+ MCP servers providing 245+ ServiceNow tools including complete UX + Agent Workspace creation with official APIs.",
3
+ "version": "4.6.1",
4
+ "description": "CLAUDE CODE VERSION PINNING - v4.6.1 adds automatic Claude Code 1.0.95 installation to swarm command. Prevents hanging operations caused by bugs in newer versions. Ensures reliable swarm execution with version check, auto-install, and verification.",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",
7
7
  "bin": {