language-operator 0.1.41 → 0.1.42

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: a28b526235b379f3ecb5679ee815f0ca980518e20b57a749336c7cd0d7d64878
4
- data.tar.gz: 929721c9eee8f39ab5101dad244e15ced6875c12f128c44737eb572672b14501
3
+ metadata.gz: 21f9d0f6d79748ca4d6770581a1dbe46e3abd8bfa176b358fc61d57681801b0d
4
+ data.tar.gz: 3751ffbd7c65cc31d1d3b4401ca2195119c4da16d499db50d118f8e219a2ce28
5
5
  SHA512:
6
- metadata.gz: 6ec126476379175477727dc34a9132dce2833b30c39925ff209a10176d33f36ffd5aaacdd417acc0bf6c2253be442e278daa4d85812228c024ae10fc50cce1ad
7
- data.tar.gz: af80908355cd1cce749a2c0ba1fd9d0c3320e37e8d7b6f0c446d2fb4d943db2b80f4fc614c91c08f9d111e8855fbcbe9ff9175dffa686ad755b180f80e1fcf9e
6
+ metadata.gz: c1787788a7491a65db181ec063bc1bcdd40773ee3b6aa0dca08329e26a03dd0780656a0f86f4fab3ba7c29e657f6a20a1d0b94f7c45462dd4a91d93ac0c2d1c4
7
+ data.tar.gz: 10b22cb56a7050a25786ef6c1abdf5c6e343069be5de49bfc9fb204575d02c9dbcd80a05403a6cf03bb31087b786f7ea7842aca7f82248b6a94045a9b024c563
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- language-operator (0.1.41)
4
+ language-operator (0.1.42)
5
5
  faraday (~> 2.0)
6
6
  k8s-ruby (~> 0.17)
7
7
  mcp (~> 0.4)
@@ -23,6 +23,7 @@ module LanguageOperator
23
23
  # @example Creating a custom agent
24
24
  # agent = LanguageOperator::Agent::Base.new(config)
25
25
  # agent.execute_goal("Summarize daily news")
26
+ # rubocop:disable Metrics/ModuleLength
26
27
  module Agent
27
28
  # Module-level logger for Agent framework
28
29
  @logger = LanguageOperator::Logger.new(component: 'Agent')
@@ -257,11 +258,34 @@ module LanguageOperator
257
258
  config = {}
258
259
 
259
260
  if agent_def.constraints
260
- config[:timeout] = agent_def.constraints[:timeout] if agent_def.constraints[:timeout]
261
+ if agent_def.constraints[:timeout]
262
+ timeout = agent_def.constraints[:timeout]
263
+ config[:timeout] = timeout.is_a?(String) ? parse_duration(timeout) : timeout
264
+ end
261
265
  config[:max_retries] = agent_def.constraints[:max_retries] if agent_def.constraints[:max_retries]
262
266
  end
263
267
 
264
268
  config
265
269
  end
270
+
271
+ # Parse duration string to seconds
272
+ #
273
+ # @param duration [String] Duration string (e.g., "10m", "2h", "30s")
274
+ # @return [Numeric] Duration in seconds
275
+ def self.parse_duration(duration)
276
+ case duration
277
+ when /^(\d+)s$/
278
+ ::Regexp.last_match(1).to_i
279
+ when /^(\d+)m$/
280
+ ::Regexp.last_match(1).to_i * 60
281
+ when /^(\d+)h$/
282
+ ::Regexp.last_match(1).to_i * 3600
283
+ when Numeric
284
+ duration
285
+ else
286
+ raise ArgumentError, "Invalid duration format: #{duration}. Use format like '10m', '2h', '30s'"
287
+ end
288
+ end
266
289
  end
290
+ # rubocop:enable Metrics/ModuleLength
267
291
  end
@@ -2,7 +2,7 @@
2
2
  :openapi: 3.0.3
3
3
  :info:
4
4
  :title: Language Operator Agent API
5
- :version: 0.1.41
5
+ :version: 0.1.42
6
6
  :description: HTTP API endpoints exposed by Language Operator reactive agents
7
7
  :contact:
8
8
  :name: Language Operator
@@ -3,7 +3,7 @@
3
3
  "$id": "https://github.com/language-operator/language-operator-gem/schema/agent-dsl.json",
4
4
  "title": "Language Operator Agent DSL",
5
5
  "description": "Schema for defining autonomous AI agents using the Language Operator DSL",
6
- "version": "0.1.41",
6
+ "version": "0.1.42",
7
7
  "type": "object",
8
8
  "properties": {
9
9
  "name": {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LanguageOperator
4
- VERSION = '0.1.41'
4
+ VERSION = '0.1.42'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: language-operator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.41
4
+ version: 0.1.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Ryan