🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
fix: ensure proper binary builds for alpha releases (#191)
rUva7d99b86d346
diff --git a/issue-191-response.md b/issue-191-response.mdnew file mode 100644index 0000000000..83bdacce20--- /dev/null+++ b/issue-191-response.md@@ -0,0 +1,47 @@+# Response to Issue #191++Thank you @lontivero for the excellent bug report! You've identified an important issue with our alpha release process.++## Root Cause Identified++You're absolutely correct - the `build:binary` script wasn't being run before publishing alpha versions. I found the issue in our `package.json`:++```json+"prepublishOnly": "echo 'Alpha release - skipping build/test/lint for now'"+```++This was causing:+1. The binary in `bin/claude-flow` to remain at the old version (alpha.27)+2. The VERSION variable in the shell script to not get updated+3. All subsequent alpha releases (28-37) to ship with the stale binary++## Fix Applied++I've already corrected the version in `bin/claude-flow` for alpha.37:+```bash+VERSION="2.0.0-alpha.37"+```++## Next Steps++For the next alpha release (alpha.38), we'll:++1. **Fix the build process** - Update `prepublishOnly` to properly build binaries:+ ```json+ "prepublishOnly": "npm run build"+ ```++2. **Automate version updates** - Create a script to automatically update the VERSION in the shell script during build++3. **Add version validation** - Add a pre-publish check to ensure the binary version matches package.json++## Workaround for Current Users++Until alpha.38 is released, users can use the JavaScript entry point directly:+```bash+npx claude-flow@alpha --version # This will show the correct version+```++Thanks again for the detailed reproduction steps - they made it easy to identify and fix the issue! 🙏++The fix will be included in alpha.38, which we'll publish shortly.\ No newline at end of filediff --git a/package.json b/package.jsonindex 1f48f5945e..48c941c1f2 100644--- a/package.json+++ b/package.json@@ -8,7 +8,8 @@},"scripts": {"dev": "tsx src/cli/main.ts",- "build": "npm run clean && npm run build:esm && npm run build:cjs && npm run build:binary",+ "build": "npm run clean && npm run update-version && npm run build:esm && npm run build:cjs && npm run build:binary",+ "update-version": "node scripts/update-bin-version.js","clean": "rm -rf dist dist-cjs","build:esm": "tsc","build:cjs": "tsc -p tsconfig.cjs.json",@@ -45,7 +46,7 @@"diagnostics": "node -e \"import('./dist/monitoring/diagnostics.js').then(m => m.DiagnosticManager.quickDiagnostic().then(console.log))\"","health-check": "node -e \"import('./dist/monitoring/health-check.js').then(m => new m.HealthCheckManager().performHealthCheck().then(console.log))\"","postinstall": "node scripts/install.js",- "prepublishOnly": "echo 'Alpha release - skipping build/test/lint for now'",+ "prepublishOnly": "npm run build","publish:alpha": "npm publish --tag alpha","publish:major": "npm version major && npm publish","publish:minor": "npm version minor && npm publish",diff --git a/scripts/update-bin-version.js b/scripts/update-bin-version.jsnew file mode 100644index 0000000000..56637fd695--- /dev/null+++ b/scripts/update-bin-version.js@@ -0,0 +1,32 @@+#!/usr/bin/env node++/**+ * Updates the VERSION in bin/claude-flow shell script to match package.json+ */++import fs from 'fs';+import path from 'path';+import { fileURLToPath } from 'url';++const __filename = fileURLToPath(import.meta.url);+const __dirname = path.dirname(__filename);++// Read package.json+const packagePath = path.join(__dirname, '..', 'package.json');+const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8'));+const version = packageJson.version;++// Read bin/claude-flow+const binPath = path.join(__dirname, '..', 'bin', 'claude-flow');+let binContent = fs.readFileSync(binPath, 'utf8');++// Update VERSION line+binContent = binContent.replace(+ /^VERSION=".*"$/m,+ `VERSION="${version}"`+);++// Write back+fs.writeFileSync(binPath, binContent);++console.log(`✅ Updated bin/claude-flow VERSION to ${version}`);\ No newline at end of file