elelem 0.4.0 → 0.4.1
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 +19 -0
- data/Rakefile +11 -0
- data/lib/elelem/agent.rb +8 -15
- data/lib/elelem/application.rb +14 -1
- data/lib/elelem/system_prompt.erb +1 -1
- data/lib/elelem/tool.rb +1 -2
- data/lib/elelem/toolbox.rb +1 -1
- data/lib/elelem/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0a92bbacb94cf0c5d56ce42a83f48efc0079f59cbafb066a7fdd3a8c382cadc1
|
|
4
|
+
data.tar.gz: 8bdf5148c6e082a070dd528bde2165093cb0e34a82d5c9e7260e24eef0c5b9ca
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f9f80b2af42fc637d70dc1fbffc72af9fdb1e1465c7db4a54adf789ae02861e8c306319cb35ebe3152a28bd22fed9202fdd21dba54415492593ea98cfb5fed4d
|
|
7
|
+
data.tar.gz: 6fb3ea9891e2ae9f9e5377791bae7ac46d89303134d8a1d65de87e550be7ddb38f1f12d83cc3e257b32623e232317eb2fc4b48ed3a2d92adf6e2d402d80ae04b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.4.1] - 2025-11-26
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Updated version to 0.4.1
|
|
7
|
+
|
|
3
8
|
## [0.4.0] - 2025-11-10
|
|
4
9
|
|
|
5
10
|
### Added
|
|
@@ -116,3 +121,17 @@
|
|
|
116
121
|
## [0.1.0] - 2025-08-08
|
|
117
122
|
|
|
118
123
|
- Initial release
|
|
124
|
+
|
|
125
|
+
## [0.4.2] - 2025-11-27
|
|
126
|
+
|
|
127
|
+
### Added
|
|
128
|
+
- `elelem files` subcommand: generates Claude‑compatible XML file listings.
|
|
129
|
+
- Rake task `files:prompt` to output a ready‑to‑copy list of files for prompts.
|
|
130
|
+
|
|
131
|
+
### Changed
|
|
132
|
+
- Refactor tool‑call formatting to a more compact JSON payload for better LLM parsing.
|
|
133
|
+
- Updated CI and documentation to use GitHub instead of previous hosting.
|
|
134
|
+
- Runtime validation of command‑line parameters against a JSON schema.
|
|
135
|
+
|
|
136
|
+
### Fixed
|
|
137
|
+
- Minor documentation and CI workflow adjustments.
|
data/Rakefile
CHANGED
|
@@ -5,4 +5,15 @@ require "rspec/core/rake_task"
|
|
|
5
5
|
|
|
6
6
|
RSpec::Core::RakeTask.new(:spec)
|
|
7
7
|
|
|
8
|
+
task :files do
|
|
9
|
+
IO.popen(%w[git ls-files], chdir: __dir__, err: IO::NULL) do |ls|
|
|
10
|
+
ls.readlines.each do |f|
|
|
11
|
+
next if f.start_with?(*%w[bin/ spec/ pkg/ .git .rspec Gemfile Rakefile])
|
|
12
|
+
next if f.strip.end_with?(*%w[.toml .txt .md])
|
|
13
|
+
|
|
14
|
+
puts f
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
8
19
|
task default: %i[spec]
|
data/lib/elelem/agent.rb
CHANGED
|
@@ -65,20 +65,12 @@ module Elelem
|
|
|
65
65
|
HELP
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
-
def
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
when "grep" then "grep(#{args["query"]})"
|
|
75
|
-
when "list" then "list(#{args["path"] || "."})"
|
|
76
|
-
when "patch" then "patch(#{args["diff"]&.lines&.count || 0} lines)"
|
|
77
|
-
when "read" then "read(#{args["path"]})"
|
|
78
|
-
when "write" then "write(#{args["path"]})"
|
|
79
|
-
else
|
|
80
|
-
"#{name}(#{args.to_s[0...50]})"
|
|
81
|
-
end
|
|
68
|
+
def format_tool_call_result(result)
|
|
69
|
+
return result["stdout"] if result["stdout"]
|
|
70
|
+
return result["stderr"] if result["stderr"]
|
|
71
|
+
return result[:error] if result[:error]
|
|
72
|
+
|
|
73
|
+
""
|
|
82
74
|
end
|
|
83
75
|
|
|
84
76
|
def execute_turn(messages, tools:)
|
|
@@ -110,8 +102,9 @@ module Elelem
|
|
|
110
102
|
name = call.dig("function", "name")
|
|
111
103
|
args = call.dig("function", "arguments")
|
|
112
104
|
|
|
113
|
-
puts "Tool> #{
|
|
105
|
+
puts "Tool> #{name}(#{args})"
|
|
114
106
|
result = toolbox.run_tool(name, args)
|
|
107
|
+
puts format_tool_call_result(result)
|
|
115
108
|
turn_context << { role: "tool", content: JSON.dump(result) }
|
|
116
109
|
end
|
|
117
110
|
|
data/lib/elelem/application.rb
CHANGED
|
@@ -13,7 +13,6 @@ module Elelem
|
|
|
13
13
|
type: :string,
|
|
14
14
|
desc: "Ollama model",
|
|
15
15
|
default: ENV.fetch("OLLAMA_MODEL", "gpt-oss")
|
|
16
|
-
|
|
17
16
|
def chat(*)
|
|
18
17
|
client = Net::Llm::Ollama.new(
|
|
19
18
|
host: options[:host],
|
|
@@ -24,6 +23,20 @@ module Elelem
|
|
|
24
23
|
agent.repl
|
|
25
24
|
end
|
|
26
25
|
|
|
26
|
+
desc "files", "Generate CXML of the files"
|
|
27
|
+
def files
|
|
28
|
+
puts '<documents>'
|
|
29
|
+
$stdin.read.split("\n").map(&:strip).reject(&:empty?).each_with_index do |file, i|
|
|
30
|
+
next unless File.file?(file)
|
|
31
|
+
|
|
32
|
+
puts " <document index=\"#{i + 1}\">"
|
|
33
|
+
puts " <source><![CDATA[#{file}]]></source>"
|
|
34
|
+
puts " <document_content><![CDATA[#{File.read(file)}]]></document_content>"
|
|
35
|
+
puts " </document>"
|
|
36
|
+
end
|
|
37
|
+
puts '</documents>'
|
|
38
|
+
end
|
|
39
|
+
|
|
27
40
|
desc "version", "The version of this CLI"
|
|
28
41
|
def version
|
|
29
42
|
say "v#{Elelem::VERSION}"
|
data/lib/elelem/tool.rb
CHANGED
data/lib/elelem/toolbox.rb
CHANGED
|
@@ -8,7 +8,7 @@ module Elelem
|
|
|
8
8
|
full_path.exist? ? { content: full_path.read } : { error: "File not found: #{path}" }
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
EXEC_TOOL = Tool.build("execute", "
|
|
11
|
+
EXEC_TOOL = Tool.build("execute", "Run shell commands. For git: execute({\"cmd\": \"git\", \"args\": [\"log\", \"--oneline\"]}). Returns stdout/stderr/exit_status.", { cmd: { type: "string" }, args: { type: "array", items: { type: "string" } }, env: { type: "object", additionalProperties: { type: "string" } }, cwd: { type: "string", description: "Working directory (defaults to current)" }, stdin: { type: "string" } }, ["cmd"]) do |args|
|
|
12
12
|
Elelem.shell.execute(
|
|
13
13
|
args["cmd"],
|
|
14
14
|
args: args["args"] || [],
|
data/lib/elelem/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: elelem
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- mo khan
|
|
@@ -198,14 +198,14 @@ files:
|
|
|
198
198
|
- lib/elelem/tool.rb
|
|
199
199
|
- lib/elelem/toolbox.rb
|
|
200
200
|
- lib/elelem/version.rb
|
|
201
|
-
homepage: https://
|
|
201
|
+
homepage: https://github.com/xlgmokha/elelem
|
|
202
202
|
licenses:
|
|
203
203
|
- MIT
|
|
204
204
|
metadata:
|
|
205
205
|
allowed_push_host: https://rubygems.org
|
|
206
|
-
homepage_uri: https://
|
|
207
|
-
source_code_uri: https://
|
|
208
|
-
changelog_uri: https://
|
|
206
|
+
homepage_uri: https://github.com/xlgmokha/elelem
|
|
207
|
+
source_code_uri: https://github.com/xlgmokha/elelem
|
|
208
|
+
changelog_uri: https://github.com/xlgmokha/elelem/blob/main/CHANGELOG.md
|
|
209
209
|
rdoc_options: []
|
|
210
210
|
require_paths:
|
|
211
211
|
- lib
|