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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +54 -0
  3. data/README.md +39 -88
  4. data/homebrew/README.md +96 -0
  5. data/homebrew/openclacky.rb +24 -0
  6. data/lib/clacky/agent.rb +139 -67
  7. data/lib/clacky/cli.rb +105 -6
  8. data/lib/clacky/tools/file_reader.rb +135 -2
  9. data/lib/clacky/tools/glob.rb +2 -2
  10. data/lib/clacky/tools/grep.rb +2 -2
  11. data/lib/clacky/tools/run_project.rb +5 -5
  12. data/lib/clacky/tools/safe_shell.rb +140 -17
  13. data/lib/clacky/tools/shell.rb +69 -2
  14. data/lib/clacky/tools/todo_manager.rb +50 -3
  15. data/lib/clacky/tools/trash_manager.rb +1 -1
  16. data/lib/clacky/tools/web_fetch.rb +2 -2
  17. data/lib/clacky/tools/web_search.rb +2 -2
  18. data/lib/clacky/ui2/components/common_component.rb +14 -5
  19. data/lib/clacky/ui2/components/input_area.rb +300 -89
  20. data/lib/clacky/ui2/components/message_component.rb +7 -3
  21. data/lib/clacky/ui2/components/todo_area.rb +38 -45
  22. data/lib/clacky/ui2/components/welcome_banner.rb +10 -0
  23. data/lib/clacky/ui2/layout_manager.rb +180 -50
  24. data/lib/clacky/ui2/markdown_renderer.rb +80 -0
  25. data/lib/clacky/ui2/screen_buffer.rb +26 -7
  26. data/lib/clacky/ui2/themes/base_theme.rb +32 -46
  27. data/lib/clacky/ui2/themes/hacker_theme.rb +4 -2
  28. data/lib/clacky/ui2/themes/minimal_theme.rb +4 -2
  29. data/lib/clacky/ui2/ui_controller.rb +150 -32
  30. data/lib/clacky/ui2/view_renderer.rb +21 -4
  31. data/lib/clacky/ui2.rb +0 -1
  32. data/lib/clacky/utils/arguments_parser.rb +7 -2
  33. data/lib/clacky/utils/file_processor.rb +201 -0
  34. data/lib/clacky/version.rb +1 -1
  35. data/scripts/install.sh +249 -0
  36. data/scripts/uninstall.sh +146 -0
  37. metadata +21 -2
  38. data/lib/clacky/ui2/components/output_area.rb +0 -112
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf44c03777d71d011e78e17171352ea824da23fa3cc5bcb09c8ba985134ea28e
4
- data.tar.gz: bafeeb81f93b770c2929c9a71a11fd8ed8f344251d284d10031023c41390f73b
3
+ metadata.gz: 84e359dab8c2113e7b9160f92eadff62872bce2a1c1713abee9a2cbf4cac80b1
4
+ data.tar.gz: 604a48aaa45cf5bc79667e9fbd0792626aa578b65d7d0a8b06c5548759d3de39
5
5
  SHA512:
6
- metadata.gz: 8d4be2efc7721ec808722faa943d3fe99e4a074bebdaf710be79c8b55cfc1ef5f6757ddf33f5c37dc63ebe020bbd135f98b19d3be287121756d020b86fdd3e8f
7
- data.tar.gz: cb451f53e1d1c589760c1bfccfd530faa9bfafa22d1b3e6aaca1a03813dd5bc524fb3c12037c3f0fd84cf18c8a76d71d6e6fc02421bd7e314cde8b0d783156b5
6
+ metadata.gz: 8c037ed1835e6295338b3136795d8be58ad3ae3654d6174c85cc7b05e237094fa8a39c96ec26c16106c6ff2ef382f7e5c88aca8b01da7e0b891ec438c579fd17
7
+ data.tar.gz: ebdd5c9a65cd21fdc7fb47743f3c6b9b5ce9fd0552fabb1a0a1c02554da8c91b9464718e1fd01f5dc18593740c22377ca67e132fd5c4ab67183166a878b039b7
data/CHANGELOG.md CHANGED
@@ -7,6 +7,60 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.6.2] - 2026-01-30
11
+
12
+ ### Added
13
+ - `--theme` CLI option to switch UI themes (hacker, minimal)
14
+ - Support for reading binary files (with 5MB limit)
15
+ - Cost color coding for better visibility
16
+ - Install script for easier installation
17
+ - New command handling improvements
18
+
19
+ ### Improved
20
+ - User input style enhancements
21
+ - Tool execution output simplification
22
+ - Thinking mode output improvements
23
+ - Diff format display with cleaner line numbers
24
+ - Terminal resize handling
25
+
26
+ ### Fixed
27
+ - BadQuotedString parsing error
28
+ - Token counting for every new task
29
+ - Shell output max characters limit
30
+ - Inline input cursor positioning
31
+ - Compress message display (now hidden)
32
+
33
+ ### Removed
34
+ - Redundant output components for cleaner architecture
35
+
36
+ ## [0.6.1] - 2026-01-29
37
+
38
+ ### Added
39
+ - User tips for better guidance and feedback
40
+ - Batch TODO operations for improved task management
41
+ - Markdown output support for better formatted responses
42
+ - Text style customization options
43
+
44
+ ### Improved
45
+ - Tool execution with slow progress indicators for long-running operations
46
+ - Progress UI refinements for better visual feedback
47
+ - Session restore now shows recent messages for context
48
+ - TODO area UI enhancements with auto-hide when all tasks completed
49
+ - Work status bar styling improvements
50
+ - Text wrapping when moving input to output area
51
+ - Safe shell output improvements for better readability
52
+ - Task info display optimization (only show essential information)
53
+ - TODO list cleanup and organization
54
+
55
+ ### Fixed
56
+ - Double paste bug causing duplicate input
57
+ - Double error message display issue
58
+ - TODO clear functionality
59
+ - RSpec test hanging issues
60
+
61
+ ### Removed
62
+ - Tool emoji from output for cleaner display
63
+
10
64
  ## [0.6.0] - 2026-01-28
11
65
 
12
66
  ### Added
data/README.md CHANGED
@@ -18,19 +18,36 @@ OpenClacky = Lovable + Supabase
18
18
 
19
19
  ## Installation
20
20
 
21
- Install the gem by executing:
21
+ ### Quick Install (Recommended)
22
+
23
+ **One-line installation** (auto-detects your system):
22
24
 
23
25
  ```bash
24
- gem install openclacky
26
+ curl -sSL https://raw.githubusercontent.com/clacky-ai/open-clacky/main/scripts/install.sh | bash
25
27
  ```
26
28
 
27
- Or add it to your Gemfile:
29
+ This script will:
30
+ - Check your Ruby version
31
+ - Install via Homebrew (macOS) if available
32
+ - Install via RubyGems if Ruby >= 3.1.0 is installed
33
+ - Guide you to install Ruby if needed
34
+
35
+ ### Method 1: Homebrew (macOS/Linux)
36
+
37
+ **Best for macOS users** - Automatically handles Ruby dependencies:
28
38
 
29
39
  ```bash
30
- bundle add openclacky
40
+ brew tap clacky-ai/openclacky
41
+ brew install openclacky
31
42
  ```
32
43
 
33
- For development from source:
44
+ ### Method 2: RubyGems (If you already have Ruby >= 3.1.0)
45
+
46
+ ```bash
47
+ gem install openclacky
48
+ ```
49
+
50
+ ### Method 3: From Source (For Development)
34
51
 
35
52
  ```bash
36
53
  git clone https://github.com/clacky-ai/open-clacky.git
@@ -39,6 +56,22 @@ bundle install
39
56
  bin/clacky
40
57
  ```
41
58
 
59
+ ### System Requirements
60
+
61
+ - **Ruby**: >= 3.1.0 (automatically handled by Homebrew)
62
+ - **OS**: macOS, Linux, or Windows (WSL)
63
+
64
+ ### Uninstallation
65
+
66
+ ```bash
67
+ # Quick uninstall
68
+ curl -sSL https://raw.githubusercontent.com/clacky-ai/open-clacky/main/scripts/uninstall.sh | bash
69
+
70
+ # Or manually
71
+ brew uninstall openclacky # If installed via Homebrew
72
+ gem uninstall openclacky # If installed via gem
73
+ ```
74
+
42
75
  ## Configuration
43
76
 
44
77
  Before using Clacky, you need to configure your settings:
@@ -60,32 +93,6 @@ clacky config show
60
93
 
61
94
  ## Usage
62
95
 
63
- ### Interactive Chat Mode
64
-
65
- Start an interactive chat session:
66
-
67
- ```bash
68
- clacky chat
69
- ```
70
-
71
- Type your messages and press Enter. Type `exit` or `quit` to end the session.
72
-
73
- ### Single Message Mode
74
-
75
- Send a single message and get a response:
76
-
77
- ```bash
78
- clacky chat "What is Ruby?"
79
- ```
80
-
81
- ### Specify Model
82
-
83
- You can specify which model to use (overrides config):
84
-
85
- ```bash
86
- clacky chat --model=gpt-4 "Hello!"
87
- ```
88
-
89
96
  ### AI Agent Mode (Interactive)
90
97
 
91
98
  Run an autonomous AI agent in interactive mode. The agent can use tools to complete tasks and runs in a continuous loop, allowing you to have multi-turn conversations with tool use capabilities.
@@ -103,22 +110,10 @@ clacky agent --mode=auto_approve
103
110
  # Work in a specific project directory
104
111
  clacky agent --path /path/to/project
105
112
 
106
- # Limit tools available to the agent
107
- clacky agent --tools file_reader glob grep
108
- ```
109
-
110
- The agent will:
111
- 1. Complete each task using its React (Reason-Act-Observe) cycle
112
- 2. Show you the results
113
- 3. Wait for your next instruction
114
- 4. Maintain conversation context across tasks
115
- 5. Type 'exit' or 'quit' to end the session
116
-
117
113
  #### Permission Modes
118
114
 
119
- - `confirm_all` (default) - Confirm every tool use
120
- - `confirm_edits` - Auto-approve read-only tools, confirm edits
121
115
  - `auto_approve` - Automatically execute all tools (use with caution)
116
+ - `confirm_safes` - Auto-approve read-only tools, confirm edits
122
117
  - `plan_only` - Generate plan without executing
123
118
 
124
119
  #### Agent Options
@@ -126,9 +121,6 @@ The agent will:
126
121
  ```bash
127
122
  --path PATH # Project directory (defaults to current directory)
128
123
  --mode MODE # Permission mode
129
- --tools TOOL1 TOOL2 # Allowed tools (or "all")
130
- --max-iterations N # Maximum iterations (default: 50)
131
- --max-cost N # Maximum cost in USD (default: 5.0)
132
124
  --verbose # Show detailed output
133
125
  ```
134
126
 
@@ -138,30 +130,17 @@ The agent includes intelligent cost control features:
138
130
 
139
131
  - **Automatic Message Compression**: When conversation history grows beyond 100 messages, the agent automatically compresses older messages into a summary, keeping only the system prompt and the most recent 20 messages. This dramatically reduces token costs for long-running tasks (achieves ~60% compression ratio).
140
132
 
141
- - **Configurable Limits**:
142
- - `max_iterations`: Maximum number of agent loops (default: 200)
143
- - `max_cost_usd`: Maximum total cost in USD (default: $5.00)
144
- - `timeout_seconds`: Maximum execution time (default: none)
145
-
146
133
  - **Compression Settings**:
147
134
  - `enable_compression`: Enable/disable automatic compression (default: true)
148
135
  - `keep_recent_messages`: Number of recent messages to preserve (default: 20)
149
136
  - Compression triggers at: ~100 messages (keep_recent_messages + 80)
150
137
 
151
- Example with custom limits:
152
- ```bash
153
- clacky agent --max-iterations=100 --max-cost=10.0 --verbose
154
- ```
155
-
156
138
  ### List Available Tools
157
139
 
158
140
  View all built-in tools:
159
141
 
160
142
  ```bash
161
143
  clacky tools
162
-
163
- # Filter by category
164
- clacky tools --category file_system
165
144
  ```
166
145
 
167
146
  #### Built-in Tools
@@ -173,14 +152,12 @@ clacky tools --category file_system
173
152
  - **glob** - Find files by pattern matching
174
153
  - **grep** - Search file contents with regex
175
154
  - **shell** - Execute shell commands
176
- - **calculator** - Perform mathematical calculations
177
155
  - **web_search** - Search the web for information
178
156
  - **web_fetch** - Fetch and parse web page content
179
157
 
180
158
  ### Available Commands
181
159
 
182
160
  ```bash
183
- clacky chat [MESSAGE] # Start a chat or send a single message
184
161
  clacky agent [MESSAGE] # Run autonomous agent with tool use
185
162
  clacky tools # List available tools
186
163
  clacky config set # Set your API key
@@ -191,19 +168,6 @@ clacky help # Show help information
191
168
 
192
169
  ## Examples
193
170
 
194
- ### Chat Examples
195
-
196
- ```bash
197
- # Quick question
198
- clacky chat "Explain closures in Ruby"
199
-
200
- # Start interactive session
201
- clacky chat
202
-
203
- # Check version
204
- clacky version
205
- ```
206
-
207
171
  ### Agent Examples
208
172
 
209
173
  ```bash
@@ -214,25 +178,12 @@ clacky agent
214
178
  # > Now add more items to the TODO list
215
179
  # > exit
216
180
 
217
- # Start with initial task, then continue
218
- clacky agent "Add a .gitignore file for Ruby projects"
219
- # After completing, agent waits for next task
220
- # > List all Ruby files
221
- # > Count lines in each file
222
- # > exit
223
-
224
181
  # Auto-approve mode for trusted operations
225
182
  clacky agent --mode=auto_approve --path ~/my-project
226
183
  # > Count all lines of code
227
184
  # > Create a summary report
228
185
  # > exit
229
186
 
230
- # Use specific tools only in interactive mode
231
- clacky agent --tools file_reader glob grep
232
- # > Find all TODO comments
233
- # > Search for FIXME comments
234
- # > exit
235
-
236
187
  # Using TODO manager for complex tasks
237
188
  clacky agent "Implement a new feature with user authentication"
238
189
  # Agent will:
@@ -0,0 +1,96 @@
1
+ # Homebrew Formula for OpenClacky
2
+
3
+ This directory contains the Homebrew formula for OpenClacky.
4
+
5
+ ## For Maintainers: Publishing to Homebrew Tap
6
+
7
+ ### One-time Setup
8
+
9
+ 1. Create a GitHub repository named `homebrew-openclacky` (must start with `homebrew-`)
10
+ 2. Push this formula to the repository
11
+
12
+ ```bash
13
+ # In your GitHub account, create: homebrew-openclacky
14
+ git clone https://github.com/YOUR_USERNAME/homebrew-openclacky.git
15
+ cd homebrew-openclacky
16
+ cp /path/to/openclacky/homebrew/openclacky.rb ./Formula/openclacky.rb
17
+ git add Formula/openclacky.rb
18
+ git commit -m "Add openclacky formula"
19
+ git push origin main
20
+ ```
21
+
22
+ ### Update Formula for New Release
23
+
24
+ When you release a new version:
25
+
26
+ 1. Download the new gem and calculate SHA256:
27
+ ```bash
28
+ VERSION=0.6.1
29
+ wget https://rubygems.org/downloads/openclacky-${VERSION}.gem
30
+ shasum -a 256 openclacky-${VERSION}.gem
31
+ ```
32
+
33
+ 2. Update the formula in `homebrew-openclacky` repository:
34
+ - Update `url` with new version
35
+ - Update `sha256` with calculated hash
36
+ - Commit and push
37
+
38
+ 3. Users can then upgrade:
39
+ ```bash
40
+ brew update
41
+ brew upgrade openclacky
42
+ ```
43
+
44
+ ## For Users: Installation
45
+
46
+ ```bash
47
+ # Add the tap (one-time)
48
+ brew tap YOUR_USERNAME/openclacky
49
+
50
+ # Install
51
+ brew install openclacky
52
+
53
+ # Or in one command
54
+ brew install YOUR_USERNAME/openclacky/openclacky
55
+ ```
56
+
57
+ ## Testing the Formula Locally
58
+
59
+ ```bash
60
+ # Install from local formula
61
+ brew install --build-from-source ./homebrew/openclacky.rb
62
+
63
+ # Or test without installing
64
+ brew test ./homebrew/openclacky.rb
65
+ ```
66
+
67
+ ## Automation Script
68
+
69
+ For easier updates, use this script:
70
+
71
+ ```bash
72
+ #!/bin/bash
73
+ # update_formula.sh
74
+
75
+ VERSION=$1
76
+ if [ -z "$VERSION" ]; then
77
+ echo "Usage: ./update_formula.sh VERSION"
78
+ exit 1
79
+ fi
80
+
81
+ # Download gem
82
+ wget https://rubygems.org/downloads/openclacky-${VERSION}.gem -O /tmp/openclacky.gem
83
+
84
+ # Calculate SHA256
85
+ SHA256=$(shasum -a 256 /tmp/openclacky.gem | cut -d' ' -f1)
86
+
87
+ # Update formula
88
+ sed -i '' "s|url \".*\"|url \"https://rubygems.org/downloads/openclacky-${VERSION}.gem\"|" openclacky.rb
89
+ sed -i '' "s|sha256 \".*\"|sha256 \"${SHA256}\"|" openclacky.rb
90
+
91
+ echo "Formula updated to version ${VERSION}"
92
+ echo "SHA256: ${SHA256}"
93
+ echo "Don't forget to commit and push to homebrew-openclacky repository!"
94
+
95
+ rm /tmp/openclacky.gem
96
+ ```
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Openclacky < Formula
4
+ desc "Command-line interface for AI models with autonomous agent capabilities"
5
+ homepage "https://github.com/clacky-ai/open-clacky"
6
+ url "https://rubygems.org/downloads/openclacky-0.6.1.gem"
7
+ sha256 "" # Will be updated when gem is published
8
+ license "MIT"
9
+
10
+ depends_on "ruby@3.3"
11
+
12
+ def install
13
+ ENV["GEM_HOME"] = libexec
14
+ system "gem", "install", cached_download, "--no-document"
15
+
16
+ # Create wrapper scripts
17
+ (bin/"openclacky").write_env_script libexec/"bin/openclacky", GEM_HOME: ENV["GEM_HOME"]
18
+ (bin/"clacky").write_env_script libexec/"bin/clacky", GEM_HOME: ENV["GEM_HOME"]
19
+ end
20
+
21
+ test do
22
+ assert_match "openclacky version #{version}", shell_output("#{bin}/openclacky version")
23
+ end
24
+ end