Files
ruflo/v2/scripts/install-arm64.js
T
rUvandClaude Opus 4.5 1b6a1971f7 feat(v3): add comprehensive v3 implementation plans and swarm architecture
- Reorganize v3/ into implementation/ subfolders:
  - planning/, architecture/, migration/, integration/
  - security/, adrs/, research/, swarm-plans/

- Add 15-agent concurrent swarm implementation plans:
  - SWARM-OVERVIEW.md: Hierarchical mesh topology, 4 phases
  - AGENT-SPECIFICATIONS.md: 15 agent configs with capabilities
  - TDD-LONDON-SCHOOL-PLAN.md: Mock-first TDD methodology
  - BENCHMARK-OPTIMIZATION.md: Performance targets (2.49x-7.47x)
  - DEPLOYMENT-PLAN.md: Release strategy, CI/CD, rollback
  - GITHUB-ISSUE-TRACKING.md: Issue workflow with agent replies

- Update .claude/settings.json with proper hooks format
- Add bash aliases for claude --dangerously-skip-permissions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 15:40:51 +00:00

83 lines
2.4 KiB
JavaScript

#!/usr/bin/env node
import os from 'node:os';
import { spawn } from 'node:child_process';
// Check if SQLite bindings are working
async function checkSqliteBindings() {
try {
const Database = await import('better-sqlite3');
const db = new Database.default(':memory:');
db.close();
return true;
} catch (error) {
// Silently fail - this is expected when better-sqlite3 doesn't compile
return false;
}
}
// Attempt to rebuild better-sqlite3 for ARM64
async function rebuildSqlite() {
console.log('🔧 Rebuilding better-sqlite3 for ARM64...');
return new Promise((resolve) => {
const rebuild = spawn('npm', ['rebuild', 'better-sqlite3'], {
stdio: 'inherit',
shell: true
});
rebuild.on('close', (code) => {
if (code === 0) {
console.log('✅ Successfully rebuilt better-sqlite3 for ARM64');
resolve(true);
} else {
console.log('⚠️ Failed to rebuild better-sqlite3');
resolve(false);
}
});
rebuild.on('error', () => {
console.log('⚠️ Failed to rebuild better-sqlite3');
resolve(false);
});
});
}
// Main installation logic
async function main() {
const platform = os.platform();
const arch = os.arch();
// Only run on ARM64 macOS
if (platform === 'darwin' && arch === 'arm64') {
console.log('🍎 Detected Apple Silicon (ARM64) Mac');
const bindingsWork = await checkSqliteBindings();
if (!bindingsWork) {
console.log('⚠️ SQLite bindings not working for ARM64');
const rebuildSuccess = await rebuildSqlite();
if (!rebuildSuccess) {
console.log('');
console.log('⚠️ Unable to rebuild SQLite bindings for ARM64');
console.log('📝 Claude-Flow will fall back to in-memory storage');
console.log('');
console.log('To fix this issue, you can try:');
console.log('1. Install Xcode Command Line Tools: xcode-select --install');
console.log('2. Manually rebuild: cd node_modules/better-sqlite3 && npm run build-release');
console.log('3. Use Rosetta 2: arch -x86_64 npm install');
console.log('');
}
} else {
console.log('✅ SQLite bindings are working correctly');
}
}
}
// Run the installation enhancement
// Exit with 0 even if there are errors - this is a best-effort script
main().catch(() => {
// Silently ignore errors - better-sqlite3 is optional
process.exit(0);
});