fantasy-cli 1.3.2 → 1.3.3

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: d50c057f1c718f87a95d0039b8c6c5611b7232d397dfdda26ec32f1d78c4f1dc
4
- data.tar.gz: 288ccadabe6cd548c991330e8eb96ca733684c0db0da0e249be7d4c576764e68
3
+ metadata.gz: 713dd66e7c9499f94b13e306302de6b1799662cb9b71531f99ee38b540b10046
4
+ data.tar.gz: a0075483f425f78d9db66b6ffd9586598b98a728e1093ff441a77d3312c2df4c
5
5
  SHA512:
6
- metadata.gz: 16d260f95d313aa0bfb240efae0cbfefe3c7b7af639a140a11128bb267b55df4e19402d8b5138afcebfe3a83ed04424530fd241629c2b066f2c460e88e64c925
7
- data.tar.gz: 0da3b54b324b6f42e90b7ded20dca029fe8c447c8510996b191ae55608c4d9dc71e0192027fd91080ea0a9111e5ee5e07bd2673e569a4a85266a6cbcce5ac93a
6
+ metadata.gz: 9ffd683d0986248732f1779c7b1f6bb05b99e779b797b62a71278ef12aefdb97210604fc848bf629f3c0d4890ab9013e9402d57c34ecd3d26b1452357d6f2fa6
7
+ data.tar.gz: e2d048e0428f41990442d35900710a4f250f92120e95b3a3b1558bc252138441c470d2f19c80c7296d1f06b0e6d74abe2a762c8178dc87eb7f59d3f363058182
data/lib/gsd/ai/cli.rb CHANGED
@@ -159,7 +159,7 @@ module Gsd
159
159
  puts "DEBUG: ChatTUI finished" if @options[:debug]
160
160
  rescue => e
161
161
  puts "❌ Erro na TUI: #{e.message}"
162
- puts e.backtrace.first(5).join("\n") if @options[:debug]
162
+ puts e.backtrace.first(10).join("\n") if @options[:debug]
163
163
  end
164
164
 
165
165
  # Imprime ajuda
data/lib/gsd/tui/app.rb CHANGED
@@ -75,7 +75,7 @@ module Gsd
75
75
 
76
76
  # Initialize Plugin System (v1.3.0)
77
77
  @plugin_registry = Gsd::Plugins::Registry.instance
78
- @plugin_loader = Gsd::Plugins::Loader.new(registry: @plugin_registry)
78
+ @plugin_loader = Gsd::Plugins::Loader.new
79
79
  @plugin_hooks = Gsd::Plugins::Hooks.instance
80
80
  @hot_reload = Gsd::Plugins::HotReload.new(registry: @plugin_registry, loader: @plugin_loader)
81
81
  setup_plugin_system
@@ -680,36 +680,37 @@ module Gsd
680
680
 
681
681
  # Setup observers for swarm events
682
682
  def setup_swarm_observers
683
- @swarm.add_observer do |event, *args|
684
- case event
685
- when :agent_spawned
686
- agent_id, type = args
687
- add_message(:system, "🚀 Agent #{type} spawned (#{agent_id[0..12]})")
688
- when :agent_terminated
689
- agent_id = args.first
690
- add_message(:system, "💀 Agent terminated (#{agent_id[0..12]})")
691
- when :agent_crashed
692
- agent_id = args.first
693
- add_message(:error, "💥 Agent crashed (#{agent_id[0..12]})")
694
- when :agent_restarted
695
- agent_id = args.first
696
- add_message(:system, "🔄 Agent restarted (#{agent_id[0..12]})")
697
- when :task_completed
698
- agent_id, task = args
699
- add_message(:system, "✅ Task completed by #{agent_id[0..12]}")
700
- when :task_queued
701
- task = args.first
702
- add_message(:system, "📋 Task queued: #{task[:type]}")
703
- end
683
+ observer = SwarmObserver.new(self)
684
+ @swarm.add_observer(observer)
685
+ end
686
+
687
+ # Handle swarm events
688
+ def handle_swarm_event(event, *args)
689
+ case event
690
+ when :agent_spawned
691
+ agent_id, type = args
692
+ add_message(:system, "🚀 Agent #{type} spawned (#{agent_id[0..12]})")
693
+ when :agent_terminated
694
+ agent_id = args.first
695
+ add_message(:system, "💀 Agent terminated (#{agent_id[0..12]})")
696
+ when :agent_crashed
697
+ agent_id = args.first
698
+ add_message(:error, "💥 Agent crashed (#{agent_id[0..12]})")
699
+ when :agent_restarted
700
+ agent_id = args.first
701
+ add_message(:system, "🔄 Agent restarted (#{agent_id[0..12]})")
702
+ when :task_completed
703
+ agent_id, task = args
704
+ add_message(:system, "✅ Task completed by #{agent_id[0..12]}")
705
+ when :task_queued
706
+ task = args.first
707
+ add_message(:system, "📋 Task queued: #{task[:type]}")
704
708
  end
705
709
  end
706
710
 
707
711
  # Plugin System setup
708
712
  def setup_plugin_system
709
- # Load all discovered plugins
710
- @plugin_loader.load_all
711
-
712
- # Enable all loaded plugins
713
+ # Enable all registered plugins
713
714
  @plugin_registry.all.each do |plugin|
714
715
  begin
715
716
  plugin.enable!
@@ -886,3 +887,14 @@ module Gsd
886
887
  end
887
888
  end
888
889
  end
890
+
891
+ # Observer pattern for Swarm events
892
+ class SwarmObserver
893
+ def initialize(app)
894
+ @app = app
895
+ end
896
+
897
+ def update(event, *args)
898
+ @app.handle_swarm_event(event, *args)
899
+ end
900
+ end
data/lib/gsd/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gsd
4
- VERSION = '1.3.2'
4
+ VERSION = '1.3.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fantasy-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fantasy Team