@maestroai/cli 0.1.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/commands/init.ts","../src/utils/claude-check.ts","../src/commands/start.ts","../src/logging/file-logger.ts","../src/commands/status.ts","../src/commands/stop.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { registerInitCommand } from './commands/init.js';\nimport { registerStartCommand } from './commands/start.js';\nimport { registerStatusCommand } from './commands/status.js';\nimport { registerStopCommand } from './commands/stop.js';\n\nexport function createProgram(): Command {\n const program = new Command();\n\n program\n .name('maestro')\n .description('Orchestrate multiple Claude Code agents working as a team')\n .version('0.1.0');\n\n registerInitCommand(program);\n registerStartCommand(program);\n registerStatusCommand(program);\n registerStopCommand(program);\n\n return program;\n}\n","import { Command } from 'commander';\nimport * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as readline from 'node:readline';\nimport chalk from 'chalk';\nimport figures from 'figures';\nimport {\n Planner,\n TaskParser,\n TaskWriter,\n generateTaskId,\n resetTaskCounter,\n getDefaultSystemPrompt,\n type Task,\n type PlannedTask,\n} from '@maestroai/core';\nimport type { AgentRole } from '@maestroai/core';\nimport { checkClaudeInstalled, getClaudeInstallInstructions } from '../utils/claude-check.js';\n\nfunction ask(rl: readline.Interface, question: string, defaultValue?: string): Promise<string> {\n const suffix = defaultValue ? ` (${defaultValue})` : '';\n return new Promise((resolve) => {\n rl.question(`${question}${suffix}: `, (answer) => {\n resolve(answer.trim() || defaultValue || '');\n });\n });\n}\n\ninterface DetectedProject {\n type: string;\n techStack: { frontend?: string; uiLibrary?: string; backend?: string; database?: string };\n hasExistingCode: boolean;\n configFiles: string[];\n}\n\nfunction detectExistingProject(dir: string): DetectedProject {\n const result: DetectedProject = {\n type: 'unknown',\n techStack: {},\n hasExistingCode: false,\n configFiles: [],\n };\n\n // Check for package.json (Node.js)\n const pkgJsonPath = path.resolve(dir, 'package.json');\n if (fs.existsSync(pkgJsonPath)) {\n result.hasExistingCode = true;\n result.configFiles.push('package.json');\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8'));\n const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };\n\n if (allDeps['next']) result.techStack.frontend = 'next.js';\n else if (allDeps['react']) result.techStack.frontend = 'react';\n else if (allDeps['vue']) result.techStack.frontend = 'vue';\n else if (allDeps['svelte']) result.techStack.frontend = 'svelte';\n else if (allDeps['angular']) result.techStack.frontend = 'angular';\n\n if (allDeps['@shadcn/ui'] || allDeps['shadcn-ui'] || allDeps['shadcn']) result.techStack.uiLibrary = 'shadcn';\n else if (allDeps['tailwindcss']) result.techStack.uiLibrary = 'tailwind';\n else if (allDeps['@mui/material']) result.techStack.uiLibrary = 'material-ui';\n\n if (allDeps['express']) result.techStack.backend = 'node/express';\n else if (allDeps['fastify']) result.techStack.backend = 'node/fastify';\n else if (allDeps['hono']) result.techStack.backend = 'node/hono';\n\n result.type = 'node';\n } catch { /* ignore parse errors */ }\n }\n\n // Check for tsconfig.json\n if (fs.existsSync(path.resolve(dir, 'tsconfig.json'))) {\n result.hasExistingCode = true;\n result.configFiles.push('tsconfig.json');\n }\n\n // Check for pyproject.toml (Python)\n if (fs.existsSync(path.resolve(dir, 'pyproject.toml'))) {\n result.hasExistingCode = true;\n result.configFiles.push('pyproject.toml');\n result.type = 'python';\n }\n\n // Check for requirements.txt (Python)\n if (fs.existsSync(path.resolve(dir, 'requirements.txt'))) {\n result.hasExistingCode = true;\n result.configFiles.push('requirements.txt');\n if (result.type === 'unknown') result.type = 'python';\n }\n\n // Check for go.mod (Go)\n if (fs.existsSync(path.resolve(dir, 'go.mod'))) {\n result.hasExistingCode = true;\n result.configFiles.push('go.mod');\n result.type = 'go';\n }\n\n // Check for Cargo.toml (Rust)\n if (fs.existsSync(path.resolve(dir, 'Cargo.toml'))) {\n result.hasExistingCode = true;\n result.configFiles.push('Cargo.toml');\n result.type = 'rust';\n }\n\n return result;\n}\n\nfunction plannedToTask(planned: PlannedTask): Task {\n const now = new Date().toISOString();\n return {\n id: generateTaskId(),\n title: planned.title,\n description: planned.description,\n status: 'pending',\n priority: planned.priority,\n assignee: null,\n dependencies: planned.dependencies,\n tags: planned.tags,\n createdAt: now,\n updatedAt: now,\n completedAt: null,\n notes: [],\n };\n}\n\nexport function registerInitCommand(program: Command): void {\n program\n .command('init')\n .description('Initialize a new Maestro project')\n .option('--no-plan', 'skip automatic task planning (create empty todo.md)')\n .option('--model <model>', 'model to use for planning', 'sonnet')\n .option('-d, --dir <path>', 'working directory for project context', '.')\n .option('-i, --instructions <path>', 'path to an instructions/requirements file for the planner')\n .action(async (options: { plan: boolean; model: string; dir: string; instructions?: string }) => {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n try {\n console.log();\n console.log(chalk.bold(' MAESTRO') + ' - Project Initialization');\n console.log();\n\n // Check for Claude CLI installation first\n const claudeCheck = checkClaudeInstalled();\n if (!claudeCheck.installed) {\n console.log(chalk.red(` ${figures.cross} Claude CLI is not installed`));\n console.log();\n console.log(chalk.yellow(' Maestro requires Claude CLI to orchestrate agents.'));\n console.log();\n console.log(chalk.bold(' Installation Instructions:'));\n console.log(chalk.dim(getClaudeInstallInstructions()));\n console.log();\n\n const proceed = await ask(rl, chalk.yellow(' Continue anyway? (not recommended) (y/n)'), 'n');\n if (proceed.toLowerCase() !== 'y') {\n console.log();\n console.log(chalk.dim(' Initialization cancelled. Install Claude CLI and try again.'));\n rl.close();\n process.exit(0);\n }\n console.log();\n } else {\n console.log(chalk.green(` ${figures.tick} Claude CLI detected`));\n if (claudeCheck.version) {\n console.log(chalk.dim(` Version: ${claudeCheck.version}`));\n }\n console.log();\n }\n\n // Resolve target directory and change to it\n const targetDir = path.resolve(options.dir);\n if (targetDir !== process.cwd()) {\n fs.mkdirSync(targetDir, { recursive: true });\n process.chdir(targetDir);\n console.log(chalk.dim(` Changed to directory: ${targetDir}`));\n console.log();\n }\n\n // Detect existing project\n const detected = detectExistingProject(targetDir);\n if (detected.hasExistingCode) {\n console.log(chalk.cyan(` ${figures.info} Existing ${detected.type} project detected`));\n console.log(chalk.dim(` Found: ${detected.configFiles.join(', ')}`));\n const detectedTech = Object.values(detected.techStack).filter(Boolean);\n if (detectedTech.length > 0) {\n console.log(chalk.dim(` Detected tech: ${detectedTech.join(', ')}`));\n }\n console.log();\n }\n\n // Read instructions file if provided\n let instructionsContent = '';\n if (options.instructions) {\n const instrPath = path.resolve(options.instructions);\n if (!fs.existsSync(instrPath)) {\n console.error(chalk.red(` ${figures.cross} Instructions file not found: ${instrPath}`));\n process.exit(1);\n }\n instructionsContent = fs.readFileSync(instrPath, 'utf-8').trim();\n console.log(chalk.cyan(` ${figures.info} Loaded instructions from ${chalk.bold(options.instructions)} (${instructionsContent.split('\\n').length} lines)`));\n console.log();\n }\n\n const projectName = await ask(rl, ' Project name', path.basename(targetDir));\n\n // Make the description prompt clearer about what we need\n console.log();\n console.log(chalk.dim(' Describe what the agents should work on. This can be:'));\n console.log(chalk.dim(' - A new app to build from scratch'));\n console.log(chalk.dim(' - A feature to add to an existing project'));\n console.log(chalk.dim(' - A bug fix, refactor, or any other work'));\n if (instructionsContent) {\n console.log(chalk.dim(' (Instructions file loaded — leave blank to use it as the primary goal)'));\n }\n\n const description = await ask(rl, ' Goal / Description', instructionsContent ? '' : '');\n const devCountStr = await ask(rl, ' Number of developer agents', '3');\n const devCount = Math.max(1, parseInt(devCountStr, 10) || 3);\n\n console.log();\n console.log(chalk.dim(' Tech Stack (leave blank to skip):'));\n const frontend = await ask(rl, ' Frontend framework (e.g., react, vue, svelte)', detected.techStack.frontend ?? '');\n const uiLibrary = await ask(rl, ' UI library (e.g., shadcn, tailwind, material-ui)', detected.techStack.uiLibrary ?? '');\n const backend = await ask(rl, ' Backend (e.g., node/express, python/fastapi, go)', detected.techStack.backend ?? '');\n const database = await ask(rl, ' Database (e.g., postgres, mongodb, sqlite)', detected.techStack.database ?? '');\n const otherTech = await ask(rl, ' Other tools/frameworks', '');\n\n const techParts: string[] = [];\n if (frontend) techParts.push(`Frontend: ${frontend}`);\n if (uiLibrary) techParts.push(`UI: ${uiLibrary}`);\n if (backend) techParts.push(`Backend: ${backend}`);\n if (database) techParts.push(`Database: ${database}`);\n if (otherTech) techParts.push(`Other: ${otherTech}`);\n\n console.log();\n\n // Create maestro.yaml\n const workingDirValue = '.';\n const configDescription = description || (instructionsContent ? `See instructions file: ${options.instructions}` : 'A Maestro-managed project');\n\n const configContent = `# Maestro Project Configuration\nname: \"${projectName}\"\ndescription: \"${configDescription}\"\nversion: \"1.0.0\"\n\nagents:\n - role: orchestrator\n count: 1\n\n - role: project-manager\n count: 1\n\n - role: architect\n count: 1\n\n - role: developer\n count: ${devCount}\n\n - role: designer\n count: 1\n\n - role: qa-engineer\n count: 1\n\n - role: devops\n count: 1\n\n - role: technical-writer\n count: 1\n\n - role: code-reviewer\n count: 1\n\nsettings:\n workingDirectory: \"${workingDirValue}\"\n todoFile: \"todo.md\"\n messagesDirectory: \".maestro/messages\"\n logsDirectory: \".maestro/logs\"\n defaultModel: \"claude-sonnet-4-20250514\"\n maxConcurrentAgents: 10\n pollIntervalMs: 5000\n maxTotalBudgetUsd: 50.00\n\n # Claude CLI configuration\n # NOTE: Agents run with skip-permissions. Process safety (no builds, no Docker,\n # no servers) is enforced via system prompts in .agents/*.md. Edit those files\n # to customise safety rules.\n claudeCommand: claude\n claudeArgs:\n - \"--dangerously-skip-permissions\"\n\n feedback:\n interactionMode: supervised\n requirePlanApproval: true\n progressReportIntervalMs: 60000\n milestonePercentages: [25, 50, 75, 100]\n questionTimeoutMs: 300000\n${techParts.length > 0 ? `\ntechStack:\n${frontend ? ` frontend: \"${frontend}\"\\n` : ''}${uiLibrary ? ` uiLibrary: \"${uiLibrary}\"\\n` : ''}${backend ? ` backend: \"${backend}\"\\n` : ''}${database ? ` database: \"${database}\"\\n` : ''}${otherTech ? ` other: \"${otherTech}\"\\n` : ''}` : ''}`;\n\n const maestroYamlPath = path.resolve('maestro.yaml');\n if (fs.existsSync(maestroYamlPath)) {\n const overwrite = await ask(rl, ` ${chalk.yellow('maestro.yaml already exists. Overwrite? (y/n)')}`, 'n');\n if (overwrite.toLowerCase() === 'y') {\n fs.writeFileSync(maestroYamlPath, configContent, 'utf-8');\n console.log(` ${chalk.green(figures.tick)} Updated ${chalk.bold('maestro.yaml')}`);\n } else {\n console.log(chalk.dim(' Skipping maestro.yaml'));\n }\n } else {\n fs.writeFileSync(maestroYamlPath, configContent, 'utf-8');\n console.log(` ${chalk.green(figures.tick)} Created ${chalk.bold('maestro.yaml')}`);\n }\n\n // Create .maestro directory structure (skip if already exists)\n const dirs = [\n '.maestro',\n '.maestro/messages',\n '.maestro/logs',\n '.maestro/sessions',\n ];\n\n for (const dir of dirs) {\n const dirPath = path.resolve(dir);\n if (!fs.existsSync(dirPath)) {\n fs.mkdirSync(dirPath, { recursive: true });\n console.log(` ${chalk.green(figures.tick)} Created ${chalk.bold(dir + '/')}`);\n }\n }\n\n // Create .gitignore entries for .maestro\n const gitignorePath = path.resolve('.maestro/.gitignore');\n if (!fs.existsSync(gitignorePath)) {\n fs.writeFileSync(gitignorePath, `logs/\\nsessions/\\nstop\\n`, 'utf-8');\n console.log(` ${chalk.green(figures.tick)} Created ${chalk.bold('.maestro/.gitignore')}`);\n }\n\n // Build tech stack config object (used for .agents/ prompts and planner)\n const techStackConfig = techParts.length > 0 ? {\n frontend: frontend || undefined,\n uiLibrary: uiLibrary || undefined,\n backend: backend || undefined,\n database: database || undefined,\n other: otherTech || undefined,\n } : undefined;\n\n // Create .agents directory with default prompt files for customization\n const agentsDir = path.resolve('.agents');\n if (!fs.existsSync(agentsDir)) {\n fs.mkdirSync(agentsDir, { recursive: true });\n console.log(` ${chalk.green(figures.tick)} Created ${chalk.bold('.agents/')}`);\n }\n\n const roles: AgentRole[] = ['orchestrator', 'project-manager', 'architect', 'developer', 'designer', 'qa-engineer', 'devops', 'technical-writer', 'code-reviewer'];\n let createdPromptCount = 0;\n for (const role of roles) {\n const promptPath = path.resolve(agentsDir, `${role}.md`);\n if (!fs.existsSync(promptPath)) {\n // Generate the real default system prompt with template variables\n // so the file is consistent with what the system uses at runtime.\n // config.ts will substitute {{variables}} with actual values.\n const prompt = getDefaultSystemPrompt({\n role,\n agentId: '{{agentId}}',\n projectName: '{{projectName}}',\n todoFilePath: '{{todoFilePath}}',\n inboxPath: '{{inboxPath}}',\n outboxPath: '{{outboxPath}}',\n workingDirectory: '{{workingDirectory}}',\n techStack: techStackConfig,\n });\n\n const header = [\n `<!-- Maestro Agent Prompt: ${role} -->`,\n `<!-- Edit this file to customise the ${role} agent's behaviour. -->`,\n `<!-- Delete this file to fall back to the built-in default prompt. -->`,\n '',\n ].join('\\n');\n\n fs.writeFileSync(promptPath, header + prompt + '\\n', 'utf-8');\n createdPromptCount++;\n }\n }\n if (createdPromptCount > 0) {\n console.log(` ${chalk.green(figures.tick)} Created ${createdPromptCount} agent prompt files in ${chalk.bold('.agents/')}`);\n }\n\n // Generate task plan via Claude\n const todoPath = path.resolve('todo.md');\n const hasExistingTodo = fs.existsSync(todoPath);\n\n // Parse existing todo.md if present\n let existingTasks: Task[] = [];\n if (hasExistingTodo) {\n const parser = new TaskParser();\n const existing = parser.parse(fs.readFileSync(todoPath, 'utf-8'));\n existingTasks = existing.tasks;\n console.log(chalk.cyan(` ${figures.info} Found existing ${chalk.bold('todo.md')} with ${existingTasks.length} tasks`));\n const doneTasks = existingTasks.filter(t => t.status === 'done').length;\n const inProgress = existingTasks.filter(t => t.status === 'in-progress').length;\n const pending = existingTasks.filter(t => t.status === 'pending').length;\n console.log(chalk.dim(` ${doneTasks} done, ${inProgress} in-progress, ${pending} pending`));\n console.log();\n }\n\n if (options.plan) {\n console.log();\n\n const planner = new Planner({\n model: options.model,\n workingDirectory: process.cwd(),\n techStack: techStackConfig,\n });\n\n // Build the goal from description and/or instructions file\n let planGoal = '';\n\n // Instructions file takes priority as the detailed goal\n if (instructionsContent) {\n planGoal = instructionsContent;\n // Append the short description as additional context if provided\n if (description) {\n planGoal = `${description}\\n\\n--- Detailed Instructions ---\\n${instructionsContent}`;\n }\n } else {\n planGoal = description || `Set up and develop ${projectName}`;\n }\n\n if (detected.hasExistingCode) {\n planGoal += `\\n\\nThis is an existing ${detected.type} project. Found config files: ${detected.configFiles.join(', ')}.`;\n planGoal += `\\nBuild on the existing codebase rather than creating from scratch.`;\n }\n\n // If there are existing tasks, provide context so planner doesn't duplicate\n if (existingTasks.length > 0) {\n planGoal += `\\n\\nEXISTING TASKS (do NOT duplicate these — only create NEW tasks for work not already covered):`;\n for (const t of existingTasks) {\n planGoal += `\\n- [${t.status}] ${t.id}: ${t.title}`;\n }\n }\n\n // Spinner frames for loading indicator\n const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];\n let spinnerIndex = 0;\n let spinnerActive = true;\n\n const spinnerInterval = setInterval(() => {\n if (!spinnerActive) return;\n const frame = chalk.cyan(spinnerFrames[spinnerIndex]);\n process.stdout.write(`\\r ${frame} ${chalk.dim('Planning tasks with Claude...')}`);\n spinnerIndex = (spinnerIndex + 1) % spinnerFrames.length;\n }, 80);\n\n try {\n const plannedTasks = await planner.decompose(planGoal);\n spinnerActive = false;\n clearInterval(spinnerInterval);\n process.stdout.write('\\r ' + chalk.green(figures.tick) + ' ' + chalk.dim('Planning tasks with Claude... done') + '\\n');\n\n // Determine starting task counter from existing tasks\n let maxExistingNum = 0;\n for (const t of existingTasks) {\n const match = t.id.match(/^T-(\\d+)$/);\n if (match) {\n maxExistingNum = Math.max(maxExistingNum, parseInt(match[1], 10));\n }\n }\n resetTaskCounter(maxExistingNum);\n\n // Build new tasks and resolve dependency titles to task IDs\n // Include existing task titles in the lookup so new tasks can reference them\n const titleToId = new Map<string, string>();\n for (const t of existingTasks) {\n titleToId.set(t.title, t.id);\n }\n\n const newTasks: Task[] = [];\n for (const planned of plannedTasks) {\n const task = plannedToTask(planned);\n // Map dependency titles to the IDs of previously created tasks\n task.dependencies = planned.dependencies\n .map((depTitle) => titleToId.get(depTitle))\n .filter((id): id is string => id != null);\n titleToId.set(planned.title, task.id);\n newTasks.push(task);\n }\n\n // Merge: existing tasks keep their state, new tasks are appended\n const allTasks = [...existingTasks, ...newTasks];\n\n const writer = new TaskWriter();\n const todoContent = writer.write(projectName, allTasks);\n\n fs.writeFileSync(todoPath, todoContent, 'utf-8');\n\n if (existingTasks.length > 0) {\n console.log(\n chalk.green(` ${figures.tick} Updated ${chalk.bold('todo.md')}: ${existingTasks.length} existing + ${newTasks.length} new tasks`)\n );\n } else {\n console.log(\n chalk.green(` ${figures.tick} Created ${chalk.bold('todo.md')} with ${newTasks.length} planned tasks`)\n );\n }\n console.log();\n\n // Display only the new planned tasks\n if (newTasks.length > 0) {\n if (existingTasks.length > 0) {\n console.log(chalk.dim(' New tasks:'));\n }\n for (const task of newTasks) {\n const priorityColor =\n task.priority === 'critical' ? chalk.red\n : task.priority === 'high' ? chalk.yellow\n : task.priority === 'medium' ? chalk.cyan\n : chalk.dim;\n console.log(\n ` ${priorityColor(task.id)} ${task.title}`\n );\n }\n }\n } catch (err) {\n spinnerActive = false;\n clearInterval(spinnerInterval);\n process.stdout.write('\\r ' + chalk.yellow(figures.warning) + ' ' + chalk.dim('Planning tasks with Claude... failed') + '\\n');\n console.log(\n chalk.yellow(\n ` ${figures.warning} Planning failed: ${(err as Error).message}`\n )\n );\n if (!hasExistingTodo) {\n console.log(chalk.dim(' Creating empty todo.md instead'));\n writeEmptyTodo(todoPath, projectName);\n } else {\n console.log(chalk.dim(' Keeping existing todo.md unchanged'));\n }\n }\n } else if (!hasExistingTodo) {\n writeEmptyTodo(todoPath, projectName);\n } else {\n console.log(chalk.dim(` Keeping existing ${chalk.bold('todo.md')} (${existingTasks.length} tasks)`));\n }\n\n console.log();\n console.log(chalk.green(' Project initialized successfully!'));\n\n // Process safety & roles explanation\n console.log();\n console.log(chalk.bold(' Process Safety'));\n console.log();\n console.log(chalk.dim(' Agents share your machine\\'s CPU and memory. To keep things stable,'));\n console.log(chalk.dim(' they follow built-in process safety rules:'));\n console.log();\n console.log(` ${chalk.green(figures.tick)} ${chalk.white('Agents will')}:`);\n console.log(chalk.dim(' - Write production code, tests, configs, docs, and infrastructure files'));\n console.log(chalk.dim(' - Run lightweight commands (linters, type-checks on single files)'));\n console.log(chalk.dim(' - Run targeted test files (a single spec, not the full suite)'));\n console.log(chalk.dim(' - Install individual packages (e.g. npm install <pkg>)'));\n console.log();\n console.log(` ${chalk.red(figures.cross)} ${chalk.white('Agents will not')}:`);\n console.log(chalk.dim(' - Run builds (npm run build, cargo build, make, etc.)'));\n console.log(chalk.dim(' - Run Docker commands (docker build, docker compose up, etc.)'));\n console.log(chalk.dim(' - Start dev servers (npm run dev, npm start, flask run, etc.)'));\n console.log(chalk.dim(' - Run full dependency installs (npm install with no args)'));\n console.log(chalk.dim(' - Run full test suites (npm test, pytest with no args)'));\n console.log();\n console.log(` ${chalk.cyan(figures.info)} ${chalk.white('You handle')}:`);\n console.log(chalk.dim(' - Building the project when agents finish writing code'));\n console.log(chalk.dim(' - Running Docker and starting dev servers'));\n console.log(chalk.dim(' - Running full test suites and CI pipelines'));\n console.log(chalk.dim(' - Reviewing and approving agent plans (in supervised mode)'));\n console.log();\n console.log(chalk.dim(` Want full autonomy? Edit the process safety section in ${chalk.bold('.agents/*.md')}`));\n console.log(chalk.dim(` to loosen or remove these restrictions per role.`));\n\n console.log();\n console.log(` Next steps:`);\n console.log(` 1. Review ${chalk.bold('todo.md')} and edit tasks if needed`);\n console.log(` 2. Edit ${chalk.bold('maestro.yaml')} to adjust agents and settings`);\n console.log(` 3. Customize agent prompts in ${chalk.bold('.agents/')} (optional)`);\n console.log(` 4. Run ${chalk.bold('maestro start')} to begin`);\n if (instructionsContent) {\n console.log();\n console.log(chalk.dim(` Instructions from ${chalk.bold(options.instructions!)} were used for task planning.`));\n }\n console.log();\n } finally {\n rl.close();\n }\n });\n}\n\nfunction writeEmptyTodo(todoPath: string, projectName: string): void {\n if (!fs.existsSync(todoPath)) {\n const writer = new TaskWriter();\n const todoContent = writer.write(projectName, []);\n fs.writeFileSync(todoPath, todoContent, 'utf-8');\n console.log(` ${chalk.green(figures.tick)} Created ${chalk.bold('todo.md')}`);\n }\n}\n","import { existsSync } from 'node:fs';\nimport { execSync } from 'node:child_process';\nimport path from 'node:path';\nimport os from 'node:os';\n\n/**\n * Checks if the Claude CLI is installed and accessible\n */\nexport function checkClaudeInstalled(): {\n installed: boolean;\n path?: string;\n version?: string;\n error?: string;\n} {\n try {\n // Try to get claude command path\n const claudePath = execSync('command -v claude', { encoding: 'utf-8' }).trim();\n\n if (!claudePath) {\n // Also check common installation paths\n const homeDir = os.homedir();\n const commonPaths = [\n path.join(homeDir, '.local', 'bin', 'claude'),\n '/usr/local/bin/claude',\n path.join(homeDir, 'bin', 'claude'),\n ];\n\n for (const checkPath of commonPaths) {\n if (existsSync(checkPath)) {\n // Try to get version\n try {\n const version = execSync('claude --version', { encoding: 'utf-8' }).trim();\n return { installed: true, path: checkPath, version };\n } catch {\n return { installed: true, path: checkPath };\n }\n }\n }\n\n return {\n installed: false,\n error: 'Claude CLI not found in PATH or common installation directories',\n };\n }\n\n // Get version\n let version: string | undefined;\n try {\n version = execSync('claude --version', { encoding: 'utf-8' }).trim();\n } catch {\n // Version check failed, but command exists\n }\n\n return { installed: true, path: claudePath, version };\n } catch (error) {\n return {\n installed: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n };\n }\n}\n\n/**\n * Returns installation instructions for Claude CLI based on the detected OS\n */\nexport function getClaudeInstallInstructions(): string {\n const platform = os.platform();\n\n if (platform === 'darwin') {\n return `Install Claude CLI for macOS:\n npm install -g @anthropic-ai/claude-code\n\nOr using Homebrew:\n brew install anthropic/claude/claude-code`;\n }\n\n if (platform === 'linux') {\n return `Install Claude CLI for Linux:\n npm install -g @anthropic-ai/claude-code`;\n }\n\n if (platform === 'win32') {\n return `Install Claude CLI for Windows:\n npm install -g @anthropic-ai/claude-code`;\n }\n\n return `Install Claude CLI:\n npm install -g @anthropic-ai/claude-code`;\n}\n","import { Command } from 'commander';\nimport * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport chalk from 'chalk';\nimport figures from 'figures';\nimport {\n loadProjectConfig,\n WorkspaceManager,\n Orchestrator,\n} from '@maestroai/core';\nimport type { ProjectConfig } from '@maestroai/core';\nimport { FileLogger } from '../logging/file-logger.js';\n\ninterface StartOptions {\n config: string;\n tui: boolean;\n mode: string;\n verbose: boolean;\n dir: string;\n}\n\nfunction truncate(str: string, max: number): string {\n return str.length > max ? str.slice(0, max - 3) + '...' : str;\n}\n\nfunction formatDuration(ms: number): string {\n const seconds = Math.floor(ms / 1000);\n const minutes = Math.floor(seconds / 60);\n const hours = Math.floor(minutes / 60);\n if (hours > 0) return `${hours}h ${minutes % 60}m ${seconds % 60}s`;\n if (minutes > 0) return `${minutes}m ${seconds % 60}s`;\n return `${seconds}s`;\n}\n\nexport function registerStartCommand(program: Command): void {\n program\n .command('start')\n .description('Start the Maestro orchestrator')\n .option('-c, --config <path>', 'path to maestro.yaml', './maestro.yaml')\n .option('-d, --dir <path>', 'working directory for project context', '.')\n .option('--no-tui', 'run without TUI (log to console)')\n .option('-m, --mode <mode>', 'interaction mode (unattended, supervised, interactive)', 'supervised')\n .option('-v, --verbose', 'show detailed agent output including tool calls', false)\n .action(async (options: StartOptions) => {\n // Change to target directory if specified\n if (options.dir && options.dir !== '.') {\n try {\n process.chdir(path.resolve(options.dir));\n console.log(chalk.dim(` Working directory changed to: ${process.cwd()}`));\n } catch (err) {\n console.error(\n chalk.red(`${figures.cross} Failed to change directory: ${(err as Error).message}`)\n );\n process.exit(1);\n }\n }\n\n const configPath = path.resolve(options.config);\n\n if (!fs.existsSync(configPath)) {\n console.error(\n chalk.red(`${figures.cross} Config file not found: ${configPath}`)\n );\n console.error(\n chalk.dim(` Run ${chalk.bold('maestro init')} to create one.`)\n );\n process.exit(1);\n }\n\n // Remove stale stop file if present\n const stopFilePath = path.resolve('.maestro/stop');\n if (fs.existsSync(stopFilePath)) {\n fs.unlinkSync(stopFilePath);\n }\n\n let projectConfig: ProjectConfig;\n try {\n projectConfig = await loadProjectConfig(configPath);\n } catch (err) {\n console.error(\n chalk.red(`${figures.cross} Failed to load config: ${(err as Error).message}`)\n );\n process.exit(1);\n }\n\n // Apply interaction mode from CLI flag\n if (options.mode) {\n projectConfig.settings.feedback = {\n progressReportIntervalMs: 60000,\n milestonePercentages: [25, 50, 75, 100],\n questionTimeoutMs: 300000,\n requirePlanApproval: true,\n ...projectConfig.settings.feedback,\n interactionMode: options.mode as any,\n };\n }\n\n const workspace = new WorkspaceManager(process.cwd());\n await workspace.initialize(projectConfig);\n\n const orchestrator = new Orchestrator(projectConfig);\n\n // Attach file logger for persistent agent logs\n const fileLogger = new FileLogger(\n projectConfig.settings.logsDirectory || '.maestro/logs'\n );\n fileLogger.attach(orchestrator);\n\n // Graceful shutdown handler with hard deadline\n let shuttingDown = false;\n const SHUTDOWN_TIMEOUT_MS = 15000; // Force exit after 15s\n\n const shutdown = async (signal: string) => {\n if (shuttingDown) return;\n shuttingDown = true;\n\n // Clear the stop file watcher immediately\n clearInterval(stopWatcher);\n\n if (!options.tui) {\n console.log();\n console.log(\n chalk.yellow(`${figures.warning} Received ${signal}, shutting down gracefully...`)\n );\n }\n\n // Hard deadline: if graceful shutdown takes too long, force exit\n const forceExitTimer = setTimeout(() => {\n if (!options.tui) {\n console.log(\n chalk.red(`${figures.cross} Shutdown timed out, forcing exit`)\n );\n }\n process.exit(1);\n }, SHUTDOWN_TIMEOUT_MS);\n forceExitTimer.unref(); // Don't let this timer alone keep the process alive\n\n try {\n await orchestrator.stop();\n } catch {\n // Ignore errors during shutdown\n }\n\n // Close file logger streams\n fileLogger.close();\n\n clearTimeout(forceExitTimer);\n process.exit(0);\n };\n\n process.on('SIGINT', () => shutdown('SIGINT'));\n process.on('SIGTERM', () => shutdown('SIGTERM'));\n\n // Watch for stop file\n const stopWatcher = setInterval(() => {\n if (fs.existsSync(stopFilePath)) {\n clearInterval(stopWatcher);\n shutdown('stop-file');\n }\n }, 1000);\n stopWatcher.unref(); // Don't let this timer alone keep the process alive\n\n if (options.tui) {\n // Dynamic import to avoid loading React/Ink when not needed\n const { renderApp } = await import('../tui/App.js');\n // Render TUI first so it can display plan approval UI,\n // then start the orchestrator (which may propose a plan)\n renderApp(orchestrator, projectConfig);\n await orchestrator.start();\n } else {\n console.log();\n console.log(chalk.bold(' MAESTRO') + ` - ${projectConfig.name}`);\n console.log(chalk.dim(` ${projectConfig.description}`));\n console.log();\n\n // Map agent IDs to friendly names (populated by agent:spawned events)\n const agentNameMap = new Map<string, string>();\n\n orchestrator.on('agent:spawned', (state) => {\n agentNameMap.set(state.config.id, state.config.name);\n const pid = state.pid ? ` (PID ${state.pid})` : '';\n console.log(\n chalk.green(`${figures.play} Agent spawned: ${state.config.name} [${state.config.role}]${pid}`)\n );\n console.log(\n chalk.dim(` model: ${state.config.model ?? 'default'} | mode: ${state.config.permissionMode}`)\n );\n });\n\n orchestrator.on('agent:status-changed', (agentId, _oldStatus, newStatus) => {\n const name = agentNameMap.get(agentId) ?? agentId;\n const color = newStatus === 'running' ? chalk.green\n : newStatus === 'error' ? chalk.red\n : chalk.yellow;\n console.log(color(`${figures.pointer} ${name}: ${newStatus}`));\n });\n\n orchestrator.on('agent:output', (event) => {\n const displayName = agentNameMap.get(event.agentId) ?? event.agentId;\n const prefix = chalk.dim(` [${displayName}]`);\n\n if (event.type === 'user') {\n // Extract tool_result content (e.g. \"File created successfully at: ...\")\n const message = event.data.message as any;\n if (message && typeof message === 'object' && Array.isArray(message.content)) {\n for (const block of message.content) {\n if (block.type !== 'tool_result') continue;\n let resultText = '';\n if (typeof block.content === 'string') {\n resultText = block.content.trim();\n } else if (Array.isArray(block.content)) {\n resultText = block.content\n .filter((s: any) => s.type === 'text' && typeof s.text === 'string')\n .map((s: any) => s.text.trim())\n .join(' ');\n }\n if (resultText) {\n // Show first line only, truncated\n const firstLine = resultText.split('\\n')[0];\n console.log(`${prefix} ${chalk.dim(truncate(firstLine, 150))}`);\n }\n }\n }\n return;\n }\n\n if (event.type === 'assistant') {\n // Extract text from Claude stream-json format:\n // {type:\"assistant\", message:{role:\"assistant\", content:[{type:\"text\", text:\"...\"}]}}\n let text = '';\n const message = event.data.message as any;\n if (message && typeof message === 'object' && Array.isArray(message.content)) {\n text = message.content\n .filter((block: any) => block.type === 'text' && typeof block.text === 'string')\n .map((block: any) => block.text)\n .join('');\n } else if (typeof event.data.content === 'string') {\n text = event.data.content;\n } else if (typeof message === 'string') {\n text = message;\n }\n\n if (text) {\n for (const line of text.split('\\n')) {\n console.log(`${prefix} ${line}`);\n }\n }\n } else if (event.type === 'result') {\n const cost = typeof event.data.cost_usd === 'number' ? `$${event.data.cost_usd.toFixed(4)}` : '';\n const turns = typeof event.data.num_turns === 'number' ? `${event.data.num_turns} turns` : '';\n // Token usage\n const usage = event.data.usage as any;\n let usageStr = '';\n if (usage && typeof usage === 'object') {\n const parts: string[] = [];\n if (typeof usage.input_tokens === 'number') parts.push(`in:${usage.input_tokens}`);\n if (typeof usage.output_tokens === 'number') parts.push(`out:${usage.output_tokens}`);\n if (typeof usage.cache_read_input_tokens === 'number' && usage.cache_read_input_tokens > 0) {\n parts.push(`cache:${usage.cache_read_input_tokens}`);\n }\n if (parts.length > 0) usageStr = parts.join(' ');\n }\n console.log(`${prefix} ${chalk.green('done')} ${[cost, turns, usageStr].filter(Boolean).join(' | ')}`);\n } else if (event.type === 'error') {\n const msg = (event.data.error as string) ?? JSON.stringify(event.data);\n console.log(`${prefix} ${chalk.red(`error: ${msg}`)}`);\n } else if (options.verbose) {\n // tool_use, tool_result, system — only shown in verbose mode\n if (event.type === 'tool_use') {\n const toolName = (event.data.tool as string) ?? (event.data.name as string) ?? 'tool';\n console.log(`${prefix} ${chalk.cyan(`[${toolName}]`)} ${chalk.dim(truncate(JSON.stringify(event.data.input ?? ''), 120))}`);\n } else if (event.type === 'system') {\n const msg = (event.data.message as string) ?? '';\n if (msg) console.log(`${prefix} ${chalk.dim(msg)}`);\n }\n }\n });\n\n orchestrator.on('task:assigned', (task, agentId) => {\n const name = agentNameMap.get(agentId) ?? agentId;\n console.log(\n chalk.blue(`${figures.pointer} Task assigned: ${task.id} \"${task.title}\" → ${name}`)\n );\n });\n\n orchestrator.on('task:completed', (task) => {\n console.log(\n chalk.green(`${figures.tick} Task completed: ${task.title}`)\n );\n });\n\n orchestrator.on('orchestrator:cycle', (stats) => {\n // Build agent roster line: active agents first, then idle, then standby\n const sorted = [...stats.agents].sort((a, b) => {\n const rank = (agent: typeof a) => {\n if (agent.status === 'running' || agent.status === 'starting') return 0;\n if (agent.spawned && agent.status === 'idle') return 1;\n if (agent.status === 'error') return 2;\n if (!agent.spawned) return 4; // Standby last\n return 3; // stopped\n };\n return rank(a) - rank(b);\n });\n\n const agentTags = sorted.map((a) => {\n const label = a.name;\n if (a.status === 'running' || a.status === 'starting') {\n return chalk.green.bold(label);\n } else if (a.status === 'error') {\n return chalk.red(label);\n } else if (!a.spawned) {\n return chalk.gray(`${label} (Standby)`);\n } else if (a.status === 'stopped') {\n return chalk.dim(label);\n }\n return chalk.yellow(label);\n });\n\n const totalTokens = stats.totalInputTokens + stats.totalOutputTokens + stats.totalCacheReadTokens + stats.totalCacheCreationTokens;\n const tokenStr = totalTokens > 0 ? ` | tokens: ${totalTokens.toLocaleString()}` : '';\n console.log(\n chalk.dim(` [cycle] tasks: ${stats.completedTasks}/${stats.totalTasks} | cost: $${stats.totalCostUsd.toFixed(4)}${tokenStr}`)\n );\n console.log(\n chalk.dim(' agents: ') + agentTags.join(chalk.dim(' | '))\n );\n });\n\n orchestrator.on('rate-limit', (agentId, resetAt) => {\n const name = agentNameMap.get(agentId) ?? agentId;\n const resetInfo = resetAt ? ` Resets at ${resetAt}.` : '';\n console.log(\n chalk.red.bold(`${figures.warning} RATE LIMIT: Agent ${name} hit API usage limit.${resetInfo}`)\n );\n });\n\n orchestrator.on('plan:proposed', (proposal) => {\n console.log(chalk.cyan(`\\n${figures.info} Plan proposed with ${proposal.tasks.length} tasks:`));\n for (const task of proposal.tasks) {\n console.log(chalk.dim(` - [${task.priority}] ${task.title}`));\n }\n // Auto-approve in non-TUI mode\n orchestrator.decidePlan(proposal.id, 'approved');\n console.log(chalk.green(`${figures.tick} Plan auto-approved (non-TUI mode)`));\n });\n\n orchestrator.on('architecture:ready', (archTasks) => {\n console.log();\n console.log(chalk.bold.cyan(`${figures.info} Architecture phase complete!`));\n console.log(chalk.dim(' Review ARCHITECTURE.md and architecture-related files.'));\n console.log(chalk.dim(' Completed architecture tasks:'));\n for (const task of archTasks) {\n console.log(chalk.dim(` - ${task.title}`));\n }\n // Auto-approve in non-TUI mode\n orchestrator.approveArchitecture();\n console.log(chalk.green(`${figures.tick} Architecture auto-approved, advancing to development`));\n });\n\n orchestrator.on('phase:changed', (phase) => {\n console.log(chalk.cyan(`${figures.pointer} Phase: ${phase}`));\n });\n\n orchestrator.on('question:asked', (question) => {\n console.log(chalk.yellow(`\\n${figures.warning} Agent ${question.fromAgent} asks: ${question.question}`));\n if (question.options) {\n question.options.forEach((opt: string, i: number) => console.log(chalk.dim(` ${i + 1}. ${opt}`)));\n }\n console.log(chalk.dim(' (auto-skipping in non-TUI mode)'));\n });\n\n orchestrator.on('orchestrator:activity', (activity) => {\n const kindColors: Record<string, typeof chalk.green> = {\n 'task-delegated': chalk.cyan,\n 'task-completed': chalk.green,\n 'task-blocked': chalk.red,\n 'task-failed': chalk.red,\n 'agent-spawned': chalk.green,\n 'agent-stopped': chalk.gray,\n 'agent-error': chalk.red,\n 'phase-changed': chalk.magenta,\n 'pipeline-handoff': chalk.yellow,\n 'plan-created': chalk.blue,\n 'plan-approved': chalk.green,\n 'plan-rejected': chalk.red,\n 'project-completed': chalk.green,\n 'info': chalk.blue,\n };\n const color = kindColors[activity.kind] ?? chalk.dim;\n const time = new Date(activity.timestamp).toLocaleTimeString('en-US', {\n hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit',\n });\n console.log(\n chalk.yellow(` [Orchestrator]`) + chalk.dim(` ${time} `) + color(activity.message)\n );\n });\n\n orchestrator.on('progress:report', (report) => {\n console.log(chalk.cyan(` [progress] ${report.percentComplete.toFixed(0)}% | phase: ${report.phase} | ${report.completedTasks}/${report.totalTasks} tasks`));\n });\n\n orchestrator.on('milestone:reached', (milestone) => {\n console.log(chalk.bold.green(`\\n${figures.star} Milestone: ${milestone.name} - ${milestone.message}`));\n orchestrator.acknowledgeMilestone(milestone.id);\n });\n\n orchestrator.on('project:completed', (summary) => {\n const totalTokens = summary.totalInputTokens + summary.totalOutputTokens + summary.totalCacheReadTokens + summary.totalCacheCreationTokens;\n\n console.log();\n console.log(chalk.bold.green('='.repeat(60)));\n console.log(chalk.bold.green(` ${figures.star} PROJECT COMPLETED ${figures.star}`));\n console.log(chalk.bold.green('='.repeat(60)));\n console.log();\n\n // Task summary\n console.log(chalk.bold(' Tasks'));\n console.log(` Completed: ${chalk.green(String(summary.doneTasks))} / ${summary.totalTasks}`);\n if (summary.cancelledTasks > 0) {\n console.log(` Cancelled: ${chalk.yellow(String(summary.cancelledTasks))}`);\n }\n console.log();\n\n // Cost & tokens\n console.log(chalk.bold(' Usage'));\n console.log(` Cost: ${chalk.cyan('$' + summary.totalCostUsd.toFixed(4))}`);\n if (totalTokens > 0) {\n console.log(` Tokens: ${totalTokens.toLocaleString()} total`);\n console.log(` ${chalk.dim(`in: ${summary.totalInputTokens.toLocaleString()} | out: ${summary.totalOutputTokens.toLocaleString()} | cache-read: ${summary.totalCacheReadTokens.toLocaleString()} | cache-write: ${summary.totalCacheCreationTokens.toLocaleString()}`)}`);\n }\n console.log(` Duration: ${formatDuration(summary.uptimeMs)}`);\n console.log();\n\n // Agent breakdown\n const activeAgents = summary.agentSummaries.filter((a: typeof summary.agentSummaries[number]) => a.tasksCompleted > 0);\n if (activeAgents.length > 0) {\n console.log(chalk.bold(' Agent Breakdown'));\n for (const agent of activeAgents) {\n const agentTokens = agent.inputTokens + agent.outputTokens;\n const tokenInfo = agentTokens > 0 ? `, ${agentTokens.toLocaleString()} tokens` : '';\n console.log(\n ` ${agent.name} ${chalk.dim(`(${agent.role})`)}: ${agent.tasksCompleted} tasks, $${agent.costUsd.toFixed(4)}${tokenInfo}`\n );\n }\n console.log();\n }\n\n // Next steps\n console.log(chalk.bold(' Next Steps'));\n console.log(` ${figures.arrowRight} Review the completed work in your project directory`);\n console.log(` ${figures.arrowRight} Run your test suite to verify the changes`);\n console.log(` ${figures.arrowRight} Check git diff to review all modifications`);\n console.log(` ${figures.arrowRight} Commit and push when ready`);\n console.log();\n console.log(chalk.dim(' ' + '='.repeat(56)));\n console.log();\n });\n\n await orchestrator.start();\n\n console.log(\n chalk.green(`${figures.tick} Orchestrator started`)\n );\n }\n });\n}\n","import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport type { Orchestrator, AgentStreamEvent } from '@maestroai/core';\n\n/**\n * FileLogger writes all agent output to per-agent log files\n * in the .maestro/logs/ directory.\n */\nexport class FileLogger {\n private logsDir: string;\n private streams = new Map<string, fs.WriteStream>();\n\n constructor(logsDir: string) {\n this.logsDir = logsDir;\n fs.mkdirSync(this.logsDir, { recursive: true });\n }\n\n /**\n * Attach to an orchestrator and start logging all agent output.\n */\n attach(orchestrator: Orchestrator): void {\n orchestrator.on('agent:output', (event: AgentStreamEvent) => {\n this.writeEvent(event);\n });\n\n orchestrator.on('agent:spawned', (state) => {\n const agentId = state.config.id;\n this.writeLine(\n agentId,\n `[system] Agent spawned: ${state.config.name} (${state.config.role})`\n );\n });\n\n orchestrator.on('agent:status-changed', (agentId, oldStatus, newStatus) => {\n this.writeLine(agentId, `[system] Status: ${oldStatus} -> ${newStatus}`);\n });\n\n orchestrator.on('agent:error', (agentId, error) => {\n this.writeLine(agentId, `[error] ${error.message}`);\n });\n\n orchestrator.on('agent:stopped', (agentId, exitCode) => {\n this.writeLine(\n agentId,\n `[system] Agent stopped (exit code: ${exitCode})`\n );\n this.closeStream(agentId);\n });\n }\n\n /**\n * Close all open log streams.\n */\n close(): void {\n for (const [agentId] of this.streams) {\n this.closeStream(agentId);\n }\n }\n\n private writeEvent(event: AgentStreamEvent): void {\n // Always write full JSON so log readers can parse structured data\n this.writeLine(event.agentId, `[${event.type}] ${JSON.stringify(event.data)}`);\n }\n\n private writeLine(agentId: string, line: string): void {\n const stream = this.getOrCreateStream(agentId);\n const timestamp = new Date().toISOString();\n stream.write(`${timestamp} ${line}\\n`);\n }\n\n private getOrCreateStream(agentId: string): fs.WriteStream {\n let stream = this.streams.get(agentId);\n if (!stream) {\n const logFile = path.join(this.logsDir, `${agentId}.log`);\n stream = fs.createWriteStream(logFile, { flags: 'a' });\n this.streams.set(agentId, stream);\n }\n return stream;\n }\n\n private closeStream(agentId: string): void {\n const stream = this.streams.get(agentId);\n if (stream) {\n stream.end();\n this.streams.delete(agentId);\n }\n }\n}\n","import { Command } from 'commander';\nimport * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport chalk from 'chalk';\nimport figures from 'figures';\n\ninterface TaskCounts {\n pending: number;\n inProgress: number;\n done: number;\n blocked: number;\n cancelled: number;\n total: number;\n}\n\nfunction parseTodoFile(content: string): TaskCounts {\n const counts: TaskCounts = {\n pending: 0,\n inProgress: 0,\n done: 0,\n blocked: 0,\n cancelled: 0,\n total: 0,\n };\n\n const lines = content.split('\\n');\n let currentSection = '';\n\n for (const line of lines) {\n const trimmed = line.trim();\n\n // Detect sections by headings\n if (trimmed.startsWith('## ')) {\n const heading = trimmed.slice(3).trim().toLowerCase();\n if (heading.includes('pending')) currentSection = 'pending';\n else if (heading.includes('in progress') || heading.includes('in-progress'))\n currentSection = 'in-progress';\n else if (heading.includes('done') || heading.includes('completed'))\n currentSection = 'done';\n else if (heading.includes('blocked')) currentSection = 'blocked';\n else if (heading.includes('cancelled') || heading.includes('canceled'))\n currentSection = 'cancelled';\n continue;\n }\n\n // Count task lines (lines starting with - [ ] or - [x] or just - )\n if (trimmed.startsWith('- ') || trimmed.startsWith('* ')) {\n counts.total++;\n switch (currentSection) {\n case 'pending':\n counts.pending++;\n break;\n case 'in-progress':\n counts.inProgress++;\n break;\n case 'done':\n counts.done++;\n break;\n case 'blocked':\n counts.blocked++;\n break;\n case 'cancelled':\n counts.cancelled++;\n break;\n default:\n // If outside a known section, try to infer from checkbox\n if (trimmed.includes('[x]') || trimmed.includes('[X]')) {\n counts.done++;\n } else {\n counts.pending++;\n }\n break;\n }\n }\n }\n\n return counts;\n}\n\nexport function registerStatusCommand(program: Command): void {\n program\n .command('status')\n .description('Show current project status')\n .option('-c, --config <path>', 'path to maestro.yaml', './maestro.yaml')\n .action(async (options: { config: string }) => {\n const todoPath = path.resolve('todo.md');\n const stopFilePath = path.resolve('.maestro/stop');\n const isRunning = !fs.existsSync(stopFilePath) && fs.existsSync(path.resolve('.maestro'));\n\n console.log();\n console.log(chalk.bold(' MAESTRO') + ' - Project Status');\n console.log();\n\n // Check if orchestrator is running\n console.log(\n ` Orchestrator: ${isRunning ? chalk.green('possibly running') : chalk.dim('stopped')}`\n );\n console.log();\n\n if (!fs.existsSync(todoPath)) {\n console.log(chalk.yellow(` ${figures.warning} No todo.md found`));\n console.log(chalk.dim(` Run ${chalk.bold('maestro init')} to set up your project.`));\n console.log();\n return;\n }\n\n const content = fs.readFileSync(todoPath, 'utf-8');\n const counts = parseTodoFile(content);\n\n if (counts.total === 0) {\n console.log(chalk.dim(' No tasks found in todo.md'));\n console.log();\n return;\n }\n\n // Progress bar\n const barWidth = 30;\n const doneRatio = counts.done / counts.total;\n const filledWidth = Math.round(doneRatio * barWidth);\n const bar =\n chalk.green('\\u2588'.repeat(filledWidth)) +\n chalk.dim('\\u2591'.repeat(barWidth - filledWidth));\n\n console.log(` Progress: ${bar} ${Math.round(doneRatio * 100)}%`);\n console.log();\n\n // Task counts\n console.log(` ${chalk.green(figures.tick)} Done: ${counts.done}`);\n console.log(` ${chalk.yellow(figures.play)} In Progress: ${counts.inProgress}`);\n console.log(` ${chalk.dim(figures.circle)} Pending: ${counts.pending}`);\n\n if (counts.blocked > 0) {\n console.log(` ${chalk.red(figures.cross)} Blocked: ${counts.blocked}`);\n }\n if (counts.cancelled > 0) {\n console.log(` ${chalk.dim(figures.cross)} Cancelled: ${counts.cancelled}`);\n }\n\n console.log(` ${'─'.repeat(28)}`);\n console.log(` Total: ${counts.total}`);\n console.log();\n });\n}\n","import { Command } from 'commander';\nimport * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport chalk from 'chalk';\nimport figures from 'figures';\n\nexport function registerStopCommand(program: Command): void {\n program\n .command('stop')\n .description('Stop the running Maestro orchestrator')\n .action(async () => {\n const maestroDir = path.resolve('.maestro');\n const stopFilePath = path.resolve('.maestro/stop');\n\n if (!fs.existsSync(maestroDir)) {\n console.error(\n chalk.red(\n `${figures.cross} No .maestro directory found. Is this a Maestro project?`\n )\n );\n process.exit(1);\n }\n\n if (fs.existsSync(stopFilePath)) {\n console.log(\n chalk.yellow(`${figures.warning} Stop signal already sent.`)\n );\n return;\n }\n\n fs.writeFileSync(stopFilePath, new Date().toISOString(), 'utf-8');\n console.log(\n chalk.green(\n `${figures.tick} Stop signal sent. The orchestrator will shut down gracefully.`\n )\n );\n });\n}\n"],"mappings":";AAAA,SAAS,eAAe;;;ACCxB,YAAY,QAAQ;AACpB,YAAYA,WAAU;AACtB,YAAY,cAAc;AAC1B,OAAO,WAAW;AAClB,OAAO,aAAa;AACpB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACfP,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,OAAO,UAAU;AACjB,OAAO,QAAQ;AAKR,SAAS,uBAKd;AACA,MAAI;AAEF,UAAM,aAAa,SAAS,qBAAqB,EAAE,UAAU,QAAQ,CAAC,EAAE,KAAK;AAE7E,QAAI,CAAC,YAAY;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T;","names":["path","version","resolve","fs","path","chalk","figures","fs","path","chalk","figures","fs","path","chalk","figures","fs","path","chalk","figures"]}
@@ -0,0 +1,5 @@
1
+ import { Command } from 'commander';
2
+
3
+ declare function createProgram(): Command;
4
+
5
+ export { createProgram };
@@ -0,0 +1,7 @@
1
+ import {
2
+ createProgram
3
+ } from "../chunk-5ZDNPLKN.js";
4
+ export {
5
+ createProgram
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,5 @@
1
+ import { Orchestrator, ProjectConfig } from '@maestroai/core';
2
+
3
+ declare function renderApp(orchestrator: Orchestrator, projectConfig: ProjectConfig): void;
4
+
5
+ export { renderApp };