openclacky 0.6.0 → 0.6.2
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/CHANGELOG.md +54 -0
- data/README.md +39 -88
- data/homebrew/README.md +96 -0
- data/homebrew/openclacky.rb +24 -0
- data/lib/clacky/agent.rb +139 -67
- data/lib/clacky/cli.rb +105 -6
- data/lib/clacky/tools/file_reader.rb +135 -2
- data/lib/clacky/tools/glob.rb +2 -2
- data/lib/clacky/tools/grep.rb +2 -2
- data/lib/clacky/tools/run_project.rb +5 -5
- data/lib/clacky/tools/safe_shell.rb +140 -17
- data/lib/clacky/tools/shell.rb +69 -2
- data/lib/clacky/tools/todo_manager.rb +50 -3
- data/lib/clacky/tools/trash_manager.rb +1 -1
- data/lib/clacky/tools/web_fetch.rb +2 -2
- data/lib/clacky/tools/web_search.rb +2 -2
- data/lib/clacky/ui2/components/common_component.rb +14 -5
- data/lib/clacky/ui2/components/input_area.rb +300 -89
- data/lib/clacky/ui2/components/message_component.rb +7 -3
- data/lib/clacky/ui2/components/todo_area.rb +38 -45
- data/lib/clacky/ui2/components/welcome_banner.rb +10 -0
- data/lib/clacky/ui2/layout_manager.rb +180 -50
- data/lib/clacky/ui2/markdown_renderer.rb +80 -0
- data/lib/clacky/ui2/screen_buffer.rb +26 -7
- data/lib/clacky/ui2/themes/base_theme.rb +32 -46
- data/lib/clacky/ui2/themes/hacker_theme.rb +4 -2
- data/lib/clacky/ui2/themes/minimal_theme.rb +4 -2
- data/lib/clacky/ui2/ui_controller.rb +150 -32
- data/lib/clacky/ui2/view_renderer.rb +21 -4
- data/lib/clacky/ui2.rb +0 -1
- data/lib/clacky/utils/arguments_parser.rb +7 -2
- data/lib/clacky/utils/file_processor.rb +201 -0
- data/lib/clacky/version.rb +1 -1
- data/scripts/install.sh +249 -0
- data/scripts/uninstall.sh +146 -0
- metadata +21 -2
- data/lib/clacky/ui2/components/output_area.rb +0 -112
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "pastel"
|
|
4
|
-
|
|
5
|
-
module Clacky
|
|
6
|
-
module UI2
|
|
7
|
-
module Components
|
|
8
|
-
# OutputArea writes content directly to terminal
|
|
9
|
-
# Terminal handles scrolling natively via scrollback buffer
|
|
10
|
-
class OutputArea
|
|
11
|
-
attr_accessor :height
|
|
12
|
-
|
|
13
|
-
def initialize(height:)
|
|
14
|
-
@height = height
|
|
15
|
-
@pastel = Pastel.new
|
|
16
|
-
@width = TTY::Screen.width
|
|
17
|
-
@last_line_row = nil # Track last line position for updates
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# Append single line content directly to terminal (no newline)
|
|
21
|
-
# Multi-line handling is done by LayoutManager
|
|
22
|
-
# @param content [String] Single line content to append
|
|
23
|
-
def append(content)
|
|
24
|
-
return if content.nil? || content.empty?
|
|
25
|
-
|
|
26
|
-
update_width
|
|
27
|
-
print wrap_line(content)
|
|
28
|
-
flush
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
# Initial render - no-op, output flows naturally
|
|
32
|
-
# @param start_row [Integer] Screen row (ignored)
|
|
33
|
-
def render(start_row:)
|
|
34
|
-
# No-op - output flows naturally from current position
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
# Update the last line (for progress indicator)
|
|
38
|
-
# Uses carriage return to overwrite current line
|
|
39
|
-
# @param content [String] New content for last line
|
|
40
|
-
def update_last_line(content)
|
|
41
|
-
print "\r"
|
|
42
|
-
clear_line
|
|
43
|
-
print truncate_line(content)
|
|
44
|
-
flush
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
# Remove the last line from output
|
|
48
|
-
def remove_last_line
|
|
49
|
-
print "\r"
|
|
50
|
-
clear_line
|
|
51
|
-
flush
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
# Clear - no-op for natural scroll mode
|
|
55
|
-
def clear
|
|
56
|
-
# No-op
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
# Legacy scroll methods (no-op, terminal handles scrolling)
|
|
60
|
-
def scroll_up(lines = 1); end
|
|
61
|
-
def scroll_down(lines = 1); end
|
|
62
|
-
def scroll_to_top; end
|
|
63
|
-
def scroll_to_bottom; end
|
|
64
|
-
def at_bottom?; true; end
|
|
65
|
-
def scroll_percentage; 0.0; end
|
|
66
|
-
|
|
67
|
-
def visible_range
|
|
68
|
-
{ start: 1, end: @height, total: @height }
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
private
|
|
72
|
-
|
|
73
|
-
# Wrap line to fit screen width (auto line wrap)
|
|
74
|
-
def wrap_line(line)
|
|
75
|
-
return "" if line.nil?
|
|
76
|
-
# Let terminal handle line wrapping naturally
|
|
77
|
-
line
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
# Truncate line to fit screen width
|
|
81
|
-
def truncate_line(line)
|
|
82
|
-
return "" if line.nil?
|
|
83
|
-
|
|
84
|
-
visible_length = line.gsub(/\e\[[0-9;]*m/, "").length
|
|
85
|
-
|
|
86
|
-
if visible_length > @width
|
|
87
|
-
truncated = line[0...(@width - 3)]
|
|
88
|
-
truncated + @pastel.dim("...")
|
|
89
|
-
else
|
|
90
|
-
line
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
def update_width
|
|
95
|
-
@width = TTY::Screen.width
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def move_cursor(row, col)
|
|
99
|
-
print "\e[#{row + 1};#{col + 1}H"
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
def clear_line
|
|
103
|
-
print "\e[2K"
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
def flush
|
|
107
|
-
$stdout.flush
|
|
108
|
-
end
|
|
109
|
-
end
|
|
110
|
-
end
|
|
111
|
-
end
|
|
112
|
-
end
|