cline-rb 1.1.4 → 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0cae03339b133588a9f0a4e04d66bf789cade5365495513a17a94839402d814f
4
- data.tar.gz: 63d588d57d86ffad47a0c5e385f32d6b35118e0452696fb13b2fa17af9bcbed1
3
+ metadata.gz: e890e0acc47538871b9e73d58195cbd4053e31248c4c39311a8bc336c9ad0b4e
4
+ data.tar.gz: c91b5c97748691e26cc58d4684d98210e7217a837be678651ffab7c0eab53b72
5
5
  SHA512:
6
- metadata.gz: a3c9ce62b490930ce6b43a602221bf9ec6a26671f3cf8dc18ebfa5fd24b20836cd46524b2369d9e64b7625349c089f9051d1d282e23269c56cda122457cd3153
7
- data.tar.gz: 778623fac356f2d8a3369b08ac23a6aacf871ad162bdbd239d8734ed2c5c36946fc89a00f49a3dca602bbfe397c5fd501c4f727125bf6cf9aa49ff8e55558af2
6
+ metadata.gz: 45f3b3a1cf5ada87815c1f3fdc11579886d81d15f5a5e251622b2269ba11b0de458ef6f9cead23b2bdd8d28b3096dca730720af0652ea4cb8625fe7fa3998e26
7
+ data.tar.gz: '04685027eebb901d700ada489621b84a1f128399d4ea3f3a51cd275baebb61d50b3ed6b1e55299feea248e5775da158ca55d9b47c9f1cd55940c8bf560476403'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ # [v2.1.0](https://github.com/Muriel-Salvan/cline-rb/compare/v2.0.0...v2.1.0) (2026-10-27 11:46:14)
2
+
3
+ ## Global changes
4
+ ### Patches
5
+
6
+ * [feat(cline): add telemetry attributes to session and error logs](https://github.com/Muriel-Salvan/cline-rb/commit/efe3f555c42aebca33f6d039671c03f6774a0f67)
7
+
8
+ ## Changes for cline
9
+ ### Features
10
+
11
+ * [feat(cline): add telemetry attributes to session and error logs](https://github.com/Muriel-Salvan/cline-rb/commit/efe3f555c42aebca33f6d039671c03f6774a0f67)
12
+
13
+ # [v2.0.0](https://github.com/Muriel-Salvan/cline-rb/compare/v1.1.4...v2.0.0) (2026-10-22 13:28:57)
14
+
15
+ ## Global changes
16
+ ### Patches
17
+
18
+ * [break(cline): return task error for failed and cancelled runs](https://github.com/Muriel-Salvan/cline-rb/commit/155df5e6c829bcdf2b9040ba33eb4cddbb804854)
19
+
20
+ ## Changes for cline
21
+ ### Breaking changes
22
+
23
+ * [break(cline): return task error for failed and cancelled runs](https://github.com/Muriel-Salvan/cline-rb/commit/155df5e6c829bcdf2b9040ba33eb4cddbb804854)
24
+
1
25
  # [v1.1.4](https://github.com/Muriel-Salvan/cline-rb/compare/v1.1.3...v1.1.4) (2026-10-22 09:34:43)
2
26
 
3
27
  ### 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
@@ -236,7 +236,7 @@ module Cline
236
236
  if @session
237
237
  result[:message] = @session.messages&.reverse_each&.find { |message| message.role == 'assistant' }
238
238
  result[:status] = @session.status
239
- result[:error] = config.logs.logs(from: start_time).reverse_each.find { |log| log.severity == 'error' } if @session.status == 'failed'
239
+ result[:error] = config.logs.logs(from: start_time).reverse_each.find { |log| log.level >= 40 } if %w[failed cancelled].include?(@session.status)
240
240
  end
241
241
  result
242
242
  end
data/lib/cline/log.rb CHANGED
@@ -222,6 +222,81 @@ module Cline
222
222
  # @return [String, nil] Whether the session was restored from persistence
223
223
  attribute :restored_from_persistence, :boolean
224
224
 
225
+ # @return [String, nil] User identifier
226
+ attribute :user_id, :string
227
+
228
+ # @return [String, nil] Account identifier
229
+ attribute :account_id, :string
230
+
231
+ # @return [String, nil] Account email
232
+ attribute :account_email, :string
233
+
234
+ # @return [String, nil] Session origin (e.g. "user", "cli")
235
+ attribute :session_origin, :string
236
+
237
+ # @return [String, nil] Device identifier
238
+ attribute :device_id, :string
239
+
240
+ # @return [Integer, nil] Reasoning token count
241
+ attribute :reasoning_token_count, :integer
242
+
243
+ # @return [String, nil] Model request identifier
244
+ attribute :model_request_id, :string
245
+
246
+ # @return [Integer, nil] Run count
247
+ attribute :run_count, :integer
248
+
249
+ # @return [String, nil] Outcome (e.g. "head_clean", "aborted")
250
+ attribute :outcome, :string
251
+
252
+ # @return [String, nil] Phase of a provider request (e.g. "provider_request_started", "first_chunk_received")
253
+ attribute :phase, :string
254
+
255
+ # @return [String, nil] Skill name used
256
+ attribute :skill_name, :string
257
+
258
+ # @return [String, nil] Skill source (e.g. "project", "global")
259
+ attribute :skill_source, :string
260
+
261
+ # @return [Integer, nil] Number of skills available globally
262
+ attribute :skills_available_global, :integer
263
+
264
+ # @return [Integer, nil] Number of skills available for the project
265
+ attribute :skills_available_project, :integer
266
+
267
+ # @return [String, nil] Compaction strategy (e.g. "agentic")
268
+ attribute :strategy, :string
269
+
270
+ # @return [Integer, nil] Mode of the compaction (e.g. "auto")
271
+ attribute :mode, :string
272
+
273
+ # @return [Integer, nil] Number of messages before compaction
274
+ attribute :messages_before, :integer
275
+
276
+ # @return [Integer, nil] Number of messages after compaction
277
+ attribute :messages_after, :integer
278
+
279
+ # @return [Integer, nil] Number of messages removed during compaction
280
+ attribute :messages_removed, :integer
281
+
282
+ # @return [Integer, nil] Number of tokens before compaction
283
+ attribute :tokens_before, :integer
284
+
285
+ # @return [Integer, nil] Number of tokens after compaction
286
+ attribute :tokens_after, :integer
287
+
288
+ # @return [Integer, nil] Number of tokens saved by compaction
289
+ attribute :tokens_saved, :integer
290
+
291
+ # @return [Float, nil] Trigger tokens for compaction
292
+ attribute :trigger_tokens, :float
293
+
294
+ # @return [Float, nil] Maximum input tokens
295
+ attribute :max_input_tokens, :float
296
+
297
+ # @return [Float, nil] Threshold ratio for compaction trigger
298
+ attribute :threshold_ratio, :float
299
+
225
300
  # All attributes are already snake case
226
301
  cline_snake_attributes(*attributes.keys)
227
302
  end
@@ -282,6 +357,24 @@ module Cline
282
357
  # @return [String, nil] Provider identifier (e.g. "cline")
283
358
  attribute :provider_id, :string
284
359
 
360
+ # @return [String, nil] Run identifier
361
+ attribute :run_id, :string
362
+
363
+ # @return [String, nil] Status (e.g. "aborted", "completed")
364
+ attribute :status, :string
365
+
366
+ # @return [Integer, nil] Iteration number
367
+ attribute :iteration, :integer
368
+
369
+ # @return [String, nil] Error class name
370
+ attribute :error_name, :string
371
+
372
+ # @return [String, nil] Human-readable error message
373
+ attribute :error_message, :string
374
+
375
+ # @return [Integer, nil] Number of assistant content parts
376
+ attribute :assistant_content_part_count, :integer
377
+
285
378
  # @return [Error, nil] Error details for error logs
286
379
  attribute :err, Error
287
380
  end
data/lib/cline/version.rb CHANGED
@@ -2,5 +2,5 @@ module Cline
2
2
  # @!group Public API
3
3
 
4
4
  # Gem version
5
- VERSION = '1.1.4'
5
+ VERSION = '2.1.0'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cline-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Muriel Salvan