From fea1a162c9c193ab75bd8fb0fc560f2e371bba86 Mon Sep 17 00:00:00 2001 From: rUv Date: Sun, 20 Jul 2025 15:39:01 +0000 Subject: [PATCH] chore: Prepare alpha.65 release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated version to 2.0.0-alpha.65 - Fixed database schema issue (#403) - Updated CHANGELOG with release notes - Fixed critical TypeScript build errors 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CHANGELOG.md | 18 ++++++++ bin/claude-flow | 2 +- package.json | 2 +- src/cli/commands/hive-mind/pause.ts | 11 +++-- src/cli/commands/hive-mind/ps.ts | 8 ++-- src/cli/commands/hive-mind/resume.ts | 7 +-- src/cli/commands/hive-mind/stop.ts | 2 +- src/cli/help-text.js | 2 +- src/cli/repl.ts | 66 ++++++++++++++++++--------- src/cli/simple-cli.js | 2 +- src/cli/simple-cli.ts | 21 +++++---- src/cli/simple-orchestrator.ts | 3 +- src/cli/ui/compatible-ui.ts | 2 +- src/cli/ui/index.ts | 6 ++- src/cli/utils/environment-detector.ts | 4 +- src/core/logger.ts | 5 ++ 16 files changed, 106 insertions(+), 55 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f80a3a903..3a104c2b2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.0-alpha.65] - 2025-01-20 + +### 🔧 Bug Fixes +- **CRITICAL**: Fixed "table agents has no column named role" error in hive-mind wizard (#403) +- Added missing `role` column to agents table schema in init/index.js +- Fixed TypeScript build errors preventing compilation +- Resolved ILogger interface issues and async/await problems +- Fixed missing type definitions in multiple modules + +### 🏗️ Infrastructure +- **Database Schema**: Synchronized agents table schema across all modules +- **Build System**: Fixed critical TypeScript compilation errors +- **Type Safety**: Added proper type annotations throughout codebase + +### 📚 Documentation +- Added migration instructions for existing databases +- Updated test suite with schema validation tests + ## [2.0.0-alpha.64] - 2025-01-18 ### 🔧 Bug Fixes diff --git a/bin/claude-flow b/bin/claude-flow index f0592a612d..ba97a73717 100755 --- a/bin/claude-flow +++ b/bin/claude-flow @@ -1,7 +1,7 @@ #!/bin/sh # Claude-Flow Smart Dispatcher - Detects and uses the best available runtime -VERSION="2.0.0-alpha.64" +VERSION="2.0.0-alpha.65" # Determine the correct path based on how the script is invoked if [ -L "$0" ]; then diff --git a/package.json b/package.json index 27748e709a..f155caf769 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "claude-flow", - "version": "2.0.0-alpha.64", + "version": "2.0.0-alpha.65", "description": "Enterprise-grade AI agent orchestration with ruv-swarm integration (Alpha Release)", "main": "cli.mjs", "bin": { diff --git a/src/cli/commands/hive-mind/pause.ts b/src/cli/commands/hive-mind/pause.ts index 310394345b..0ebc10c65f 100644 --- a/src/cli/commands/hive-mind/pause.ts +++ b/src/cli/commands/hive-mind/pause.ts @@ -40,7 +40,7 @@ export const pauseCommand = new Command('pause') } console.log(chalk.cyan(`Pausing session ${sessionId}...`)); - const result = sessionManager.pauseSession(sessionId); + const result = await sessionManager.pauseSession(sessionId); if (result) { console.log(chalk.green(`✓ Session ${sessionId} paused successfully`)); @@ -50,9 +50,10 @@ export const pauseCommand = new Command('pause') } } else { // Interactive selection - const sessions = sessionManager.getActiveSessions().filter((s) => s.status === 'active'); + const sessions = await sessionManager.getActiveSessions(); + const activeSessions = sessions.filter((s: any) => s.status === 'active'); - if (sessions.length === 0) { + if (activeSessions.length === 0) { console.log(chalk.yellow('No active sessions found to pause')); return; } @@ -62,7 +63,7 @@ export const pauseCommand = new Command('pause') type: 'list', name: 'sessionId', message: 'Select session to pause:', - choices: sessions.map((s) => ({ + choices: activeSessions.map((s: any) => ({ name: `${s.swarm_name} (${s.id}) - ${s.completion_percentage}% complete`, value: s.id, })), @@ -70,7 +71,7 @@ export const pauseCommand = new Command('pause') ]); console.log(chalk.cyan(`Pausing session ${sessionId}...`)); - const result = sessionManager.pauseSession(sessionId); + const result = await sessionManager.pauseSession(sessionId); if (result) { console.log(chalk.green(`✓ Session paused successfully`)); diff --git a/src/cli/commands/hive-mind/ps.ts b/src/cli/commands/hive-mind/ps.ts index e059df87e6..28e46d2f71 100644 --- a/src/cli/commands/hive-mind/ps.ts +++ b/src/cli/commands/hive-mind/ps.ts @@ -22,7 +22,7 @@ export const psCommand = new Command('ps') ? sessionManager.getActiveSessionsWithProcessInfo() : sessionManager .getActiveSessionsWithProcessInfo() - .filter((s) => s.status === 'active' || s.status === 'paused'); + .filter((s: any) => s.status === 'active' || s.status === 'paused'); if (sessions.length === 0) { console.log(chalk.yellow('No sessions found')); @@ -108,9 +108,9 @@ export const psCommand = new Command('ps') } // Summary - const activeSessions = sessions.filter((s) => s.status === 'active').length; - const pausedSessions = sessions.filter((s) => s.status === 'paused').length; - const totalProcesses = sessions.reduce((sum, s) => sum + s.total_processes, 0); + const activeSessions = sessions.filter((s: any) => s.status === 'active').length; + const pausedSessions = sessions.filter((s: any) => s.status === 'paused').length; + const totalProcesses = sessions.reduce((sum: any, s: any) => sum + s.total_processes, 0); console.log('\n' + chalk.bold('Summary:')); console.log(chalk.gray(` Active sessions: ${activeSessions}`)); diff --git a/src/cli/commands/hive-mind/resume.ts b/src/cli/commands/hive-mind/resume.ts index 200a777e74..22532680bb 100644 --- a/src/cli/commands/hive-mind/resume.ts +++ b/src/cli/commands/hive-mind/resume.ts @@ -30,9 +30,10 @@ export const resumeCommand = new Command('resume') console.log(chalk.gray(`Progress: ${session.statistics.completionPercentage}%`)); } else { // Interactive selection - const sessions = sessionManager.getActiveSessions().filter((s) => s.status === 'paused'); + const sessions = await sessionManager.getActiveSessions(); + const pausedSessions = sessions.filter((s: any) => s.status === 'paused'); - if (sessions.length === 0) { + if (pausedSessions.length === 0) { console.log(chalk.yellow('No paused sessions found to resume')); return; } @@ -42,7 +43,7 @@ export const resumeCommand = new Command('resume') type: 'list', name: 'sessionId', message: 'Select session to resume:', - choices: sessions.map((s) => ({ + choices: pausedSessions.map((s: any) => ({ name: `${s.swarm_name} (${s.id}) - ${s.completion_percentage}% complete`, value: s.id, })), diff --git a/src/cli/commands/hive-mind/stop.ts b/src/cli/commands/hive-mind/stop.ts index bc6361bfda..cc2853ffca 100644 --- a/src/cli/commands/hive-mind/stop.ts +++ b/src/cli/commands/hive-mind/stop.ts @@ -99,7 +99,7 @@ export const stopCommand = new Command('stop') type: 'list', name: 'sessionId', message: 'Select session to stop:', - choices: sessions.map((s) => ({ + choices: sessions.map((s: any) => ({ name: `${s.swarm_name} (${s.id}) - ${s.total_processes} process(es)`, value: s.id, })), diff --git a/src/cli/help-text.js b/src/cli/help-text.js index 382d4e5eb6..63ee10678a 100644 --- a/src/cli/help-text.js +++ b/src/cli/help-text.js @@ -5,7 +5,7 @@ import { HelpFormatter } from './help-formatter.js'; -export const VERSION = '2.0.0-alpha.64'; +export const VERSION = '2.0.0-alpha.65'; export const MAIN_HELP = ` 🌊 Claude-Flow v${VERSION} - Enterprise-Grade AI Agent Orchestration Platform diff --git a/src/cli/repl.ts b/src/cli/repl.ts index fd4fdc83c8..58dcc59a46 100644 --- a/src/cli/repl.ts +++ b/src/cli/repl.ts @@ -378,11 +378,15 @@ export async function startREPL(options: any = {}): Promise { // Main REPL loop while (true) { try { - const prompt = createPrompt(context); - const input = await prompt.prompt({ - message: prompt, - suggestions: (input: string) => completer.complete(input), - }); + const promptString = createPrompt(context); + const { input } = await inquirer.prompt([ + { + type: 'input', + name: 'input', + message: promptString, + transformer: (input: string) => input, + }, + ]); if (!input.trim()) { continue; @@ -682,10 +686,14 @@ async function handleAgentSpawn(args: string[]): Promise { const type = args[0]; const name = args[1] || - (await prompt.prompt({ - message: 'Agent name:', - default: `${type}-agent`, - })); + (await inquirer.prompt([ + { + type: 'input', + name: 'name', + message: 'Agent name:', + default: `${type}-agent`, + }, + ])).name; console.log(chalk.yellow('Spawning agent...')); @@ -849,10 +857,14 @@ async function showTaskStatus(taskId: string): Promise { } async function handleTaskCancel(taskId: string): Promise { - const confirmed = await confirm.prompt({ - message: `Cancel task ${taskId}?`, - default: false, - }); + const { confirmed } = await inquirer.prompt([ + { + type: 'confirm', + name: 'confirmed', + message: `Cancel task ${taskId}?`, + default: false, + }, + ]); if (!confirmed) { console.log(chalk.gray('Cancellation cancelled')); @@ -957,10 +969,14 @@ async function handleSessionSave(args: string[]): Promise { const name = args.length > 0 ? args.join(' ') - : await prompt.prompt({ - message: 'Session name:', - default: `session-${new Date().toISOString().split('T')[0]}`, - }); + : (await inquirer.prompt([ + { + type: 'input', + name: 'name', + message: 'Session name:', + default: `session-${new Date().toISOString().split('T')[0]}`, + }, + ])).name; console.log(chalk.yellow('Saving session...')); await new Promise((resolve) => setTimeout(resolve, 1000)); @@ -972,10 +988,14 @@ async function handleSessionSave(args: string[]): Promise { } async function handleSessionRestore(sessionId: string): Promise { - const confirmed = await confirm.prompt({ - message: `Restore session ${sessionId}?`, - default: false, - }); + const { confirmed } = await inquirer.prompt([ + { + type: 'confirm', + name: 'confirmed', + message: `Restore session ${sessionId}?`, + default: false, + }, + ]); if (!confirmed) { console.log(chalk.gray('Restore cancelled')); @@ -1032,7 +1052,9 @@ async function showWorkflowList(): Promise { console.log(chalk.cyan.bold(`Workflows (${workflows.length})`)); console.log('─'.repeat(50)); - const table = new Table().header(['ID', 'Name', 'Status', 'Progress']).border(true); + const table = new Table({ + head: ['ID', 'Name', 'Status', 'Progress'], + }); for (const workflow of workflows) { const statusIcon = formatStatusIndicator(workflow.status); diff --git a/src/cli/simple-cli.js b/src/cli/simple-cli.js index 7c1b499c43..6d2574f8c0 100644 --- a/src/cli/simple-cli.js +++ b/src/cli/simple-cli.js @@ -27,7 +27,7 @@ import process from 'process'; import readline from 'readline'; import { getMainHelp, getCommandHelp, getStandardizedCommandHelp } from './help-text.js'; -const VERSION = '2.0.0-alpha.64'; +const VERSION = '2.0.0-alpha.65'; function printHelp(plain = false) { console.log(getMainHelp(plain)); diff --git a/src/cli/simple-cli.ts b/src/cli/simple-cli.ts index 1b54d7950b..de01de31ed 100644 --- a/src/cli/simple-cli.ts +++ b/src/cli/simple-cli.ts @@ -232,7 +232,7 @@ async function main() { case 'spawn': // Convenience alias for agent spawn const spawnType = subArgs[0] || 'general'; - const spawnName = flags.name || `agent-${Date.now()}`; + const spawnName = (flags as any).name || `agent-${Date.now()}`; printSuccess(`Spawning ${spawnType} agent: ${spawnName}`); console.log('🤖 Agent would be created with the following configuration:'); @@ -2070,14 +2070,14 @@ async function startRepl() { console.log('Type "help" for available commands, "exit" to quit\n'); const replState = { - history: [], + history: [] as string[], historyIndex: -1, currentSession: null, context: { - agents: [], - tasks: [], - terminals: [], - memory: {}, + agents: [] as any[], + tasks: [] as any[], + terminals: [] as any[], + memory: {} as Record, }, }; @@ -2147,7 +2147,7 @@ Shortcuts: config: async (key: string) => { try { - const config = JSON.parse(await fs.readFile('claude-flow.config.json')); + const config = JSON.parse(await fs.readFile('claude-flow.config.json', 'utf-8')); if (key) { const keys = key.split('.'); let value = config; @@ -2220,8 +2220,8 @@ Shortcuts: const args = parts.slice(1); // Handle built-in REPL commands - if (replCommands[command]) { - await replCommands[command](...args); + if (command in replCommands) { + await (replCommands as any)[command](...args); return true; } @@ -3289,6 +3289,7 @@ For more information about SPARC methodology, see: https://github.com/ruvnet/cla `; } -if (import.meta.main) { +// Run main if executed directly +if (import.meta.url === `file://${process.argv[1]}`) { await main(); } diff --git a/src/cli/simple-orchestrator.ts b/src/cli/simple-orchestrator.ts index 6db26e6552..b1057d520b 100644 --- a/src/cli/simple-orchestrator.ts +++ b/src/cli/simple-orchestrator.ts @@ -476,7 +476,8 @@ function startWebUI(host: string, port: number) { app.post('/api/command', express.json(), (req, res) => { const { command } = req.body; if (!command) { - return res.status(400).json({ error: 'Command is required' }); + res.status(400).json({ error: 'Command is required' }); + return; } // Execute command and return immediately diff --git a/src/cli/ui/compatible-ui.ts b/src/cli/ui/compatible-ui.ts index f3338dd434..9cb247147d 100644 --- a/src/cli/ui/compatible-ui.ts +++ b/src/cli/ui/compatible-ui.ts @@ -90,7 +90,7 @@ export class CompatibleUI { case 'h': case 'help': case '?': - this.outputHelp(); + this.showHelp(); break; case 's': diff --git a/src/cli/ui/index.ts b/src/cli/ui/index.ts index 00eee464b5..2cef2086a7 100644 --- a/src/cli/ui/index.ts +++ b/src/cli/ui/index.ts @@ -24,7 +24,9 @@ export { * Main UI launcher that automatically selects the best available UI */ export async function launchBestUI(): Promise { - const { checkUISupport, launchUI, handleRawModeError } = await import('./fallback-handler.js'); + const fallbackHandler = await import('./fallback-handler.js'); + const { checkUISupport, handleRawModeError } = fallbackHandler; + const launchUI = (fallbackHandler as any).launchUI; const support = checkUISupport(); if (support.supported) { @@ -40,7 +42,7 @@ export async function launchBestUI(): Promise { } } } else { - const { launchUI: launchCompatibleUI } = await import('./compatible-ui.ts'); + const { launchUI: launchCompatibleUI } = await import('./compatible-ui.js'); console.log('🔄 Using compatible UI mode for this environment'); await launchCompatibleUI(); } diff --git a/src/cli/utils/environment-detector.ts b/src/cli/utils/environment-detector.ts index b72bbcdfa8..95217a8b71 100644 --- a/src/cli/utils/environment-detector.ts +++ b/src/cli/utils/environment-detector.ts @@ -223,10 +223,10 @@ function showEnvironmentWarnings(env: ExecutionEnvironment): void { export function applySmartDefaults>( options: T, env?: ExecutionEnvironment, -): T & { appliedDefaults: string[] } { +): T & { appliedDefaults: string[]; skipPermissions?: boolean; dangerouslySkipPermissions?: boolean; nonInteractive?: boolean; json?: boolean; noColor?: boolean; } { const environment = env || detectExecutionEnvironment({ skipWarnings: true }); const appliedDefaults: string[] = []; - const enhanced = { ...options, appliedDefaults }; + const enhanced = { ...options, appliedDefaults } as T & { appliedDefaults: string[]; skipPermissions?: boolean; dangerouslySkipPermissions?: boolean; nonInteractive?: boolean; json?: boolean; noColor?: boolean; }; // Apply defaults based on environment if ( diff --git a/src/core/logger.ts b/src/core/logger.ts index 33e2f246bf..25ef674d07 100644 --- a/src/core/logger.ts +++ b/src/core/logger.ts @@ -15,6 +15,7 @@ export interface ILogger { warn(message: string, meta?: unknown): void; error(message: string, error?: unknown): void; configure(config: LoggingConfig): Promise; + level?: string; } export enum LogLevel { @@ -45,6 +46,10 @@ export class Logger implements ILogger { private currentFileIndex = 0; private isClosing = false; + get level(): string { + return this.config.level; + } + constructor( config: LoggingConfig = { level: 'info',