openclacky 0.5.2 → 0.5.4
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 +13 -0
- data/README.md +2 -0
- data/Rakefile +1 -5
- data/lib/clacky/agent.rb +29 -19
- data/lib/clacky/cli.rb +23 -9
- data/lib/clacky/gitignore_parser.rb +114 -0
- data/lib/clacky/progress_indicator.rb +1 -0
- data/lib/clacky/tools/grep.rb +245 -30
- data/lib/clacky/ui/enhanced_prompt.rb +643 -0
- data/lib/clacky/version.rb +1 -1
- data/lib/clacky.rb +2 -1
- metadata +3 -2
- data/lib/clacky/ui/prompt.rb +0 -70
data/lib/clacky/ui/prompt.rb
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "readline"
|
|
4
|
-
require "pastel"
|
|
5
|
-
require "tty-screen"
|
|
6
|
-
|
|
7
|
-
module Clacky
|
|
8
|
-
module UI
|
|
9
|
-
# Enhanced input prompt with box drawing and status info
|
|
10
|
-
class Prompt
|
|
11
|
-
def initialize
|
|
12
|
-
@pastel = Pastel.new
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
# Read user input with enhanced prompt box
|
|
16
|
-
# @param prefix [String] Prompt prefix (default: "You:")
|
|
17
|
-
# @param placeholder [String] Placeholder text (not shown when using Readline)
|
|
18
|
-
# @return [String, nil] User input or nil on EOF
|
|
19
|
-
def read_input(prefix: "You:", placeholder: nil)
|
|
20
|
-
width = [TTY::Screen.width - 5, 70].min
|
|
21
|
-
|
|
22
|
-
# Display complete box frame first
|
|
23
|
-
puts @pastel.dim("╭" + "─" * width + "╮")
|
|
24
|
-
|
|
25
|
-
# Empty input line with borders (width - 2 for left/right padding)
|
|
26
|
-
padding = " " * (width - 2)
|
|
27
|
-
puts @pastel.dim("│ #{padding} │")
|
|
28
|
-
|
|
29
|
-
# Bottom border
|
|
30
|
-
puts @pastel.dim("╰" + "─" * width + "╯")
|
|
31
|
-
|
|
32
|
-
# Move cursor back up to input line (2 lines up)
|
|
33
|
-
print "\e[2A" # Move up 2 lines
|
|
34
|
-
print "\r" # Move to beginning of line
|
|
35
|
-
print "\e[2C" # Move right 2 chars to after "│ "
|
|
36
|
-
|
|
37
|
-
# Read input with Readline
|
|
38
|
-
prompt_text = @pastel.bright_blue("#{prefix} ")
|
|
39
|
-
input = read_with_readline(prompt_text)
|
|
40
|
-
|
|
41
|
-
# After input, clear the input box completely
|
|
42
|
-
# Move cursor up 2 lines to the top of the box
|
|
43
|
-
print "\e[2A"
|
|
44
|
-
print "\r"
|
|
45
|
-
|
|
46
|
-
# Clear all 3 lines of the box
|
|
47
|
-
3.times do
|
|
48
|
-
print "\e[2K" # Clear entire line
|
|
49
|
-
print "\e[1B" # Move down 1 line
|
|
50
|
-
print "\r" # Move to beginning of line
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
# Move cursor back up to where the box started
|
|
54
|
-
print "\e[3A"
|
|
55
|
-
print "\r"
|
|
56
|
-
|
|
57
|
-
input
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
private
|
|
61
|
-
|
|
62
|
-
def read_with_readline(prompt)
|
|
63
|
-
Readline.readline(prompt, true)
|
|
64
|
-
rescue Interrupt
|
|
65
|
-
puts
|
|
66
|
-
nil
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
end
|