snow-flow 4.6.7 → 4.6.8

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 +63 -0
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -73,6 +73,67 @@ program
73
73
  (0, auth_js_1.registerAuthCommands)(program);
74
74
  // Register session inspection commands
75
75
  (0, session_js_1.registerSessionCommands)(program);
76
+ // Claude Code version management - ensure 1.0.95 is installed
77
+ async function ensureClaudeCodeVersion() {
78
+ try {
79
+ cliLogger.info('🔧 Checking Claude Code version compatibility...');
80
+ // Check if Claude Code is installed and get version
81
+ const { execSync } = await Promise.resolve().then(() => __importStar(require('child_process')));
82
+ const checkVersionResult = execSync('claude --version 2>/dev/null || echo "not_installed"', {
83
+ encoding: 'utf8',
84
+ timeout: 10000
85
+ }).trim();
86
+ const currentVersion = checkVersionResult.includes('not_installed') ? null :
87
+ checkVersionResult.match(/(\d+\.\d+\.\d+)/)?.[1];
88
+ cliLogger.info(`🔍 Current Claude Code version: ${currentVersion || 'not installed'}`);
89
+ // Target version that works correctly
90
+ const targetVersion = '1.0.95';
91
+ if (currentVersion !== targetVersion) {
92
+ cliLogger.info(`⚠️ Version mismatch detected. Installing Claude Code ${targetVersion}...`);
93
+ cliLogger.info('📥 This prevents bugs in newer versions that cause hanging operations');
94
+ try {
95
+ // Install the specific version
96
+ cliLogger.info('🔄 Running: npm install -g @anthropic-ai/claude-code@1.0.95');
97
+ execSync('npm install -g @anthropic-ai/claude-code@1.0.95', {
98
+ stdio: 'inherit',
99
+ timeout: 120000 // 2 minutes timeout
100
+ });
101
+ // Verify installation
102
+ const verifyResult = execSync('claude --version', {
103
+ encoding: 'utf8',
104
+ timeout: 10000
105
+ }).trim();
106
+ const installedVersion = verifyResult.match(/(\d+\.\d+\.\d+)/)?.[1];
107
+ if (installedVersion === targetVersion) {
108
+ cliLogger.info(`✅ Claude Code ${targetVersion} installed successfully!`);
109
+ }
110
+ else {
111
+ cliLogger.warn(`⚠️ Installation completed but version verification shows: ${installedVersion}`);
112
+ }
113
+ }
114
+ catch (installError) {
115
+ cliLogger.error('❌ Failed to install Claude Code 1.0.95');
116
+ cliLogger.error('Please install manually: npm install -g @anthropic-ai/claude-code@1.0.95');
117
+ throw new Error(`Claude Code installation failed: ${installError.message}`);
118
+ }
119
+ }
120
+ else {
121
+ cliLogger.info(`✅ Claude Code ${targetVersion} is already installed`);
122
+ }
123
+ cliLogger.info('🚀 Claude Code version check completed successfully');
124
+ }
125
+ catch (error) {
126
+ cliLogger.error('❌ Claude Code version check failed:', error.message);
127
+ // Provide fallback guidance
128
+ cliLogger.info('');
129
+ cliLogger.info('🔧 Manual installation instructions:');
130
+ cliLogger.info(' npm install -g @anthropic-ai/claude-code@1.0.95');
131
+ cliLogger.info('');
132
+ cliLogger.info('⚠️ Note: Version 1.0.95 is required to avoid hanging operations in swarm mode');
133
+ // Don't fail completely, but warn user
134
+ cliLogger.warn('⚠️ Continuing with potentially incompatible Claude Code version');
135
+ }
136
+ }
76
137
  // Flow deprecation handler - check for flow-related commands
77
138
  function checkFlowDeprecation(command, objective) {
78
139
  const flowKeywords = ['flow', 'create-flow', 'xml-flow', 'flow-designer'];
@@ -156,6 +217,8 @@ program
156
217
  .action(async (objective, options) => {
157
218
  // Check for flow deprecation first
158
219
  checkFlowDeprecation('swarm', objective);
220
+ // Ensure Claude Code version 1.0.95 is installed before proceeding
221
+ await ensureClaudeCodeVersion();
159
222
  // Set debug levels based on options
160
223
  if (options.debugAll) {
161
224
  process.env.DEBUG = '*';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "4.6.7",
4
- "description": "CLEAN SOURCE REPOSITORY - v4.6.7 removes all built dist/ files from git for proper source code transparency. Only TypeScript source code tracked in git, dist/ built during NPM publish via prepublishOnly. Maintains bulletproof MCP persistence features.",
3
+ "version": "4.6.8",
4
+ "description": "RESTORED CLAUDE CODE VERSION PINNING - v4.6.8 restores automatic Claude Code 1.0.95 installation to swarm command that was lost during refactoring. Now properly integrated in TypeScript source with bulletproof MCP persistence and clean repository structure.",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",
7
7
  "bin": {