elelem 0.4.1 → 0.4.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -14
- data/README.md +2 -2
- data/lib/elelem/agent.rb +2 -1
- data/lib/elelem/conversation.rb +7 -7
- data/lib/elelem/system_prompt.erb +14 -4
- data/lib/elelem/tool.rb +3 -1
- data/lib/elelem/toolbox.rb +2 -2
- data/lib/elelem/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: 7c9f3ee321bf585693ae2be5186a3b84f0122f282bcd8cb6d320b92931eb0d13
|
|
4
|
+
data.tar.gz: f9200f6646a49666394493f46a99ec5ebb157d415e35208a8cdb405736c822c1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b62630ba5787d5b7daa55113c01012ade1075f4d9618b43c6a4ce46643b4a29ce3d380c864070f6aa43e26732ae6e20b07f4ce7eb7b4b251b90fd83f5ff5c781
|
|
7
|
+
data.tar.gz: 48929614d89e694d9d153baa195276042d586a537f1197c588156cf8d192afd4b6b134bad5bd30c836a05358ff26607ae6b7531f5f71e33f9e0291f0d5331e2d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.4.2] - 2025-12-01
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- Renamed `exec` tool to `bash` for clarity
|
|
7
|
+
- Improved system prompt with iterative refinements
|
|
8
|
+
- Added environment context variables to system prompt
|
|
9
|
+
|
|
3
10
|
## [0.4.1] - 2025-11-26
|
|
4
11
|
|
|
5
12
|
### Added
|
|
6
|
-
-
|
|
13
|
+
- `elelem files` subcommand: generates Claude‑compatible XML file listings.
|
|
14
|
+
- Rake task `files:prompt` to output a ready‑to‑copy list of files for prompts.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- Refactor tool‑call formatting to a more compact JSON payload for better LLM parsing.
|
|
18
|
+
- Updated CI and documentation to use GitHub instead of previous hosting.
|
|
19
|
+
- Runtime validation of command‑line parameters against a JSON schema.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- Minor documentation and CI workflow adjustments.
|
|
7
23
|
|
|
8
24
|
## [0.4.0] - 2025-11-10
|
|
9
25
|
|
|
@@ -122,16 +138,3 @@
|
|
|
122
138
|
|
|
123
139
|
- Initial release
|
|
124
140
|
|
|
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/README.md
CHANGED
|
@@ -125,13 +125,13 @@ seven tools, each represented by a JSON schema that the LLM can call.
|
|
|
125
125
|
|
|
126
126
|
| Tool | Purpose | Parameters |
|
|
127
127
|
| ---- | ------- | ---------- |
|
|
128
|
+
| `bash` | Run shell commands | `cmd`, `args`, `env`, `cwd`, `stdin` |
|
|
128
129
|
| `eval` | Dynamically create new tools | `code` |
|
|
129
130
|
| `grep` | Search Git‑tracked files | `query` |
|
|
130
131
|
| `list` | List tracked files | `path` (optional) |
|
|
132
|
+
| `patch` | Apply a unified diff via `git apply` | `diff` |
|
|
131
133
|
| `read` | Read file contents | `path` |
|
|
132
134
|
| `write` | Overwrite a file | `path`, `content` |
|
|
133
|
-
| `patch` | Apply a unified diff via `git apply` | `diff` |
|
|
134
|
-
| `execute` | Run shell commands | `cmd`, `args`, `env`, `cwd`, `stdin` |
|
|
135
135
|
|
|
136
136
|
## Tool Definition
|
|
137
137
|
|
data/lib/elelem/agent.rb
CHANGED
|
@@ -66,6 +66,7 @@ module Elelem
|
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
def format_tool_call_result(result)
|
|
69
|
+
return if result.nil?
|
|
69
70
|
return result["stdout"] if result["stdout"]
|
|
70
71
|
return result["stderr"] if result["stderr"]
|
|
71
72
|
return result[:error] if result[:error]
|
|
@@ -80,7 +81,7 @@ module Elelem
|
|
|
80
81
|
content = ""
|
|
81
82
|
tool_calls = []
|
|
82
83
|
|
|
83
|
-
print "Thinking..."
|
|
84
|
+
print "Assistant> Thinking..."
|
|
84
85
|
client.chat(messages + turn_context, tools) do |chunk|
|
|
85
86
|
msg = chunk["message"]
|
|
86
87
|
if msg
|
data/lib/elelem/conversation.rb
CHANGED
|
@@ -45,19 +45,19 @@ module Elelem
|
|
|
45
45
|
|
|
46
46
|
case mode.sort
|
|
47
47
|
when [:read]
|
|
48
|
-
"#{base}\n\
|
|
48
|
+
"#{base}\n\nYou may read files on the system."
|
|
49
49
|
when [:write]
|
|
50
|
-
"#{base}\n\
|
|
50
|
+
"#{base}\n\nYou may write files on the system."
|
|
51
51
|
when [:execute]
|
|
52
|
-
"#{base}\n\
|
|
52
|
+
"#{base}\n\nYou may execute shell commands on the system."
|
|
53
53
|
when [:read, :write]
|
|
54
|
-
"#{base}\n\
|
|
54
|
+
"#{base}\n\nYou may read and write files on the system."
|
|
55
55
|
when [:execute, :read]
|
|
56
|
-
"#{base}\n\
|
|
56
|
+
"#{base}\n\nYou may execute shell commands and read files on the system."
|
|
57
57
|
when [:execute, :write]
|
|
58
|
-
"#{base}\n\
|
|
58
|
+
"#{base}\n\nYou may execute shell commands and write files on the system."
|
|
59
59
|
when [:execute, :read, :write]
|
|
60
|
-
"#{base}\n\nYou
|
|
60
|
+
"#{base}\n\nYou may read files, write files and execute shell commands on the system."
|
|
61
61
|
else
|
|
62
62
|
base
|
|
63
63
|
end
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
You are a reasoning coding and system agent
|
|
1
|
+
You are a reasoning coding and system agent.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
## System
|
|
4
|
+
|
|
5
|
+
Operating System: <%= `uname -a` %>
|
|
6
|
+
USER: <%= ENV['USER'] %>
|
|
7
|
+
HOME: <%= ENV['HOME'] %>
|
|
8
|
+
SHELL: <%= ENV['SHELL'] %>
|
|
9
|
+
PATH: <%= ENV['PATH'] %>
|
|
10
|
+
PWD: <%= ENV['PWD'] %>
|
|
11
|
+
LANG: <%= ENV['LANG'] %>
|
|
12
|
+
EDITOR: <%= ENV['EDITOR'] %>
|
|
13
|
+
LOGNAME: <%= ENV['LOGNAME'] %>
|
|
14
|
+
TERM: <%= ENV['TERM'] %>
|
|
15
|
+
MAIL: <%= ENV['MAIL'] %>
|
data/lib/elelem/tool.rb
CHANGED
|
@@ -11,7 +11,9 @@ module Elelem
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def call(args)
|
|
14
|
-
|
|
14
|
+
unless valid?(args)
|
|
15
|
+
return { error: "Invalid args for #{@name}", received: args.keys, expected: @schema.dig(:function, :parameters, :required) }
|
|
16
|
+
end
|
|
15
17
|
|
|
16
18
|
@block.call(args)
|
|
17
19
|
end
|
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
|
-
|
|
11
|
+
BASH_TOOL = Tool.build("bash", "Run shell commands. For git: bash({\"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"] || [],
|
|
@@ -42,7 +42,7 @@ module Elelem
|
|
|
42
42
|
@tools_by_name = {}
|
|
43
43
|
@tools = { read: [], write: [], execute: [] }
|
|
44
44
|
add_tool(eval_tool(binding), :execute)
|
|
45
|
-
add_tool(
|
|
45
|
+
add_tool(BASH_TOOL, :execute)
|
|
46
46
|
add_tool(GREP_TOOL, :read)
|
|
47
47
|
add_tool(LIST_TOOL, :read)
|
|
48
48
|
add_tool(PATCH_TOOL, :write)
|
data/lib/elelem/version.rb
CHANGED