lex-swarm 0.2.3 → 0.2.4

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: 85e80b69d4a5c1b117ca7dc79fb316da8fcb586128ea1eb4563322b4eeecb20a
4
- data.tar.gz: 7a8f63f2702b4cf1397471c701a11f1f7b1382c2fb6d9066628fcd760ae37de1
3
+ metadata.gz: 872cfd908e1911c140ec4fa764f8d992c468e0fc258aceb709551254f2723111
4
+ data.tar.gz: f55c01c18b5a46c1c704f626c9b23b8d15312d86467507739cf7fda934386295
5
5
  SHA512:
6
- metadata.gz: '0853b125fac63372cdf738a5918d7cb78b4ba7c3a62a6057c77336e1c8990700917b1c0ff1c5697566878d75c7e274bc3a9836b15b4e53770aaddd10f6138f06'
7
- data.tar.gz: c22349af27e6dd8ca93b4de4f5befe59c3d011dc50a7e28c08985efaf743007a75fdd2ba91ebb60769e274a6a7b2ed75ea4d0a6b8eee8dc5a48d4d54ee008183
6
+ metadata.gz: d874292dcff40204e4af91353e0b2b99e02a87282219f949d2000aadce61a47267e44553e6d33a3badc392f9e5fd697c2f90089080ce43d4ea6ed1823d828014
7
+ data.tar.gz: 0eb4bad49126b2864f2258340e01518796d8664585c7502ab66f9d6c97c75c896302a0bb9ecfe45701bcb72f45ee55b59c7495143ca385eaad62d0906539060a
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ gemspec
6
6
 
7
7
  gem 'rspec', '~> 3.13'
8
8
  gem 'rubocop', '~> 1.75', require: false
9
+ gem 'rubocop-legion', '~> 0.1'
9
10
  gem 'rubocop-rspec', require: false
10
11
 
11
12
  gem 'legion-gaia'
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module Swarm
6
6
  module Actor
7
- class OrphanSweeper < Legion::Extensions::Actors::Every
7
+ class OrphanSweeper < Legion::Extensions::Actors::Every # rubocop:disable Legion/Extension/EveryActorRequiresTime
8
8
  def time = 300
9
9
  def run_now? = false
10
10
  def use_runner? = false
@@ -6,7 +6,7 @@ module Legion
6
6
  module Extensions
7
7
  module Swarm
8
8
  module Actor
9
- class StaleCheck < Legion::Extensions::Actors::Every
9
+ class StaleCheck < Legion::Extensions::Actors::Every # rubocop:disable Legion/Extension/EveryActorRequiresTime
10
10
  def runner_class
11
11
  Legion::Extensions::Swarm::Runners::Swarm
12
12
  end
@@ -38,19 +38,19 @@ module Legion
38
38
 
39
39
  def max_depth
40
40
  Legion::Settings.dig(:swarm, :max_depth) || 3
41
- rescue StandardError
41
+ rescue StandardError => _e
42
42
  3
43
43
  end
44
44
 
45
45
  def max_concurrent
46
46
  Legion::Settings.dig(:swarm, :max_concurrent) || 20
47
- rescue StandardError
47
+ rescue StandardError => _e
48
48
  20
49
49
  end
50
50
 
51
51
  def max_per_parent
52
52
  Legion::Settings.dig(:swarm, :max_per_parent) || 10
53
- rescue StandardError
53
+ rescue StandardError => _e
54
54
  10
55
55
  end
56
56
 
@@ -61,7 +61,7 @@ module Legion
61
61
  .exclude(parent_id: nil)
62
62
  .exclude(status: %w[complete failed])
63
63
  .count
64
- rescue StandardError
64
+ rescue StandardError => _e
65
65
  0
66
66
  end
67
67
 
@@ -72,7 +72,7 @@ module Legion
72
72
  .where(parent_id: parent_task_id)
73
73
  .exclude(status: %w[complete failed])
74
74
  .count
75
- rescue StandardError
75
+ rescue StandardError => _e
76
76
  0
77
77
  end
78
78
  end
@@ -8,13 +8,13 @@ module Legion
8
8
  module Swarm
9
9
  module Helpers
10
10
  class WorkspaceSync
11
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
12
- Legion::Extensions::Helpers.const_defined?(:Lex)
11
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
12
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
13
13
 
14
14
  ROUTING_PREFIX = 'swarm.workspace'
15
15
 
16
- def publish_change(charter_id:, key:, operation:, value: nil, author: nil, version: nil, **) # rubocop:disable Metrics/ParameterLists
17
- return { success: true, skipped: :no_transport } unless defined?(Legion::Transport)
16
+ def publish_change(charter_id:, key:, operation:, value: nil, author: nil, version: nil, **)
17
+ return { success: true, skipped: :no_transport } unless Legion.const_defined?(:Transport, false)
18
18
 
19
19
  routing_key = "#{ROUTING_PREFIX}.#{charter_id}"
20
20
  payload = { charter_id: charter_id, key: key, value: value,
@@ -29,7 +29,7 @@ module Legion
29
29
  { success: true, skipped: :publish_error, message: e.message }
30
30
  end
31
31
 
32
- def apply_incoming(charter_id:, key:, operation:, value: nil, author: nil, version: nil, timestamp: nil, **) # rubocop:disable Metrics/ParameterLists
32
+ def apply_incoming(charter_id:, key:, operation:, value: nil, author: nil, version: nil, timestamp: nil, **)
33
33
  op = operation.to_s
34
34
  case op
35
35
  when 'put'
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module Swarm
6
6
  module Runners
7
- module SpawnChild
7
+ module SpawnChild # rubocop:disable Legion/Extension/RunnerIncludeHelpers
8
8
  include Helpers::SubAgent if defined?(Helpers::SubAgent)
9
9
 
10
10
  def spawn_child(runner:, function:, payload:, parent_task_id:, **)
@@ -5,10 +5,10 @@ module Legion
5
5
  module Swarm
6
6
  module Runners
7
7
  module Swarm
8
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
9
- Legion::Extensions::Helpers.const_defined?(:Lex)
8
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
9
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
10
10
 
11
- def create_swarm(name:, objective:, roles: [], max_agents: 10, timeout: 3600, **) # rubocop:disable Metrics/ParameterLists
11
+ def create_swarm(name:, objective:, roles: [], max_agents: 10, timeout: 3600, **)
12
12
  charter = Helpers::Charter.new_charter(name: name, objective: objective,
13
13
  roles: roles, max_agents: max_agents, timeout: timeout)
14
14
  id = swarm_store.create(charter)
@@ -7,8 +7,8 @@ module Legion
7
7
  module Swarm
8
8
  module Runners
9
9
  module Workspace
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def workspace_put(charter_id:, key:, value:, author:, **)
14
14
  entry = workspace.put(charter_id, key: key, value: value, author: author)
@@ -3,7 +3,7 @@
3
3
  module Legion
4
4
  module Extensions
5
5
  module Swarm
6
- VERSION = '0.2.3'
6
+ VERSION = '0.2.4'
7
7
  end
8
8
  end
9
9
  end
@@ -12,7 +12,7 @@ require 'legion/extensions/swarm/runners/workspace'
12
12
  module Legion
13
13
  module Extensions
14
14
  module Swarm
15
- extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core
15
+ extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core, false
16
16
  end
17
17
  end
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-swarm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity