claude-dojo 1.1.0 → 1.1.1

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/bin/claude-dojo.js +89 -0
  2. package/package.json +1 -1
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { fileURLToPath } from 'url';
4
+ import { dirname, join } from 'path';
5
+ import { spawn } from 'child_process';
6
+ import { existsSync } from 'fs';
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = dirname(__filename);
10
+
11
+ const PORT = process.env.PORT || 3001;
12
+ const OPEN_BROWSER = process.env.CLAUDE_DOJO_NO_BROWSER !== '1';
13
+
14
+ // Find the server entry point
15
+ const serverPath = join(__dirname, '..', 'server', 'dist', 'index.js');
16
+
17
+ if (!existsSync(serverPath)) {
18
+ console.error('Error: Server not built. Run "npm run build" first.');
19
+ console.error(`Expected server at: ${serverPath}`);
20
+ process.exit(1);
21
+ }
22
+
23
+ // Check for client build
24
+ const clientPath = join(__dirname, '..', 'client', 'dist', 'index.html');
25
+ if (!existsSync(clientPath)) {
26
+ console.error('Error: Client not built. Run "npm run build" first.');
27
+ console.error(`Expected client at: ${clientPath}`);
28
+ process.exit(1);
29
+ }
30
+
31
+ console.log(`
32
+ ╔═══════════════════════════════════════════════════════════╗
33
+ ║ ║
34
+ ║ ██████╗██╗ █████╗ ██╗ ██╗██████╗ ███████╗ ║
35
+ ║ ██╔════╝██║ ██╔══██╗██║ ██║██╔══██╗██╔════╝ ║
36
+ ║ ██║ ██║ ███████║██║ ██║██║ ██║█████╗ ║
37
+ ║ ██║ ██║ ██╔══██║██║ ██║██║ ██║██╔══╝ ║
38
+ ║ ╚██████╗███████╗██║ ██║╚██████╔╝██████╔╝███████╗ ║
39
+ ║ ╚═════╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ║
40
+ ║ ║
41
+ ║ ██████╗ ██████╗ ██╗ ██████╗ ║
42
+ ║ ██╔══██╗██╔═══██╗ ██║██╔═══██╗ ║
43
+ ║ ██║ ██║██║ ██║ ██║██║ ██║ ║
44
+ ║ ██║ ██║██║ ██║██ ██║██║ ██║ ║
45
+ ║ ██████╔╝╚██████╔╝╚█████╔╝╚██████╔╝ ║
46
+ ║ ╚═════╝ ╚═════╝ ╚════╝ ╚═════╝ ║
47
+ ║ ║
48
+ ║ Visual Agent Dashboard for Claude ║
49
+ ║ ║
50
+ ╚═══════════════════════════════════════════════════════════╝
51
+ `);
52
+
53
+ console.log(`Starting server on http://localhost:${PORT}...`);
54
+
55
+ // Start the server
56
+ const server = spawn('node', [serverPath], {
57
+ stdio: 'inherit',
58
+ env: { ...process.env, PORT: String(PORT) },
59
+ });
60
+
61
+ server.on('error', (err) => {
62
+ console.error('Failed to start server:', err.message);
63
+ process.exit(1);
64
+ });
65
+
66
+ // Open browser after a short delay to let server start
67
+ if (OPEN_BROWSER) {
68
+ setTimeout(async () => {
69
+ try {
70
+ const open = (await import('open')).default;
71
+ await open(`http://localhost:${PORT}`);
72
+ console.log(`\nOpened browser at http://localhost:${PORT}`);
73
+ } catch (err) {
74
+ console.log(`\nOpen http://localhost:${PORT} in your browser`);
75
+ }
76
+ }, 1500);
77
+ }
78
+
79
+ // Handle shutdown
80
+ process.on('SIGINT', () => {
81
+ console.log('\nShutting down...');
82
+ server.kill('SIGINT');
83
+ process.exit(0);
84
+ });
85
+
86
+ process.on('SIGTERM', () => {
87
+ server.kill('SIGTERM');
88
+ process.exit(0);
89
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-dojo",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A visual agent dashboard for Claude - watch AI agents work in a 3D hex-grid interface",
5
5
  "type": "module",
6
6
  "bin": {