cline-rb 1.1.3 → 2.0.0
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 +18 -0
- data/README.md +1 -1
- data/lib/cline/cli.rb +7 -3
- data/lib/cline/utils/os/linux.rb +5 -0
- data/lib/cline/utils/os/mingw32.rb +5 -0
- data/lib/cline/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: ddeedc9fb1f4b8b7eec25510769a011cdd00bd2b4dd29061a15011591fea8f27
|
|
4
|
+
data.tar.gz: 6c5ffa5afd84be8f08b24c865ec6fb44f87491323c415add15c63f5a69c5006c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 95eb7157036da75b54ff00396a2d8a36e5743350be968cf5fe6b65c2fe6d6f61bfa75b6456e833a57a8c96940cb5456f3693d86f92445606aea2fe3eb9c25bde
|
|
7
|
+
data.tar.gz: da15c8868c9cf6d53e08c2559e75b5520d2cecd39be1c6fe99f74cf2ab23e50eca62f63fdd962b5ff27503aba764fb4ac7cb8c51189ca3bfac92e0455c38a580
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
# [v2.0.0](https://github.com/Muriel-Salvan/cline-rb/compare/v1.1.4...v2.0.0) (2026-10-22 13:28:57)
|
|
2
|
+
|
|
3
|
+
## Global changes
|
|
4
|
+
### Patches
|
|
5
|
+
|
|
6
|
+
* [break(cline): return task error for failed and cancelled runs](https://github.com/Muriel-Salvan/cline-rb/commit/155df5e6c829bcdf2b9040ba33eb4cddbb804854)
|
|
7
|
+
|
|
8
|
+
## Changes for cline
|
|
9
|
+
### Breaking changes
|
|
10
|
+
|
|
11
|
+
* [break(cline): return task error for failed and cancelled runs](https://github.com/Muriel-Salvan/cline-rb/commit/155df5e6c829bcdf2b9040ba33eb4cddbb804854)
|
|
12
|
+
|
|
13
|
+
# [v1.1.4](https://github.com/Muriel-Salvan/cline-rb/compare/v1.1.3...v1.1.4) (2026-10-22 09:34:43)
|
|
14
|
+
|
|
15
|
+
### Patches
|
|
16
|
+
|
|
17
|
+
* [feat(cli): use temp prompt file when a single arg exceeds per-arg limit](https://github.com/Muriel-Salvan/cline-rb/commit/52c9486a2f97af29d4c10afbc596bef7f61994f3)
|
|
18
|
+
|
|
1
19
|
# [v1.1.3](https://github.com/Muriel-Salvan/cline-rb/compare/v1.1.2...v1.1.3) (2026-10-14 15:38:46)
|
|
2
20
|
|
|
3
21
|
### Patches
|
data/README.md
CHANGED
|
@@ -206,7 +206,7 @@ result = cli.task('Explain what Ruby symbols are in one sentence.')
|
|
|
206
206
|
puts result[:stdout] # Full CLI output
|
|
207
207
|
puts result[:message] # Last assistant message (SessionMessage object)
|
|
208
208
|
puts result[:status] # e.g. "completed"
|
|
209
|
-
puts result[:error] # Error log entry if status is "failed"
|
|
209
|
+
puts result[:error] # Error log entry if status is "failed" or "cancelled"
|
|
210
210
|
```
|
|
211
211
|
|
|
212
212
|
#### Running a task with a specific model
|
data/lib/cline/cli.rb
CHANGED
|
@@ -125,7 +125,7 @@ module Cline
|
|
|
125
125
|
# @return [Hash{Symbol => Object}] A set of return properties (see #run_cli). Additionnally the following ones:
|
|
126
126
|
# - message [SessionMessage, nil] The last message of the session, or nil if none
|
|
127
127
|
# - status [String] The task status
|
|
128
|
-
# - error [Log, nil] In case of status "failed", get the last error log entry, or nil if no error.
|
|
128
|
+
# - error [Log, nil] In case of status "failed" or "cancelled", get the last error log entry with level >= 40, or nil if no error.
|
|
129
129
|
def task(prompt, on_message: nil, on_question: nil, monitoring_interval_secs: 1, **kwargs)
|
|
130
130
|
result = {}
|
|
131
131
|
start_time = Time.now
|
|
@@ -133,7 +133,11 @@ module Cline
|
|
|
133
133
|
task_args = parse_task_options(**kwargs)
|
|
134
134
|
# Use a prompt temporary file if the prompt is too long to fit in the command line.
|
|
135
135
|
(
|
|
136
|
-
if stripped_prompt &&
|
|
136
|
+
if stripped_prompt && (
|
|
137
|
+
stripped_prompt.bytesize + 2 > Utils::Os.max_cmd_length -
|
|
138
|
+
(Utils::Os.cline_exe + task_args).map { |arg| "\"#{arg}\"" }.join(' ').bytesize ||
|
|
139
|
+
stripped_prompt.bytesize + 2 > Utils::Os.max_arg_length
|
|
140
|
+
)
|
|
137
141
|
proc do |&run_block|
|
|
138
142
|
Utils::File.with_temp_dir do |tmp_dir|
|
|
139
143
|
prompt_file = "#{tmp_dir}/prompt.txt"
|
|
@@ -232,7 +236,7 @@ module Cline
|
|
|
232
236
|
if @session
|
|
233
237
|
result[:message] = @session.messages&.reverse_each&.find { |message| message.role == 'assistant' }
|
|
234
238
|
result[:status] = @session.status
|
|
235
|
-
result[:error] = config.logs.logs(from: start_time).reverse_each.find { |log| log.
|
|
239
|
+
result[:error] = config.logs.logs(from: start_time).reverse_each.find { |log| log.level >= 40 } if %w[failed cancelled].include?(@session.status)
|
|
236
240
|
end
|
|
237
241
|
result
|
|
238
242
|
end
|
data/lib/cline/utils/os/linux.rb
CHANGED
|
@@ -37,6 +37,11 @@ module Cline
|
|
|
37
37
|
def max_cmd_length
|
|
38
38
|
@max_cmd_length ||= Integer(`getconf ARG_MAX`.strip)
|
|
39
39
|
end
|
|
40
|
+
|
|
41
|
+
# @return [Integer] Maximum length a single command-line argument can have
|
|
42
|
+
def max_arg_length
|
|
43
|
+
@max_arg_length ||= [131_072, max_cmd_length].min
|
|
44
|
+
end
|
|
40
45
|
end
|
|
41
46
|
end
|
|
42
47
|
end
|
data/lib/cline/version.rb
CHANGED