aidp 0.9.6 → 0.10.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.
- checksums.yaml +4 -4
- data/lib/aidp/analyze/error_handler.rb +4 -2
- data/lib/aidp/{analysis → analyze}/kb_inspector.rb +106 -89
- data/lib/aidp/analyze/prioritizer.rb +3 -2
- data/lib/aidp/analyze/ruby_maat_integration.rb +20 -3
- data/lib/aidp/analyze/runner.rb +27 -9
- data/lib/aidp/{analysis → analyze}/seams.rb +1 -1
- data/lib/aidp/analyze/steps.rb +7 -7
- data/lib/aidp/{analysis → analyze}/tree_sitter_grammar_loader.rb +22 -5
- data/lib/aidp/{analysis → analyze}/tree_sitter_scan.rb +32 -15
- data/lib/aidp/cli/first_run_wizard.rb +37 -28
- data/lib/aidp/cli/jobs_command.rb +37 -18
- data/lib/aidp/cli/terminal_io.rb +3 -3
- data/lib/aidp/cli.rb +131 -63
- data/lib/aidp/execute/runner.rb +27 -9
- data/lib/aidp/execute/steps.rb +18 -18
- data/lib/aidp/execute/workflow_selector.rb +36 -21
- data/lib/aidp/harness/enhanced_runner.rb +3 -3
- data/lib/aidp/harness/provider_factory.rb +3 -1
- data/lib/aidp/harness/provider_manager.rb +34 -15
- data/lib/aidp/harness/runner.rb +24 -5
- data/lib/aidp/harness/simple_user_interface.rb +19 -4
- data/lib/aidp/harness/status_display.rb +121 -104
- data/lib/aidp/harness/ui/enhanced_tui.rb +5 -5
- data/lib/aidp/harness/ui/error_handler.rb +3 -2
- data/lib/aidp/harness/ui/frame_manager.rb +52 -32
- data/lib/aidp/harness/ui/navigation/main_menu.rb +23 -14
- data/lib/aidp/harness/ui/progress_display.rb +28 -5
- data/lib/aidp/harness/ui/status_widget.rb +17 -8
- data/lib/aidp/harness/ui/workflow_controller.rb +25 -9
- data/lib/aidp/harness/user_interface.rb +341 -328
- data/lib/aidp/provider_manager.rb +10 -6
- data/lib/aidp/providers/anthropic.rb +3 -3
- data/lib/aidp/providers/base.rb +20 -1
- data/lib/aidp/providers/cursor.rb +6 -8
- data/lib/aidp/providers/gemini.rb +3 -3
- data/lib/aidp/providers/github_copilot.rb +264 -0
- data/lib/aidp/providers/opencode.rb +6 -8
- data/lib/aidp/version.rb +1 -1
- data/lib/aidp.rb +4 -4
- metadata +6 -6
- data/lib/aidp/analyze/progress_visualizer.rb +0 -314
@@ -1,314 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "tty-spinner"
|
4
|
-
require "tty-progressbar"
|
5
|
-
require "tty-table"
|
6
|
-
require "pastel"
|
7
|
-
|
8
|
-
module Aidp
|
9
|
-
class ProgressVisualizer
|
10
|
-
# Progress bar styles
|
11
|
-
PROGRESS_STYLES = {
|
12
|
-
default: {complete: "█", incomplete: "░", head: "█"},
|
13
|
-
dots: {complete: "●", incomplete: "○", head: "●"},
|
14
|
-
blocks: {complete: "▓", incomplete: "░", head: "▓"},
|
15
|
-
arrows: {complete: "▶", incomplete: "▷", head: "▶"}
|
16
|
-
}.freeze
|
17
|
-
|
18
|
-
def initialize(config = {})
|
19
|
-
@config = config
|
20
|
-
@quiet = config[:quiet] || false
|
21
|
-
@style = config[:style] || :default
|
22
|
-
@show_details = config[:show_details] || true
|
23
|
-
@pastel = Pastel.new
|
24
|
-
end
|
25
|
-
|
26
|
-
# Display analysis progress
|
27
|
-
def show_analysis_progress(analysis_data, options = {})
|
28
|
-
return if @quiet
|
29
|
-
|
30
|
-
total_steps = analysis_data[:total_steps] || 1
|
31
|
-
current_step = analysis_data[:current_step] || 0
|
32
|
-
step_name = analysis_data[:current_step_name] || "Analyzing"
|
33
|
-
|
34
|
-
progress_bar = create_progress_bar(total_steps, step_name, options)
|
35
|
-
|
36
|
-
# Update progress
|
37
|
-
progress_bar.advance(current_step)
|
38
|
-
|
39
|
-
# Show step details if enabled
|
40
|
-
show_step_details(analysis_data[:step_details]) if @show_details && analysis_data[:step_details]
|
41
|
-
|
42
|
-
progress_bar
|
43
|
-
end
|
44
|
-
|
45
|
-
# Display step progress
|
46
|
-
def show_step_progress(step_name, progress_data, options = {})
|
47
|
-
return if @quiet
|
48
|
-
|
49
|
-
total_items = progress_data[:total_items] || 1
|
50
|
-
processed_items = progress_data[:processed_items] || 0
|
51
|
-
current_item = progress_data[:current_item] || ""
|
52
|
-
|
53
|
-
progress_bar = create_progress_bar(total_items, "#{step_name}: #{current_item}", options)
|
54
|
-
progress_bar.advance(processed_items)
|
55
|
-
|
56
|
-
progress_bar
|
57
|
-
end
|
58
|
-
|
59
|
-
# Display spinner for long-running operations
|
60
|
-
def show_spinner(message, options = {})
|
61
|
-
return if @quiet
|
62
|
-
|
63
|
-
spinner = TTY::Spinner.new(message, format: :dots)
|
64
|
-
spinner.start
|
65
|
-
spinner
|
66
|
-
end
|
67
|
-
|
68
|
-
# Display analysis status table
|
69
|
-
def show_analysis_status(status_data, options = {})
|
70
|
-
return if @quiet
|
71
|
-
|
72
|
-
table = create_status_table(status_data)
|
73
|
-
puts table.render(:ascii)
|
74
|
-
end
|
75
|
-
|
76
|
-
# Display analysis summary
|
77
|
-
def show_analysis_summary(summary_data, options = {})
|
78
|
-
return if @quiet
|
79
|
-
|
80
|
-
puts "\n" + "=" * 60
|
81
|
-
puts "ANALYSIS SUMMARY".center(60)
|
82
|
-
puts "=" * 60
|
83
|
-
|
84
|
-
# Overall statistics
|
85
|
-
puts "📊 Overall Statistics:"
|
86
|
-
puts " • Total Steps: #{summary_data[:total_steps]}"
|
87
|
-
puts " • Completed Steps: #{summary_data[:completed_steps]}"
|
88
|
-
puts " • Failed Steps: #{summary_data[:failed_steps]}"
|
89
|
-
puts " • Duration: #{format_duration(summary_data[:duration])}"
|
90
|
-
|
91
|
-
# Step details
|
92
|
-
if summary_data[:step_details]
|
93
|
-
puts "\n📋 Step Details:"
|
94
|
-
summary_data[:step_details].each do |step|
|
95
|
-
status_icon = if step[:status] == "completed"
|
96
|
-
"✅"
|
97
|
-
else
|
98
|
-
(step[:status] == "failed") ? "❌" : "⏳"
|
99
|
-
end
|
100
|
-
puts " #{status_icon} #{step[:name]}: #{format_duration(step[:duration])}"
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
# Metrics summary
|
105
|
-
if summary_data[:metrics]
|
106
|
-
puts "\n📈 Metrics Summary:"
|
107
|
-
summary_data[:metrics].each do |metric, value|
|
108
|
-
puts " • #{metric}: #{value}"
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
puts "=" * 60
|
113
|
-
end
|
114
|
-
|
115
|
-
# Display incremental analysis status
|
116
|
-
def show_incremental_status(status_data, options = {})
|
117
|
-
return if @quiet
|
118
|
-
|
119
|
-
puts "\n🔄 Incremental Analysis Status"
|
120
|
-
puts "-" * 40
|
121
|
-
|
122
|
-
coverage = status_data[:analysis_coverage] || 0
|
123
|
-
coverage_color = if coverage >= 0.8
|
124
|
-
:green
|
125
|
-
else
|
126
|
-
(coverage >= 0.6) ? :yellow : :red
|
127
|
-
end
|
128
|
-
|
129
|
-
puts "📁 Total Components: #{status_data[:total_components]}"
|
130
|
-
puts "✅ Analyzed Components: #{status_data[:analyzed_components]}"
|
131
|
-
puts "⏳ Pending Components: #{status_data[:pending_components]}"
|
132
|
-
puts "📊 Coverage: #{coverage_colorize(coverage * 100, coverage_color)}%"
|
133
|
-
|
134
|
-
return unless status_data[:last_analysis]
|
135
|
-
|
136
|
-
puts "🕒 Last Analysis: #{status_data[:last_analysis].strftime("%Y-%m-%d %H:%M:%S")}"
|
137
|
-
end
|
138
|
-
|
139
|
-
# Display recommendations
|
140
|
-
def show_recommendations(recommendations, options = {})
|
141
|
-
return if @quiet
|
142
|
-
|
143
|
-
puts "\n💡 Recommendations"
|
144
|
-
puts "-" * 30
|
145
|
-
|
146
|
-
recommendations.each_with_index do |rec, index|
|
147
|
-
priority_color = case rec[:priority]
|
148
|
-
when "high"
|
149
|
-
:red
|
150
|
-
when "medium"
|
151
|
-
:yellow
|
152
|
-
when "low"
|
153
|
-
:green
|
154
|
-
else
|
155
|
-
:white
|
156
|
-
end
|
157
|
-
|
158
|
-
puts "#{index + 1}. #{priority_colorize(rec[:message], priority_color)}"
|
159
|
-
puts " Action: #{rec[:action]}"
|
160
|
-
puts
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
# Display error summary
|
165
|
-
def show_error_summary(errors, options = {})
|
166
|
-
return if @quiet
|
167
|
-
|
168
|
-
puts "\n❌ Error Summary"
|
169
|
-
puts "-" * 20
|
170
|
-
|
171
|
-
errors.each_with_index do |error, index|
|
172
|
-
puts "#{index + 1}. #{error[:step] || "Unknown step"}: #{error[:message]}"
|
173
|
-
puts " Details: #{error[:details]}" if error[:details]
|
174
|
-
puts
|
175
|
-
end
|
176
|
-
end
|
177
|
-
|
178
|
-
# Display real-time progress
|
179
|
-
def show_realtime_progress(progress_data, options = {})
|
180
|
-
return if @quiet
|
181
|
-
|
182
|
-
# Clear previous line
|
183
|
-
print "\r\e[K"
|
184
|
-
|
185
|
-
# Show current progress
|
186
|
-
percentage = progress_data[:percentage] || 0
|
187
|
-
message = progress_data[:message] || "Processing"
|
188
|
-
|
189
|
-
progress_bar = create_simple_progress_bar(percentage, message)
|
190
|
-
print progress_bar
|
191
|
-
|
192
|
-
# Flush output
|
193
|
-
$stdout.flush
|
194
|
-
end
|
195
|
-
|
196
|
-
# Display completion message
|
197
|
-
def show_completion_message(message, options = {})
|
198
|
-
return if @quiet
|
199
|
-
|
200
|
-
success = options[:success] || true
|
201
|
-
icon = success ? "✅" : "❌"
|
202
|
-
color = success ? :green : :red
|
203
|
-
|
204
|
-
puts "\n#{icon} #{colorize(message, color)}"
|
205
|
-
end
|
206
|
-
|
207
|
-
# Display warning message
|
208
|
-
def show_warning_message(message, options = {})
|
209
|
-
return if @quiet
|
210
|
-
|
211
|
-
puts "\n⚠️ #{colorize(message, :yellow)}"
|
212
|
-
end
|
213
|
-
|
214
|
-
# Display info message
|
215
|
-
def show_info_message(message, options = {})
|
216
|
-
return if @quiet
|
217
|
-
|
218
|
-
puts "\nℹ️ #{colorize(message, :blue)}"
|
219
|
-
end
|
220
|
-
|
221
|
-
private
|
222
|
-
|
223
|
-
def create_progress_bar(total, title, options = {})
|
224
|
-
style = options[:style] || @style
|
225
|
-
PROGRESS_STYLES[style] || PROGRESS_STYLES[:default]
|
226
|
-
|
227
|
-
# Use TTY progress bar
|
228
|
-
TTY::ProgressBar.new(
|
229
|
-
"[:bar] :percent% :current/:total",
|
230
|
-
total: total,
|
231
|
-
width: 30
|
232
|
-
)
|
233
|
-
end
|
234
|
-
|
235
|
-
def create_simple_progress_bar(percentage, message)
|
236
|
-
width = 30
|
237
|
-
filled = (percentage * width / 100).to_i
|
238
|
-
empty = width - filled
|
239
|
-
|
240
|
-
bar = "█" * filled + "░" * empty
|
241
|
-
"#{message}: [#{bar}] #{percentage.round(1)}%"
|
242
|
-
end
|
243
|
-
|
244
|
-
def create_status_table(status_data)
|
245
|
-
headers = %w[Step Status Duration Progress]
|
246
|
-
rows = []
|
247
|
-
|
248
|
-
status_data[:steps]&.each do |step|
|
249
|
-
status_icon = case step[:status]
|
250
|
-
when "completed"
|
251
|
-
"✅"
|
252
|
-
when "failed"
|
253
|
-
"❌"
|
254
|
-
when "running"
|
255
|
-
"⏳"
|
256
|
-
else
|
257
|
-
"⏸️"
|
258
|
-
end
|
259
|
-
|
260
|
-
rows << [
|
261
|
-
step[:name],
|
262
|
-
"#{status_icon} #{step[:status]}",
|
263
|
-
format_duration(step[:duration]),
|
264
|
-
step[:progress] ? "#{step[:progress]}%" : "N/A"
|
265
|
-
]
|
266
|
-
end
|
267
|
-
|
268
|
-
# Use TTY::Table for table display
|
269
|
-
table = TTY::Table.new(headers, rows)
|
270
|
-
puts table.render(:ascii)
|
271
|
-
end
|
272
|
-
|
273
|
-
def show_step_details(step_details)
|
274
|
-
puts "\n📝 Current Step Details:"
|
275
|
-
step_details.each do |key, value|
|
276
|
-
puts " • #{key}: #{value}"
|
277
|
-
end
|
278
|
-
end
|
279
|
-
|
280
|
-
def format_duration(seconds)
|
281
|
-
return "N/A" unless seconds
|
282
|
-
|
283
|
-
if seconds < 60
|
284
|
-
"#{seconds.round(1)}s"
|
285
|
-
elsif seconds < 3600
|
286
|
-
minutes = (seconds / 60).to_i
|
287
|
-
remaining_seconds = (seconds % 60).round(1)
|
288
|
-
"#{minutes}m #{remaining_seconds}s"
|
289
|
-
else
|
290
|
-
hours = (seconds / 3600).to_i
|
291
|
-
remaining_minutes = ((seconds % 3600) / 60).to_i
|
292
|
-
"#{hours}h #{remaining_minutes}m"
|
293
|
-
end
|
294
|
-
end
|
295
|
-
|
296
|
-
def colorize(text, color)
|
297
|
-
return text unless @pastel
|
298
|
-
|
299
|
-
@pastel.decorate(text.to_s, color)
|
300
|
-
end
|
301
|
-
|
302
|
-
def coverage_colorize(percentage, color)
|
303
|
-
return percentage unless @pastel
|
304
|
-
|
305
|
-
@pastel.decorate(percentage.to_s, color)
|
306
|
-
end
|
307
|
-
|
308
|
-
def priority_colorize(text, color)
|
309
|
-
return text unless @pastel
|
310
|
-
|
311
|
-
@pastel.decorate(text.to_s, color)
|
312
|
-
end
|
313
|
-
end
|
314
|
-
end
|