openclacky 0.5.4 → 0.5.6
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/.clackyrules +4 -0
- data/README.md +1 -1
- data/lib/clacky/agent.rb +190 -19
- data/lib/clacky/cli.rb +126 -141
- data/lib/clacky/client.rb +53 -7
- data/lib/clacky/model_pricing.rb +280 -0
- data/lib/clacky/progress_indicator.rb +1 -1
- data/lib/clacky/tools/file_reader.rb +73 -10
- data/lib/clacky/tools/grep.rb +74 -7
- data/lib/clacky/tools/safe_shell.rb +9 -4
- data/lib/clacky/tools/shell.rb +60 -22
- data/lib/clacky/ui/banner.rb +22 -11
- data/lib/clacky/ui/enhanced_prompt.rb +366 -223
- data/lib/clacky/ui/formatter.rb +1 -1
- data/lib/clacky/ui/statusbar.rb +0 -2
- data/lib/clacky/version.rb +1 -1
- data/lib/clacky.rb +1 -1
- metadata +2 -2
- data/lib/clacky/conversation.rb +0 -41
data/lib/clacky/ui/formatter.rb
CHANGED
data/lib/clacky/ui/statusbar.rb
CHANGED
|
@@ -45,14 +45,12 @@ module Clacky
|
|
|
45
45
|
status_line = " " + parts.join(separator)
|
|
46
46
|
|
|
47
47
|
puts status_line
|
|
48
|
-
puts @pastel.dim("─" * [TTY::Screen.width, 80].min)
|
|
49
48
|
end
|
|
50
49
|
|
|
51
50
|
# Display minimal status for non-interactive mode
|
|
52
51
|
def display_minimal(working_dir:, mode:)
|
|
53
52
|
dir_display = shorten_path(working_dir)
|
|
54
53
|
puts " #{@pastel.bright_cyan(dir_display)} #{@pastel.dim('│')} #{@pastel.yellow(mode)}"
|
|
55
|
-
puts @pastel.dim("─" * [TTY::Screen.width, 80].min)
|
|
56
54
|
end
|
|
57
55
|
|
|
58
56
|
private
|
data/lib/clacky/version.rb
CHANGED
data/lib/clacky.rb
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
require_relative "clacky/version"
|
|
4
4
|
require_relative "clacky/config"
|
|
5
5
|
require_relative "clacky/client"
|
|
6
|
-
require_relative "clacky/conversation"
|
|
7
6
|
|
|
8
7
|
# Agent system
|
|
8
|
+
require_relative "clacky/model_pricing"
|
|
9
9
|
require_relative "clacky/agent_config"
|
|
10
10
|
require_relative "clacky/hook_manager"
|
|
11
11
|
require_relative "clacky/tool_registry"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openclacky
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- windy
|
|
@@ -136,9 +136,9 @@ files:
|
|
|
136
136
|
- lib/clacky/cli.rb
|
|
137
137
|
- lib/clacky/client.rb
|
|
138
138
|
- lib/clacky/config.rb
|
|
139
|
-
- lib/clacky/conversation.rb
|
|
140
139
|
- lib/clacky/gitignore_parser.rb
|
|
141
140
|
- lib/clacky/hook_manager.rb
|
|
141
|
+
- lib/clacky/model_pricing.rb
|
|
142
142
|
- lib/clacky/progress_indicator.rb
|
|
143
143
|
- lib/clacky/session_manager.rb
|
|
144
144
|
- lib/clacky/thinking_verbs.rb
|
data/lib/clacky/conversation.rb
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Clacky
|
|
4
|
-
class Conversation
|
|
5
|
-
attr_reader :messages
|
|
6
|
-
|
|
7
|
-
def initialize(api_key, model:, base_url:, max_tokens:)
|
|
8
|
-
@client = Client.new(api_key, base_url: base_url)
|
|
9
|
-
@model = model
|
|
10
|
-
@max_tokens = max_tokens
|
|
11
|
-
@messages = []
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def send_message(content)
|
|
15
|
-
# Add user message to history
|
|
16
|
-
@messages << {
|
|
17
|
-
role: "user",
|
|
18
|
-
content: content
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
# Get response from Claude
|
|
22
|
-
response_text = @client.send_messages(@messages, model: @model, max_tokens: @max_tokens)
|
|
23
|
-
|
|
24
|
-
# Add assistant response to history
|
|
25
|
-
@messages << {
|
|
26
|
-
role: "assistant",
|
|
27
|
-
content: response_text
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
response_text
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def clear
|
|
34
|
-
@messages = []
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def history
|
|
38
|
-
@messages.dup
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|