rubyn 0.1.6 → 0.1.8
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/rubyn/client/api_client.rb +1 -1
- data/lib/rubyn/commands/agent.rb +3 -0
- data/lib/rubyn/commands/init.rb +4 -0
- data/lib/rubyn/engine/app/views/layouts/rubyn/application.html.erb +0 -4
- data/lib/rubyn/engine/app/views/rubyn/dashboard/index.html.erb +0 -6
- data/lib/rubyn/engine/config/routes.rb +2 -1
- data/lib/rubyn/tools/git_create_branch.rb +1 -1
- data/lib/rubyn/tools/patch_file.rb +6 -3
- data/lib/rubyn/tools/run_tests.rb +4 -1
- data/lib/rubyn/tools/search_files.rb +4 -3
- data/lib/rubyn/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: abb102eaff3078770055217b013e8daaa71e713d0dfa3c1abb419bcd0ef9b892
|
|
4
|
+
data.tar.gz: 343670bf894c172b8657f20baefb9b669505a74a44f735ba40468d504e916c2f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9295d1f4873dcba0b94100aef252ce772fee4cf552b533339437a9fa8055bf8faace0f3e73d79fbd32f403af3bd15dad310591b0b9084ad03b1382a41eac3638
|
|
7
|
+
data.tar.gz: 0bcaa62f14839ec58858c6024889ec7e3bac197e8469774a45cbf9016a466ed957915e3bb482fd50acd339e1e5b030849e69f2441018cdaaa2ac06c82825a7f0
|
|
@@ -55,7 +55,7 @@ module Rubyn
|
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
def submit_tool_results(conversation_id:, tool_results:, project_token:)
|
|
58
|
-
|
|
58
|
+
post_with_recovery("/api/v1/ai/agent/tool_results", {
|
|
59
59
|
conversation_id: conversation_id,
|
|
60
60
|
tool_results: tool_results,
|
|
61
61
|
project_token: project_token
|
data/lib/rubyn/commands/agent.rb
CHANGED
data/lib/rubyn/commands/init.rb
CHANGED
|
@@ -85,6 +85,10 @@ module Rubyn
|
|
|
85
85
|
|
|
86
86
|
formatter.info("Authenticated as: #{result.dig("user", "email")}")
|
|
87
87
|
formatter.info("Plan: #{result.dig("user", "plan")}")
|
|
88
|
+
|
|
89
|
+
if result.dig("user", "organization_name")
|
|
90
|
+
formatter.info("Team: #{result.dig("user", "organization_name")}")
|
|
91
|
+
end
|
|
88
92
|
rescue Rubyn::AuthenticationError
|
|
89
93
|
spinner.stop_error("Invalid!")
|
|
90
94
|
formatter.error("API key is invalid. Get your key at https://rubyn.dev/settings")
|
|
@@ -29,10 +29,6 @@
|
|
|
29
29
|
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"/><polyline points="13 2 13 9 20 9"/></svg>
|
|
30
30
|
Files
|
|
31
31
|
<% end %>
|
|
32
|
-
<%= link_to rubyn.agent_path, class: ("active" if current_page?(rubyn.agent_path)) do %>
|
|
33
|
-
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
|
|
34
|
-
Agent
|
|
35
|
-
<% end %>
|
|
36
32
|
<%= link_to rubyn.settings_path, class: ("active" if current_page?(rubyn.settings_path)) do %>
|
|
37
33
|
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
|
|
38
34
|
Settings
|
|
@@ -64,12 +64,6 @@
|
|
|
64
64
|
</span>
|
|
65
65
|
Browse Files
|
|
66
66
|
<% end %>
|
|
67
|
-
<%= link_to rubyn.agent_path, class: "rubyn-action-card" do %>
|
|
68
|
-
<span class="rubyn-action-icon rubyn-action-icon--agent">
|
|
69
|
-
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
|
|
70
|
-
</span>
|
|
71
|
-
Start Agent
|
|
72
|
-
<% end %>
|
|
73
67
|
<%= link_to rubyn.settings_path, class: "rubyn-action-card" do %>
|
|
74
68
|
<span class="rubyn-action-icon rubyn-action-icon--settings">
|
|
75
69
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9"/></svg>
|
|
@@ -4,7 +4,8 @@ Rubyn::Engine.routes.draw do
|
|
|
4
4
|
root to: "dashboard#index"
|
|
5
5
|
|
|
6
6
|
resources :files, only: [:index]
|
|
7
|
-
|
|
7
|
+
# Agent is CLI-only — requires local tool execution
|
|
8
|
+
# resource :agent, only: %i[show create], controller: "agent"
|
|
8
9
|
resource :refactor, only: %i[show create update], controller: "refactor"
|
|
9
10
|
resource :specs, only: %i[show create], controller: "specs"
|
|
10
11
|
resource :reviews, only: %i[show create], controller: "reviews"
|
|
@@ -17,7 +17,7 @@ module Rubyn
|
|
|
17
17
|
VALID_BRANCH_PATTERN = %r{\A[a-zA-Z0-9\-_/]+\z}
|
|
18
18
|
|
|
19
19
|
def execute(params)
|
|
20
|
-
branch_name = params[:branch_name]
|
|
20
|
+
branch_name = params[:branch_name] || params[:name]
|
|
21
21
|
return error("branch_name is required") unless branch_name && !branch_name.strip.empty?
|
|
22
22
|
|
|
23
23
|
unless branch_name.match?(VALID_BRANCH_PATTERN)
|
|
@@ -22,18 +22,21 @@ module Rubyn
|
|
|
22
22
|
return error("File not found: #{params[:path]}") unless File.exist?(resolved)
|
|
23
23
|
|
|
24
24
|
content = File.read(resolved)
|
|
25
|
-
find = params[:find]
|
|
25
|
+
find = params[:find] || params[:old_text]
|
|
26
|
+
replace = params[:replace] || params[:new_text]
|
|
26
27
|
|
|
28
|
+
return error("Missing find/old_text parameter") unless find
|
|
29
|
+
return error("Missing replace/new_text parameter") unless replace
|
|
27
30
|
return error("Find string not found in file: #{params[:path]}") unless content.include?(find)
|
|
28
31
|
|
|
29
32
|
all_occurrences = params[:all_occurrences] || false
|
|
30
33
|
|
|
31
34
|
if all_occurrences
|
|
32
35
|
replacements = content.scan(find).length
|
|
33
|
-
new_content = content.gsub(find,
|
|
36
|
+
new_content = content.gsub(find, replace)
|
|
34
37
|
else
|
|
35
38
|
replacements = 1
|
|
36
|
-
new_content = content.sub(find,
|
|
39
|
+
new_content = content.sub(find, replace)
|
|
37
40
|
end
|
|
38
41
|
|
|
39
42
|
File.write(resolved, new_content)
|
|
@@ -18,7 +18,10 @@ module Rubyn
|
|
|
18
18
|
command = detect_test_command
|
|
19
19
|
return error("No test framework detected (no spec/ or test/ directory found)") unless command
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
# Accept both gem params (path) and API params (files array)
|
|
22
|
+
test_path = params[:path]
|
|
23
|
+
test_path ||= Array(params[:files]).join(" ") if params[:files]
|
|
24
|
+
command = "#{command} #{test_path}" if test_path && !test_path.strip.empty?
|
|
22
25
|
command = "#{command} #{params[:options]}" if params[:options] && !params[:options].strip.empty?
|
|
23
26
|
|
|
24
27
|
begin
|
|
@@ -16,16 +16,17 @@ module Rubyn
|
|
|
16
16
|
MAX_FILE_SIZE = 2_000_000
|
|
17
17
|
|
|
18
18
|
def execute(params)
|
|
19
|
-
|
|
19
|
+
query = params[:pattern] || params[:query]
|
|
20
|
+
return error("Missing required parameter: pattern") unless query
|
|
20
21
|
|
|
21
22
|
begin
|
|
22
|
-
regex = Regexp.new(
|
|
23
|
+
regex = Regexp.new(query)
|
|
23
24
|
rescue RegexpError => e
|
|
24
25
|
return error("Invalid regex pattern: #{e.message}")
|
|
25
26
|
end
|
|
26
27
|
|
|
27
28
|
search_path = params[:path] || "."
|
|
28
|
-
file_pattern = params[:file_pattern]
|
|
29
|
+
file_pattern = params[:file_pattern] || params[:include]
|
|
29
30
|
|
|
30
31
|
resolved = resolve_path(search_path)
|
|
31
32
|
return resolved if resolved.is_a?(Hash) && resolved[:error]
|
data/lib/rubyn/version.rb
CHANGED