enhance_swarm 2.0.0 → 2.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 (106) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/CLAUDE.md +164 -0
  3. data/.claude/MCP.md +117 -0
  4. data/.claude/PERSONAS.md +114 -0
  5. data/.claude/RULES.md +221 -0
  6. data/.enhance_swarm/logs/general_output.log +0 -404
  7. data/.enhance_swarm.yml +33 -0
  8. data/CHANGELOG.md +71 -0
  9. data/PRODUCTION_INSTALL_TEST.md +117 -0
  10. data/README.md +129 -3
  11. data/lib/enhance_swarm/agent_spawner.rb +218 -12
  12. data/lib/enhance_swarm/cli.rb +130 -1
  13. data/lib/enhance_swarm/task_coordinator.rb +363 -86
  14. data/lib/enhance_swarm/version.rb +1 -1
  15. metadata +14 -97
  16. data/PRODUCTION_TEST_LOG.md +0 -502
  17. data/debug_agent_spawner.rb +0 -99
  18. data/debug_cli_spawn.rb +0 -95
  19. data/debug_fixes.rb +0 -209
  20. data/debug_script_execution.rb +0 -124
  21. data/debug_session_issue.rb +0 -87
  22. data/debug_spawn.rb +0 -113
  23. data/debug_spawn_step_by_step.rb +0 -190
  24. data/debug_worktree.rb +0 -77
  25. data/enhance_swarm-0.1.1.gem +0 -0
  26. data/enhance_swarm-1.0.0.gem +0 -0
  27. data/final_validation_test.rb +0 -199
  28. data/setup.sh +0 -86
  29. data/test_blog_app/.enhance_swarm/archives/session_1751187575_e119ea73_20250629_105935.json +0 -16
  30. data/test_blog_app/.enhance_swarm/archives/session_1751187637_7fda97dd_20250629_110037.json +0 -32
  31. data/test_blog_app/.enhance_swarm/archives/session_1751190527_4c99147e_20250629_114847.json +0 -32
  32. data/test_blog_app/.enhance_swarm/archives/session_1751190541_8dc83406_20250629_114901.json +0 -16
  33. data/test_blog_app/.ruby-version +0 -1
  34. data/test_blog_app/Gemfile +0 -18
  35. data/test_blog_app/Gemfile.lock +0 -206
  36. data/test_blog_app/README.md +0 -24
  37. data/test_blog_app/Rakefile +0 -6
  38. data/test_blog_app/app/assets/images/.keep +0 -0
  39. data/test_blog_app/app/assets/stylesheets/application.css +0 -10
  40. data/test_blog_app/app/controllers/application_controller.rb +0 -4
  41. data/test_blog_app/app/controllers/concerns/.keep +0 -0
  42. data/test_blog_app/app/helpers/application_helper.rb +0 -2
  43. data/test_blog_app/app/models/application_record.rb +0 -3
  44. data/test_blog_app/app/models/concerns/.keep +0 -0
  45. data/test_blog_app/app/views/layouts/application.html.erb +0 -27
  46. data/test_blog_app/app/views/pwa/manifest.json.erb +0 -22
  47. data/test_blog_app/app/views/pwa/service-worker.js +0 -26
  48. data/test_blog_app/bin/dev +0 -2
  49. data/test_blog_app/bin/rails +0 -4
  50. data/test_blog_app/bin/rake +0 -4
  51. data/test_blog_app/bin/setup +0 -34
  52. data/test_blog_app/config/application.rb +0 -42
  53. data/test_blog_app/config/boot.rb +0 -3
  54. data/test_blog_app/config/credentials.yml.enc +0 -1
  55. data/test_blog_app/config/database.yml +0 -32
  56. data/test_blog_app/config/environment.rb +0 -5
  57. data/test_blog_app/config/environments/development.rb +0 -51
  58. data/test_blog_app/config/environments/production.rb +0 -67
  59. data/test_blog_app/config/environments/test.rb +0 -42
  60. data/test_blog_app/config/initializers/assets.rb +0 -7
  61. data/test_blog_app/config/initializers/content_security_policy.rb +0 -25
  62. data/test_blog_app/config/initializers/filter_parameter_logging.rb +0 -8
  63. data/test_blog_app/config/initializers/inflections.rb +0 -16
  64. data/test_blog_app/config/locales/en.yml +0 -31
  65. data/test_blog_app/config/master.key +0 -1
  66. data/test_blog_app/config/puma.rb +0 -38
  67. data/test_blog_app/config/routes.rb +0 -14
  68. data/test_blog_app/config.ru +0 -6
  69. data/test_blog_app/db/seeds.rb +0 -9
  70. data/test_blog_app/lib/tasks/.keep +0 -0
  71. data/test_blog_app/log/.keep +0 -0
  72. data/test_blog_app/public/400.html +0 -114
  73. data/test_blog_app/public/404.html +0 -114
  74. data/test_blog_app/public/406-unsupported-browser.html +0 -114
  75. data/test_blog_app/public/422.html +0 -114
  76. data/test_blog_app/public/500.html +0 -114
  77. data/test_blog_app/public/icon.png +0 -0
  78. data/test_blog_app/public/icon.svg +0 -3
  79. data/test_blog_app/public/robots.txt +0 -1
  80. data/test_blog_app/script/.keep +0 -0
  81. data/test_blog_app/storage/.keep +0 -0
  82. data/test_blog_app/test/controllers/.keep +0 -0
  83. data/test_blog_app/test/fixtures/files/.keep +0 -0
  84. data/test_blog_app/test/helpers/.keep +0 -0
  85. data/test_blog_app/test/integration/.keep +0 -0
  86. data/test_blog_app/test/models/.keep +0 -0
  87. data/test_blog_app/test/test_helper.rb +0 -15
  88. data/test_blog_app/test_enhance_swarm_e2e.rb +0 -244
  89. data/test_blog_app/test_realistic_workflow.rb +0 -292
  90. data/test_blog_app/tmp/.keep +0 -0
  91. data/test_blog_app/tmp/pids/.keep +0 -0
  92. data/test_blog_app/tmp/storage/.keep +0 -0
  93. data/test_blog_app/vendor/.keep +0 -0
  94. data/test_builtin_functionality.rb +0 -121
  95. data/test_complete_system.rb +0 -267
  96. data/test_core_components.rb +0 -156
  97. data/test_real_claude_integration.rb +0 -285
  98. data/test_security.rb +0 -150
  99. data/test_smart_defaults.rb +0 -155
  100. data/test_task_integration.rb +0 -173
  101. data/test_web_ui.rb +0 -245
  102. data/web/assets/css/main.css +0 -645
  103. data/web/assets/js/kanban.js +0 -499
  104. data/web/assets/js/main.js +0 -525
  105. data/web/templates/dashboard.html.erb +0 -226
  106. data/web/templates/kanban.html.erb +0 -193
@@ -1,155 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- # Test script for smart defaults functionality
5
-
6
- require_relative 'lib/enhance_swarm'
7
-
8
- def test_smart_defaults
9
- puts "🧪 Testing Smart Defaults Functionality"
10
- puts "=" * 50
11
-
12
- # Test in current directory (enhance_swarm gem project)
13
- puts "\n📁 Testing in current directory (enhance_swarm gem):"
14
-
15
- begin
16
- # Remove config file temporarily if it exists
17
- config_path = File.join(Dir.pwd, '.enhance_swarm.yml')
18
- backup_path = "#{config_path}.backup"
19
-
20
- if File.exist?(config_path)
21
- FileUtils.mv(config_path, backup_path)
22
- puts " Backed up existing config file"
23
- end
24
-
25
- # Create configuration with smart defaults
26
- config = EnhanceSwarm::Configuration.new
27
-
28
- puts " ✅ Configuration created successfully"
29
- puts " 📊 Smart defaults applied:"
30
- puts " Project Name: #{config.project_name}"
31
- puts " Description: #{config.project_description}"
32
- puts " Technology Stack: #{config.technology_stack}"
33
- puts " Test Command: #{config.test_command}"
34
- puts " Max Agents: #{config.max_concurrent_agents}"
35
- puts " Code Standards: #{config.code_standards.first(2).join(', ')}..."
36
- puts " Important Notes: #{config.important_notes.length} detected"
37
-
38
- if config.important_notes.any?
39
- puts " First Note: #{config.important_notes.first}"
40
- end
41
-
42
- # Test project analyzer directly
43
- puts "\n🔍 Testing ProjectAnalyzer directly:"
44
- analyzer = EnhanceSwarm::ProjectAnalyzer.new
45
- results = analyzer.analyze
46
-
47
- puts " Project Type: #{results[:project_type]}"
48
- puts " Technology Stack: #{results[:technology_stack].join(', ')}"
49
- puts " Testing Frameworks: #{results[:testing_framework].join(', ')}"
50
- puts " Build Systems: #{results[:build_system].join(', ')}"
51
- puts " Has Documentation: #{results[:documentation][:has_docs]}"
52
- puts " Documentation Path: #{results[:documentation][:primary_path]}"
53
- puts " Recommended Agents: #{results[:recommended_agents].join(', ')}"
54
-
55
- # Test smart commands
56
- smart_commands = results[:smart_commands]
57
- puts " Smart Commands:"
58
- smart_commands.each do |type, command|
59
- puts " #{type.to_s.capitalize}: #{command}" if command
60
- end
61
-
62
- # Restore config file if it existed
63
- if File.exist?(backup_path)
64
- FileUtils.mv(backup_path, config_path)
65
- puts " Restored original config file"
66
- end
67
-
68
- puts "\n✅ Smart defaults test completed successfully!"
69
-
70
- rescue StandardError => e
71
- puts "\n❌ Error testing smart defaults: #{e.message}"
72
- puts e.backtrace.first(5).join("\n")
73
-
74
- # Restore config file on error
75
- if File.exist?(backup_path)
76
- FileUtils.mv(backup_path, config_path)
77
- puts " Restored original config file after error"
78
- end
79
-
80
- return false
81
- end
82
-
83
- true
84
- end
85
-
86
- def test_different_project_types
87
- puts "\n🎯 Testing Different Project Type Detection:"
88
- puts "=" * 50
89
-
90
- # Test various project signatures
91
- test_cases = [
92
- {
93
- name: "Rails Project",
94
- files: ['Gemfile', 'config/application.rb'],
95
- expected_type: 'rails'
96
- },
97
- {
98
- name: "React Project",
99
- files: ['package.json'],
100
- package_content: { "dependencies" => { "react" => "^18.0.0" } },
101
- expected_type: 'react'
102
- },
103
- {
104
- name: "Django Project",
105
- files: ['manage.py', 'myapp/settings.py'],
106
- expected_type: 'django'
107
- }
108
- ]
109
-
110
- test_cases.each do |test_case|
111
- puts "\n📋 Testing #{test_case[:name]}:"
112
-
113
- # Create temporary test directory
114
- test_dir = "/tmp/enhance_swarm_test_#{rand(1000)}"
115
- Dir.mkdir(test_dir)
116
-
117
- begin
118
- # Create test files
119
- test_case[:files].each do |file|
120
- file_path = File.join(test_dir, file)
121
- FileUtils.mkdir_p(File.dirname(file_path))
122
-
123
- if file == 'package.json' && test_case[:package_content]
124
- File.write(file_path, JSON.pretty_generate(test_case[:package_content]))
125
- else
126
- File.write(file_path, "# Test file for #{test_case[:name]}")
127
- end
128
- end
129
-
130
- # Test analyzer
131
- analyzer = EnhanceSwarm::ProjectAnalyzer.new(test_dir)
132
- results = analyzer.analyze
133
-
134
- detected_type = results[:project_type]
135
- puts " Expected: #{test_case[:expected_type]}"
136
- puts " Detected: #{detected_type}"
137
- puts " #{detected_type == test_case[:expected_type] ? '✅' : '❌'} Match"
138
-
139
- ensure
140
- # Cleanup
141
- FileUtils.rm_rf(test_dir) if Dir.exist?(test_dir)
142
- end
143
- end
144
- end
145
-
146
- # Run tests
147
- puts "🚀 Starting Smart Defaults Tests"
148
- puts
149
-
150
- if test_smart_defaults
151
- test_different_project_types
152
- puts "\n🎉 All smart defaults tests completed!"
153
- else
154
- puts "\n💥 Smart defaults tests failed!"
155
- end
@@ -1,173 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- # Test script for swarm-tasks integration
5
-
6
- require_relative 'lib/enhance_swarm'
7
-
8
- def test_task_integration
9
- puts "🧪 Testing Task Integration Functionality"
10
- puts "=" * 50
11
-
12
- begin
13
- # Test TaskIntegration class directly
14
- puts "\n📋 Testing TaskIntegration class:"
15
-
16
- task_integration = EnhanceSwarm::TaskIntegration.new
17
-
18
- puts " ✅ TaskIntegration created successfully"
19
- puts " 📊 Swarm Tasks Available: #{task_integration.swarm_tasks_available?}"
20
-
21
- if task_integration.swarm_tasks_available?
22
- puts " 🎯 Testing swarm-tasks commands:"
23
-
24
- # Test list tasks
25
- tasks = task_integration.list_tasks
26
- puts " Found #{tasks.length} tasks"
27
-
28
- # Test get active tasks
29
- active_tasks = task_integration.get_active_tasks
30
- puts " Found #{active_tasks.length} active tasks"
31
-
32
- # Test get task folders
33
- folders = task_integration.get_task_folders
34
- puts " Found #{folders.length} task folders"
35
-
36
- # Test kanban data
37
- kanban_data = task_integration.get_kanban_data
38
- puts " Kanban data structure: #{kanban_data.keys.join(', ')}"
39
- else
40
- puts " ⚠️ swarm-tasks not available - testing limited functionality"
41
- end
42
-
43
- # Test orchestrator integration
44
- puts "\n🎯 Testing Orchestrator integration:"
45
-
46
- orchestrator = EnhanceSwarm::Orchestrator.new
47
- puts " ✅ Orchestrator created successfully"
48
-
49
- task_data = orchestrator.get_task_management_data
50
- puts " 📊 Task management data retrieved"
51
- puts " Keys: #{task_data.keys.join(', ')}"
52
-
53
- # Test setup
54
- setup_result = orchestrator.setup_task_management
55
- puts " 🔧 Task management setup: #{setup_result ? 'Success' : 'Failed/Limited'}"
56
-
57
- puts "\n✅ Task integration test completed successfully!"
58
-
59
- rescue StandardError => e
60
- puts "\n❌ Error testing task integration: #{e.message}"
61
- puts e.backtrace.first(5).join("\n")
62
- return false
63
- end
64
-
65
- true
66
- end
67
-
68
- def test_task_folder_structure
69
- puts "\n🗂️ Testing Task Folder Structure:"
70
- puts "=" * 50
71
-
72
- # Create test task directory structure
73
- test_tasks_dir = File.join(Dir.pwd, 'test_tasks')
74
-
75
- begin
76
- # Create test structure
77
- FileUtils.mkdir_p(test_tasks_dir)
78
-
79
- # Create standard kanban folders
80
- folders = ['todo', 'in_progress', 'review', 'done']
81
- folders.each do |folder|
82
- folder_path = File.join(test_tasks_dir, folder)
83
- FileUtils.mkdir_p(folder_path)
84
-
85
- # Create some test task files
86
- (1..3).each do |i|
87
- task_file = File.join(folder_path, "task_#{i}.md")
88
- File.write(task_file, "# Test Task #{i}\n\nThis is a test task in #{folder}")
89
- end
90
- end
91
-
92
- puts " ✅ Created test task structure with #{folders.length} folders"
93
- puts " 📁 Folders: #{folders.join(', ')}"
94
-
95
- # Test folder analysis
96
- original_dir = Dir.pwd
97
- Dir.chdir(File.dirname(test_tasks_dir))
98
-
99
- # Temporarily rename the test directory to 'tasks' for testing
100
- tasks_dir = File.join(File.dirname(test_tasks_dir), 'tasks')
101
- FileUtils.mv(test_tasks_dir, tasks_dir) if Dir.exist?(test_tasks_dir)
102
-
103
- task_integration = EnhanceSwarm::TaskIntegration.new
104
- detected_folders = task_integration.get_task_folders
105
-
106
- puts " 🔍 Detected #{detected_folders.length} task folders:"
107
- detected_folders.each do |folder|
108
- puts " #{folder[:name]}: #{folder[:task_count]} tasks (#{folder[:status]})"
109
- end
110
-
111
- Dir.chdir(original_dir)
112
-
113
- puts " ✅ Task folder structure test completed!"
114
-
115
- ensure
116
- # Cleanup
117
- [test_tasks_dir, tasks_dir].each do |dir|
118
- FileUtils.rm_rf(dir) if dir && Dir.exist?(dir)
119
- end
120
- end
121
-
122
- true
123
- end
124
-
125
- def test_configuration_with_tasks
126
- puts "\n⚙️ Testing Configuration with Task Integration:"
127
- puts "=" * 50
128
-
129
- begin
130
- # Test configuration creation with task management
131
- config = EnhanceSwarm::Configuration.new
132
-
133
- puts " ✅ Configuration created successfully"
134
- puts " 📊 Task Command: #{config.task_command}"
135
- puts " 📊 Task Move Command: #{config.task_move_command}"
136
-
137
- # Test orchestrator with configuration
138
- orchestrator = EnhanceSwarm::Orchestrator.new
139
- puts " ✅ Orchestrator with task integration created"
140
-
141
- puts " ✅ Configuration test completed!"
142
-
143
- rescue StandardError => e
144
- puts " ❌ Error testing configuration: #{e.message}"
145
- return false
146
- end
147
-
148
- true
149
- end
150
-
151
- # Run tests
152
- puts "🚀 Starting Task Integration Tests"
153
- puts
154
-
155
- if test_task_integration
156
- if test_task_folder_structure
157
- if test_configuration_with_tasks
158
- puts "\n🎉 All task integration tests completed successfully!"
159
- puts "\n📋 Summary:"
160
- puts " ✅ TaskIntegration class working"
161
- puts " ✅ Orchestrator integration working"
162
- puts " ✅ Task folder structure detection working"
163
- puts " ✅ Configuration integration working"
164
- puts "\n🎯 Ready for UI development with task management features!"
165
- else
166
- puts "\n💥 Configuration tests failed!"
167
- end
168
- else
169
- puts "\n💥 Task folder tests failed!"
170
- end
171
- else
172
- puts "\n💥 Task integration tests failed!"
173
- end
data/test_web_ui.rb DELETED
@@ -1,245 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- # Test script for Web UI functionality
5
-
6
- require_relative 'lib/enhance_swarm'
7
-
8
- def test_web_ui_components
9
- puts "🧪 Testing Web UI Components"
10
- puts "=" * 50
11
-
12
- begin
13
- # Test WebUI class creation
14
- puts "\n🌐 Testing WebUI class:"
15
-
16
- web_ui = EnhanceSwarm::WebUI.new(port: 4568, host: 'localhost')
17
- puts " ✅ WebUI instance created successfully"
18
- puts " 📊 Port: #{web_ui.port}"
19
- puts " 📊 Server: #{web_ui.server.class.name}"
20
-
21
- # Test template directory structure
22
- puts "\n📁 Testing template structure:"
23
-
24
- templates_dir = File.join(Dir.pwd, 'web', 'templates')
25
- assets_dir = File.join(Dir.pwd, 'web', 'assets')
26
-
27
- puts " 📂 Templates directory: #{File.exist?(templates_dir) ? '✅' : '❌'} #{templates_dir}"
28
- puts " 📂 Assets directory: #{File.exist?(assets_dir) ? '✅' : '❌'} #{assets_dir}"
29
-
30
- # Check for key template files
31
- template_files = ['dashboard.html.erb', 'kanban.html.erb']
32
- template_files.each do |file|
33
- file_path = File.join(templates_dir, file)
34
- puts " 📄 #{file}: #{File.exist?(file_path) ? '✅' : '❌'}"
35
- end
36
-
37
- # Check for asset files
38
- css_file = File.join(assets_dir, 'css', 'main.css')
39
- js_files = ['main.js', 'kanban.js']
40
-
41
- puts " 🎨 main.css: #{File.exist?(css_file) ? '✅' : '❌'}"
42
- js_files.each do |file|
43
- file_path = File.join(assets_dir, 'js', file)
44
- puts " 📜 #{file}: #{File.exist?(file_path) ? '✅' : '❌'}"
45
- end
46
-
47
- puts "\n✅ Web UI components test completed successfully!"
48
-
49
- rescue StandardError => e
50
- puts "\n❌ Error testing Web UI components: #{e.message}"
51
- puts e.backtrace.first(5).join("\n")
52
- return false
53
- end
54
-
55
- true
56
- end
57
-
58
- def test_api_integration
59
- puts "\n🔗 Testing API Integration:"
60
- puts "=" * 50
61
-
62
- begin
63
- # Test orchestrator integration
64
- orchestrator = EnhanceSwarm::Orchestrator.new
65
- puts " ✅ Orchestrator created for API integration"
66
-
67
- # Test task management data
68
- task_data = orchestrator.get_task_management_data
69
- puts " 📊 Task management data structure: #{task_data.keys.join(', ')}"
70
-
71
- # Test process monitor
72
- monitor = EnhanceSwarm::ProcessMonitor.new
73
- status_data = monitor.status
74
- puts " 📊 Process monitor status: #{status_data[:session_exists] ? 'Session exists' : 'No session'}"
75
-
76
- # Test configuration
77
- config = EnhanceSwarm.configuration
78
- puts " ⚙️ Configuration loaded: #{config.project_name}"
79
-
80
- puts " ✅ API integration test completed!"
81
-
82
- rescue StandardError => e
83
- puts " ❌ Error testing API integration: #{e.message}"
84
- return false
85
- end
86
-
87
- true
88
- end
89
-
90
- def test_cli_command
91
- puts "\n💻 Testing CLI Command:"
92
- puts "=" * 50
93
-
94
- begin
95
- # Test CLI help to see if ui command is available
96
- help_output = `bundle exec enhance-swarm help 2>/dev/null`
97
-
98
- if help_output.include?('ui')
99
- puts " ✅ 'ui' command available in CLI"
100
- else
101
- puts " ❌ 'ui' command not found in CLI help"
102
- return false
103
- end
104
-
105
- # Test UI command help
106
- ui_help = `bundle exec enhance-swarm help ui 2>/dev/null`
107
-
108
- if ui_help.include?('Start the EnhanceSwarm Web UI')
109
- puts " ✅ UI command help text correct"
110
- else
111
- puts " ⚠️ UI command help may be missing or incorrect"
112
- end
113
-
114
- puts " ✅ CLI command test completed!"
115
-
116
- rescue StandardError => e
117
- puts " ❌ Error testing CLI command: #{e.message}"
118
- return false
119
- end
120
-
121
- true
122
- end
123
-
124
- def test_file_contents
125
- puts "\n📄 Testing File Contents:"
126
- puts "=" * 50
127
-
128
- begin
129
- # Test dashboard template
130
- dashboard_path = File.join(Dir.pwd, 'web', 'templates', 'dashboard.html.erb')
131
- if File.exist?(dashboard_path)
132
- dashboard_content = File.read(dashboard_path)
133
-
134
- # Check for key components
135
- components = ['navbar', 'dashboard-grid', 'status-overview', 'active-agents', 'kanban']
136
- components.each do |component|
137
- if dashboard_content.include?(component)
138
- puts " ✅ Dashboard contains #{component}"
139
- else
140
- puts " ⚠️ Dashboard missing #{component}"
141
- end
142
- end
143
- end
144
-
145
- # Test CSS file
146
- css_path = File.join(Dir.pwd, 'web', 'assets', 'css', 'main.css')
147
- if File.exist?(css_path)
148
- css_content = File.read(css_path)
149
- css_size_kb = (css_content.length / 1024.0).round(1)
150
- puts " ✅ CSS file size: #{css_size_kb}KB"
151
-
152
- # Check for key styles
153
- styles = ['navbar', 'kanban-board', 'task-card', 'modal']
154
- styles.each do |style|
155
- if css_content.include?(style)
156
- puts " ✅ CSS contains #{style} styles"
157
- else
158
- puts " ⚠️ CSS missing #{style} styles"
159
- end
160
- end
161
- end
162
-
163
- # Test JavaScript
164
- js_path = File.join(Dir.pwd, 'web', 'assets', 'js', 'main.js')
165
- if File.exist?(js_path)
166
- js_content = File.read(js_path)
167
- js_size_kb = (js_content.length / 1024.0).round(1)
168
- puts " ✅ Main JS file size: #{js_size_kb}KB"
169
-
170
- # Check for key functions
171
- functions = ['apiRequest', 'initializeDashboard', 'spawnAgent', 'showNotification']
172
- functions.each do |func|
173
- if js_content.include?(func)
174
- puts " ✅ JS contains #{func} function"
175
- else
176
- puts " ⚠️ JS missing #{func} function"
177
- end
178
- end
179
- end
180
-
181
- puts " ✅ File contents test completed!"
182
-
183
- rescue StandardError => e
184
- puts " ❌ Error testing file contents: #{e.message}"
185
- return false
186
- end
187
-
188
- true
189
- end
190
-
191
- def manual_ui_test_instructions
192
- puts "\n🎯 Manual UI Testing Instructions:"
193
- puts "=" * 50
194
- puts
195
- puts "To manually test the Web UI:"
196
- puts "1. Run: bundle exec enhance-swarm ui"
197
- puts "2. Open browser to: http://localhost:4567"
198
- puts "3. Test the following features:"
199
- puts " • Dashboard loads with status overview"
200
- puts " • Navigation between pages works"
201
- puts " • Kanban board displays task columns"
202
- puts " • Agent spawning modal opens and functions"
203
- puts " • Auto-refresh updates data every 30 seconds"
204
- puts " • Responsive design works on mobile"
205
- puts
206
- puts "4. Check browser console for JavaScript errors"
207
- puts "5. Verify API endpoints return proper JSON:"
208
- puts " • GET /api/status"
209
- puts " • GET /api/tasks"
210
- puts " • GET /api/config"
211
- puts " • GET /api/project/analyze"
212
- puts " • POST /api/agents/spawn"
213
- puts
214
- end
215
-
216
- # Run tests
217
- puts "🚀 Starting Web UI Tests"
218
- puts
219
-
220
- all_passed = true
221
-
222
- all_passed &= test_web_ui_components
223
- all_passed &= test_api_integration
224
- all_passed &= test_cli_command
225
- all_passed &= test_file_contents
226
-
227
- if all_passed
228
- puts "\n🎉 All Web UI tests passed!"
229
- manual_ui_test_instructions
230
-
231
- puts "\n📋 UI Development Summary:"
232
- puts " ✅ Complete web-based interface created"
233
- puts " ✅ Task management kanban board implemented"
234
- puts " ✅ Agent monitoring dashboard built"
235
- puts " ✅ Project management features included"
236
- puts " ✅ Responsive design with modern UI/UX"
237
- puts " ✅ Real-time updates and notifications"
238
- puts " ✅ REST API backend for all functionality"
239
- puts " ✅ Integration with swarm-tasks gem"
240
- puts " ✅ Smart project analysis and defaults"
241
- puts
242
- puts "🎯 Ready for production use!"
243
- else
244
- puts "\n💥 Some Web UI tests failed!"
245
- end