@hoverlover/cc-dev-team 0.1.9

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/index.js +281 -0
  2. package/package.json +29 -0
package/index.js ADDED
@@ -0,0 +1,281 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execSync, spawn } from 'child_process';
4
+ import { existsSync, mkdirSync, readFileSync } from 'fs';
5
+ import { homedir } from 'os';
6
+ import { join } from 'path';
7
+ import readline from 'readline';
8
+
9
+ const INSTALL_DIR = join(homedir(), '.cc-dev-team');
10
+ const REPO_URL = 'https://github.com/hoverlover/cc-dev-team.git';
11
+
12
+ // ANSI colors
13
+ const colors = {
14
+ reset: '\x1b[0m',
15
+ bright: '\x1b[1m',
16
+ dim: '\x1b[2m',
17
+ red: '\x1b[31m',
18
+ green: '\x1b[32m',
19
+ yellow: '\x1b[33m',
20
+ blue: '\x1b[34m',
21
+ cyan: '\x1b[36m',
22
+ };
23
+
24
+ function log(msg, color = '') {
25
+ console.log(`${color}${msg}${colors.reset}`);
26
+ }
27
+
28
+ function logStep(msg) {
29
+ log(`\n${colors.cyan}▶${colors.reset} ${msg}`);
30
+ }
31
+
32
+ function logSuccess(msg) {
33
+ log(`${colors.green}✓${colors.reset} ${msg}`);
34
+ }
35
+
36
+ function logError(msg) {
37
+ log(`${colors.red}✗${colors.reset} ${msg}`);
38
+ }
39
+
40
+ function logWarning(msg) {
41
+ log(`${colors.yellow}⚠${colors.reset} ${msg}`);
42
+ }
43
+
44
+ function commandExists(cmd) {
45
+ try {
46
+ execSync(`which ${cmd}`, { stdio: 'ignore' });
47
+ return true;
48
+ } catch {
49
+ return false;
50
+ }
51
+ }
52
+
53
+ function checkPrerequisites() {
54
+ logStep('Checking prerequisites...');
55
+
56
+ let hasErrors = false;
57
+
58
+ // Check Node.js version
59
+ try {
60
+ const nodeVersion = execSync('node --version', { encoding: 'utf8' }).trim();
61
+ const major = parseInt(nodeVersion.slice(1).split('.')[0]);
62
+ if (major >= 18) {
63
+ logSuccess(`Node.js ${nodeVersion}`);
64
+ } else {
65
+ logError(`Node.js ${nodeVersion} (need 18+)`);
66
+ hasErrors = true;
67
+ }
68
+ } catch {
69
+ logError('Node.js not found (need 18+)');
70
+ hasErrors = true;
71
+ }
72
+
73
+ // Check Bun
74
+ if (commandExists('bun')) {
75
+ const bunVersion = execSync('bun --version', { encoding: 'utf8' }).trim();
76
+ logSuccess(`Bun ${bunVersion}`);
77
+ } else {
78
+ logError('Bun not found - install from https://bun.sh');
79
+ hasErrors = true;
80
+ }
81
+
82
+ // Check Claude Code CLI
83
+ if (commandExists('claude')) {
84
+ logSuccess('Claude Code CLI');
85
+ } else {
86
+ logError('Claude Code CLI not found - install from https://claude.ai/code');
87
+ hasErrors = true;
88
+ }
89
+
90
+ // Check Git
91
+ if (commandExists('git')) {
92
+ logSuccess('Git');
93
+ } else {
94
+ logError('Git not found');
95
+ hasErrors = true;
96
+ }
97
+
98
+ if (hasErrors) {
99
+ log('\nPlease install missing prerequisites and try again.', colors.red);
100
+ process.exit(1);
101
+ }
102
+ }
103
+
104
+ async function promptYesNo(question) {
105
+ const rl = readline.createInterface({
106
+ input: process.stdin,
107
+ output: process.stdout,
108
+ });
109
+
110
+ return new Promise((resolve) => {
111
+ rl.question(`${question} (y/n) `, (answer) => {
112
+ rl.close();
113
+ resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes');
114
+ });
115
+ });
116
+ }
117
+
118
+ function install() {
119
+ logStep(`Installing to ${INSTALL_DIR}...`);
120
+
121
+ // Clone the repository
122
+ log(' Cloning repository...');
123
+ execSync(`git clone --depth 1 ${REPO_URL} "${INSTALL_DIR}"`, {
124
+ stdio: 'inherit'
125
+ });
126
+
127
+ // Install dependencies
128
+ log(' Installing dependencies...');
129
+ execSync('npm install', {
130
+ cwd: INSTALL_DIR,
131
+ stdio: 'inherit'
132
+ });
133
+
134
+ // Install dashboard dependencies and build
135
+ log(' Installing dashboard...');
136
+ execSync('bun install', {
137
+ cwd: join(INSTALL_DIR, 'dashboard'),
138
+ stdio: 'inherit'
139
+ });
140
+
141
+ log(' Building dashboard...');
142
+ execSync('bun run build', {
143
+ cwd: join(INSTALL_DIR, 'dashboard'),
144
+ stdio: 'inherit'
145
+ });
146
+
147
+ // Run the setup script
148
+ log(' Configuring agents...');
149
+ execSync('./scripts/install.sh', {
150
+ cwd: INSTALL_DIR,
151
+ stdio: 'inherit'
152
+ });
153
+
154
+ logSuccess('Installation complete!');
155
+ }
156
+
157
+ function getLocalVersion() {
158
+ try {
159
+ const pkg = JSON.parse(readFileSync(join(INSTALL_DIR, 'package.json'), 'utf8'));
160
+ return pkg.version || 'unknown';
161
+ } catch {
162
+ return 'unknown';
163
+ }
164
+ }
165
+
166
+ function getRemoteVersion() {
167
+ try {
168
+ const pkg = execSync('git show origin/main:package.json', {
169
+ cwd: INSTALL_DIR,
170
+ encoding: 'utf8'
171
+ });
172
+ return JSON.parse(pkg).version || 'unknown';
173
+ } catch {
174
+ return 'unknown';
175
+ }
176
+ }
177
+
178
+ async function update() {
179
+ logStep('Checking for updates...');
180
+
181
+ try {
182
+ const currentVersion = getLocalVersion();
183
+ log(` Current version: ${colors.cyan}${currentVersion}${colors.reset}`);
184
+
185
+ // Fetch latest
186
+ execSync('git fetch origin main', {
187
+ cwd: INSTALL_DIR,
188
+ stdio: 'pipe'
189
+ });
190
+
191
+ // Check if we're behind
192
+ const status = execSync('git status -uno', {
193
+ cwd: INSTALL_DIR,
194
+ encoding: 'utf8'
195
+ });
196
+
197
+ if (status.includes('behind')) {
198
+ const newVersion = getRemoteVersion();
199
+ log(` New version available: ${colors.green}${newVersion}${colors.reset}`);
200
+
201
+ const shouldUpdate = await promptYesNo(' Update now?');
202
+ if (shouldUpdate) {
203
+ execSync('git pull origin main', {
204
+ cwd: INSTALL_DIR,
205
+ stdio: 'inherit'
206
+ });
207
+ execSync('npm install', {
208
+ cwd: INSTALL_DIR,
209
+ stdio: 'inherit'
210
+ });
211
+ execSync('bun install', {
212
+ cwd: join(INSTALL_DIR, 'dashboard'),
213
+ stdio: 'inherit'
214
+ });
215
+ execSync('./scripts/install.sh', {
216
+ cwd: INSTALL_DIR,
217
+ stdio: 'inherit'
218
+ });
219
+ logSuccess(`Updated to version ${newVersion}!`);
220
+ }
221
+ } else {
222
+ logSuccess(`Already up to date (${currentVersion})`);
223
+ }
224
+ } catch (err) {
225
+ logWarning('Could not check for updates');
226
+ }
227
+ }
228
+
229
+ function start() {
230
+ logStep('Starting CC Dev Team...');
231
+
232
+ log(`\n${colors.bright}Dashboard:${colors.reset} http://localhost:3101`);
233
+ log(`${colors.bright}Broker:${colors.reset} http://localhost:3100\n`);
234
+
235
+ // Start the orchestrator
236
+ const child = spawn('./start-orchestrator.sh', [], {
237
+ cwd: INSTALL_DIR,
238
+ stdio: 'inherit',
239
+ shell: true,
240
+ });
241
+
242
+ child.on('error', (err) => {
243
+ logError(`Failed to start: ${err.message}`);
244
+ process.exit(1);
245
+ });
246
+
247
+ // Forward signals
248
+ process.on('SIGINT', () => child.kill('SIGINT'));
249
+ process.on('SIGTERM', () => child.kill('SIGTERM'));
250
+ }
251
+
252
+ async function main() {
253
+ console.log(`
254
+ ${colors.cyan}╔═══════════════════════════════════════╗
255
+ ║ CC Dev Team ║
256
+ ║ Multi-Agent Collaboration for ║
257
+ ║ Claude Code ║
258
+ ╚═══════════════════════════════════════╝${colors.reset}
259
+ `);
260
+
261
+ // Check prerequisites
262
+ checkPrerequisites();
263
+
264
+ // Check if already installed
265
+ const isInstalled = existsSync(join(INSTALL_DIR, 'package.json'));
266
+
267
+ if (!isInstalled) {
268
+ log(`\nFirst time setup - installing to ${colors.cyan}${INSTALL_DIR}${colors.reset}`);
269
+ install();
270
+ } else {
271
+ await update();
272
+ }
273
+
274
+ // Start the system
275
+ start();
276
+ }
277
+
278
+ main().catch((err) => {
279
+ logError(err.message);
280
+ process.exit(1);
281
+ });
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@hoverlover/cc-dev-team",
3
+ "version": "0.1.9",
4
+ "description": "Multi-agent orchestration for Claude Code - coordinate AI agents for software development",
5
+ "type": "module",
6
+ "bin": {
7
+ "cc-dev-team": "./index.js"
8
+ },
9
+ "files": [
10
+ "index.js"
11
+ ],
12
+ "keywords": [
13
+ "claude",
14
+ "claude-code",
15
+ "ai-agents",
16
+ "multi-agent",
17
+ "orchestration",
18
+ "anthropic"
19
+ ],
20
+ "author": "",
21
+ "license": "GPL-3.0",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/hoverlover/cc-dev-team.git"
25
+ },
26
+ "engines": {
27
+ "node": ">=18"
28
+ }
29
+ }