hokipoki 0.2.1 → 0.3.1

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: 0e2215f08a821ad6f9bb2284a287c4c61cae3351aa97f090e725cad83059226a
4
- data.tar.gz: 2741d2b6abc2c978ea1f373e9fb9f539c3b98a7fda62247554526b98c5ff5c79
3
+ metadata.gz: 963e9ced91ccd0a7da323a7994f4419f9a2e8b63ab1a16395fc9ca877a191e38
4
+ data.tar.gz: a70f153d959e357f6ee3f83578f42c009ae95ac5ac42bddc62d0fde5590ad293
5
5
  SHA512:
6
- metadata.gz: 224eaebd899dcee16735b9aa1d4cbfcef59d41ffb78dd7b034f233b5d86adf787731669fdb0985f3395a7c9dc7e7ee1f3be2df9774c3252494fc334da5875580
7
- data.tar.gz: 7f60aba74077f85d1bf31d23933444ba75613c1675b09fdb1f1d559ae3344e6417bbeac8c15364e248fd6dab499cc21b434d717e4254f7005e503d9ab35d057c
6
+ metadata.gz: 2db27280fd0fea94764ef414572579e2757f1546021cb8f8d51660c5547496535e7ebc7ebc35eeab58a307279b3208d21601e29e6edee2f3b8f96eabcf681617
7
+ data.tar.gz: d0541e841a526e3457d81764fe28bbcd3dead3111f3910a09916ea32d633cf672d89ad39e934962b96157bc8069777b228ca6862f7642ad6450e8c205b6ca2df
@@ -92,12 +92,11 @@ module HiveMind
92
92
  # Add essential HiveMind gems
93
93
  gem 'pg', '>= 1.0' unless File.read('Gemfile').include?('pg')
94
94
  gem 'neighbor', '>= 0.3' unless File.read('Gemfile').include?('neighbor') # pgvector for Rails
95
- gem 'pgvector', '>= 0.2' unless File.read('Gemfile').include?('pgvector') # Direct pgvector support
96
95
  gem 'redis', '>= 4.0' unless File.read('Gemfile').include?('redis')
97
96
  gem 'ruby-openai', '>= 6.0' unless File.read('Gemfile').include?('ruby-openai') # For LLM integration
98
97
  gem 'faraday', '>= 2.0' unless File.read('Gemfile').include?('faraday') # HTTP client for LLM APIs
99
98
 
100
- say @pastel.green("✓ Added pg, neighbor, pgvector, redis, ruby-openai, faraday to Gemfile")
99
+ say @pastel.green("✓ Added pg, neighbor, redis, ruby-openai, faraday to Gemfile")
101
100
  end
102
101
 
103
102
  def create_configuration_files
@@ -244,7 +243,7 @@ module HiveMind
244
243
  say " facts = Hokipoki.retrieve_facts('your query here')"
245
244
 
246
245
  say "\n#{@pastel.blue.bold('📁 Files Created:')}"
247
- say " - Gemfile (gems added: pg, neighbor, pgvector, redis, ruby-openai, faraday)"
246
+ say " - Gemfile (gems added: pg, neighbor, redis, ruby-openai, faraday)"
248
247
  say " - config/initializers/hokipoki.rb"
249
248
  say " - app/models/hive_mind_document.rb"
250
249
  say " - db/migrate/create_hive_mind_documents.rb"
@@ -464,6 +463,7 @@ module HiveMind
464
463
  say " 2. #{@pastel.cyan('Check status:')} ./bin/claude_status"
465
464
  say " 3. #{@pastel.cyan('Test integration:')} Ask Claude any coding question"
466
465
  end
466
+ end
467
467
 
468
468
  def setup_minimal_installation
469
469
  say @pastel.cyan("\n🎯 Setting up minimal HiveMind installation...")
@@ -801,4 +801,4 @@ module HiveMind
801
801
  ActiveRecord::Generators::Base.next_migration_number(dirname)
802
802
  end
803
803
  end
804
- end
804
+ end
@@ -3,17 +3,27 @@
3
3
  module Hokipoki
4
4
  class Configuration
5
5
  attr_accessor :hive_mind_enabled,
6
- :claude_parasite_enabled
6
+ :claude_parasite_enabled,
7
+ :redis_url
7
8
 
8
9
  def initialize
9
10
  # Simple configuration for lightweight HiveMind
10
11
  @hive_mind_enabled = false # Will be true after installation
11
12
  @claude_parasite_enabled = true
13
+ @redis_url = ENV.fetch('REDIS_URL', 'redis://localhost:6379/0')
12
14
  end
13
15
 
14
16
  def validate!
15
17
  # Simple validation - just check that basic settings are reasonable
16
18
  true
17
19
  end
20
+
21
+ def redis_config
22
+ {
23
+ url: redis_url,
24
+ timeout: 5,
25
+ reconnect_attempts: 3
26
+ }
27
+ end
18
28
  end
19
29
  end
@@ -9,114 +9,17 @@ module Hokipoki
9
9
  g.fixture_replacement :factory_bot
10
10
  end
11
11
 
12
- # Auto-load paths
13
- config.autoload_paths += Dir[root.join('app', 'models', 'hokipoki')]
14
- config.autoload_paths += Dir[root.join('app', 'services', 'hokipoki')]
15
- config.autoload_paths += Dir[root.join('app', 'controllers', 'hokipoki')]
16
- config.autoload_paths += Dir[root.join('app', 'jobs', 'hokipoki')]
17
-
18
- # Assets
19
- config.assets.precompile += %w[hokipoki/dashboard.css hokipoki/workshop.css]
20
- config.assets.precompile += %w[hokipoki/dashboard.js hokipoki/parasite_optimizer_controller.js hokipoki/template_manager_controller.js]
21
-
22
12
  initializer "hokipoki.initialize" do |app|
23
13
  # Initialize Hokipoki configuration
24
14
  Hokipoki.configure unless Hokipoki.configuration
25
15
 
26
- # Validate configuration in non-test environments
27
- unless Rails.env.test?
28
- begin
29
- Hokipoki.config.validate!
30
- rescue Hokipoki::ConfigurationError => e
31
- Rails.logger.error "❌ Hokipoki configuration error: #{e.message}"
32
- raise e if Rails.env.production?
33
- end
34
- end
35
-
36
- # Set up Redis connection
37
- if Hokipoki.config.redis_url.present?
38
- begin
39
- $redis ||= Redis.new(Hokipoki.config.redis_config)
40
- Rails.logger.info "🔗 Hokipoki: Redis connected at #{Hokipoki.config.redis_url}"
41
- rescue => e
42
- Rails.logger.error "❌ Hokipoki: Redis connection failed: #{e.message}"
43
- end
44
- end
45
-
46
- # Initialize core services
47
- Rails.application.config.after_initialize do
48
- if Hokipoki.config.enable_parasites
49
- begin
50
- Hokipoki::Parasites::UniversalGenerator.instance
51
- Rails.logger.info "🦠 Hokipoki: Universal Parasite Generator initialized"
52
- rescue => e
53
- Rails.logger.error "❌ Hokipoki: Parasite system initialization failed: #{e.message}"
54
- end
55
- end
56
-
57
- if Hokipoki.config.enable_template_optimization
58
- begin
59
- Hokipoki::Intelligence::UnifiedOrchestrator.instance
60
- Rails.logger.info "🧠 Hokipoki: Unified Intelligence Orchestrator initialized"
61
- rescue => e
62
- Rails.logger.error "❌ Hokipoki: Intelligence system initialization failed: #{e.message}"
63
- end
64
- end
65
-
66
- if Hokipoki.config.enable_forge
67
- begin
68
- require 'hokipoki/forge/generator_forge'
69
- Rails.logger.info "🏭 Hokipoki: Generator Forge initialized"
70
- rescue LoadError => e
71
- Rails.logger.warn "⚠️ Hokipoki: Forge components not available: #{e.message}"
72
- rescue => e
73
- Rails.logger.error "❌ Hokipoki: Forge initialization failed: #{e.message}"
74
- end
75
- end
76
-
77
- # Initialize security audit service
78
- if Hokipoki.config.audit_logging
79
- begin
80
- Hokipoki::Security::AuditService.instance
81
- Rails.logger.info "🔒 Hokipoki: Security Audit Service initialized"
82
- rescue => e
83
- Rails.logger.error "❌ Hokipoki: Security service initialization failed: #{e.message}"
84
- end
85
- end
86
-
87
- Rails.logger.info "✅ Hokipoki Engine initialized successfully (v#{Hokipoki::VERSION})"
88
- end
89
- end
90
-
91
- # Add middleware for API authentication
92
- initializer "hokipoki.middleware" do |app|
93
- if Hokipoki.config.api_authentication
94
- require 'hokipoki/security/api_authentication'
95
- app.middleware.use Hokipoki::Security::ApiAuthentication
96
- end
97
- end
98
-
99
- # Configure Sidekiq for background processing
100
- initializer "hokipoki.sidekiq" do |app|
101
- if defined?(Sidekiq) && Hokipoki.config.background_processing == :sidekiq
102
- Sidekiq.configure_server do |config|
103
- config.redis = Hokipoki.config.redis_config
104
- end
16
+ # Simple validation
17
+ Hokipoki.config.validate!
105
18
 
106
- Sidekiq.configure_client do |config|
107
- config.redis = Hokipoki.config.redis_config
108
- end
109
-
110
- Rails.logger.info "⚙️ Hokipoki: Sidekiq configured for background processing"
111
- end
112
- end
113
-
114
- # Add custom rake tasks
115
- rake_tasks do
116
- load 'tasks/hokipoki.rake'
19
+ # Component status logging
20
+ Rails.logger.info "🚀 Hokipoki #{Hokipoki::VERSION} initialized (lightweight mode)"
21
+ Rails.logger.info " HiveMind: #{Hokipoki.config.hive_mind_enabled ? '✅' : '❌'}"
22
+ Rails.logger.info " Claude Parasite: #{Hokipoki.config.claude_parasite_enabled ? '✅' : '❌'}"
117
23
  end
118
-
119
- # Generator paths
120
- config.generators.templates.unshift File.expand_path('generators/templates', __dir__)
121
24
  end
122
25
  end
@@ -0,0 +1,122 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hokipoki
4
+ class Engine < ::Rails::Engine
5
+ isolate_namespace Hokipoki
6
+
7
+ config.generators do |g|
8
+ g.test_framework :rspec
9
+ g.fixture_replacement :factory_bot
10
+ end
11
+
12
+ # Auto-load paths
13
+ config.autoload_paths += Dir[root.join('app', 'models', 'hokipoki')]
14
+ config.autoload_paths += Dir[root.join('app', 'services', 'hokipoki')]
15
+ config.autoload_paths += Dir[root.join('app', 'controllers', 'hokipoki')]
16
+ config.autoload_paths += Dir[root.join('app', 'jobs', 'hokipoki')]
17
+
18
+ # Assets
19
+ config.assets.precompile += %w[hokipoki/dashboard.css hokipoki/workshop.css]
20
+ config.assets.precompile += %w[hokipoki/dashboard.js hokipoki/parasite_optimizer_controller.js hokipoki/template_manager_controller.js]
21
+
22
+ initializer "hokipoki.initialize" do |app|
23
+ # Initialize Hokipoki configuration
24
+ Hokipoki.configure unless Hokipoki.configuration
25
+
26
+ # Validate configuration in non-test environments
27
+ unless Rails.env.test?
28
+ begin
29
+ Hokipoki.config.validate!
30
+ rescue Hokipoki::ConfigurationError => e
31
+ Rails.logger.error "❌ Hokipoki configuration error: #{e.message}"
32
+ raise e if Rails.env.production?
33
+ end
34
+ end
35
+
36
+ # Set up Redis connection
37
+ if Hokipoki.config.redis_url.present?
38
+ begin
39
+ $redis ||= Redis.new(Hokipoki.config.redis_config)
40
+ Rails.logger.info "🔗 Hokipoki: Redis connected at #{Hokipoki.config.redis_url}"
41
+ rescue => e
42
+ Rails.logger.error "❌ Hokipoki: Redis connection failed: #{e.message}"
43
+ end
44
+ end
45
+
46
+ # Initialize core services
47
+ Rails.application.config.after_initialize do
48
+ if Hokipoki.config.enable_parasites
49
+ begin
50
+ Hokipoki::Parasites::UniversalGenerator.instance
51
+ Rails.logger.info "🦠 Hokipoki: Universal Parasite Generator initialized"
52
+ rescue => e
53
+ Rails.logger.error "❌ Hokipoki: Parasite system initialization failed: #{e.message}"
54
+ end
55
+ end
56
+
57
+ if Hokipoki.config.enable_template_optimization
58
+ begin
59
+ Hokipoki::Intelligence::UnifiedOrchestrator.instance
60
+ Rails.logger.info "🧠 Hokipoki: Unified Intelligence Orchestrator initialized"
61
+ rescue => e
62
+ Rails.logger.error "❌ Hokipoki: Intelligence system initialization failed: #{e.message}"
63
+ end
64
+ end
65
+
66
+ if Hokipoki.config.enable_forge
67
+ begin
68
+ require 'hokipoki/forge/generator_forge'
69
+ Rails.logger.info "🏭 Hokipoki: Generator Forge initialized"
70
+ rescue LoadError => e
71
+ Rails.logger.warn "⚠️ Hokipoki: Forge components not available: #{e.message}"
72
+ rescue => e
73
+ Rails.logger.error "❌ Hokipoki: Forge initialization failed: #{e.message}"
74
+ end
75
+ end
76
+
77
+ # Initialize security audit service
78
+ if Hokipoki.config.audit_logging
79
+ begin
80
+ Hokipoki::Security::AuditService.instance
81
+ Rails.logger.info "🔒 Hokipoki: Security Audit Service initialized"
82
+ rescue => e
83
+ Rails.logger.error "❌ Hokipoki: Security service initialization failed: #{e.message}"
84
+ end
85
+ end
86
+
87
+ Rails.logger.info "✅ Hokipoki Engine initialized successfully (v#{Hokipoki::VERSION})"
88
+ end
89
+ end
90
+
91
+ # Add middleware for API authentication
92
+ initializer "hokipoki.middleware" do |app|
93
+ if Hokipoki.config.api_authentication
94
+ require 'hokipoki/security/api_authentication'
95
+ app.middleware.use Hokipoki::Security::ApiAuthentication
96
+ end
97
+ end
98
+
99
+ # Configure Sidekiq for background processing
100
+ initializer "hokipoki.sidekiq" do |app|
101
+ if defined?(Sidekiq) && Hokipoki.config.background_processing == :sidekiq
102
+ Sidekiq.configure_server do |config|
103
+ config.redis = Hokipoki.config.redis_config
104
+ end
105
+
106
+ Sidekiq.configure_client do |config|
107
+ config.redis = Hokipoki.config.redis_config
108
+ end
109
+
110
+ Rails.logger.info "⚙️ Hokipoki: Sidekiq configured for background processing"
111
+ end
112
+ end
113
+
114
+ # Add custom rake tasks
115
+ rake_tasks do
116
+ load 'tasks/hokipoki.rake'
117
+ end
118
+
119
+ # Generator paths
120
+ config.generators.templates.unshift File.expand_path('generators/templates', __dir__)
121
+ end
122
+ end
@@ -1,7 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'pastel'
4
- require 'tty-spinner'
4
+ begin
5
+ require 'tty-spinner'
6
+ TTY_SPINNER_AVAILABLE = true
7
+ rescue LoadError
8
+ TTY_SPINNER_AVAILABLE = false
9
+ end
5
10
  require_relative 'ascii_banners'
6
11
 
7
12
  module Hokipoki
@@ -258,18 +263,31 @@ module Hokipoki
258
263
  def with_spinner(message, success_message = nil, &block)
259
264
  return yield unless @enabled
260
265
 
261
- spinner = TTY::Spinner.new("[:spinner] #{@pastel.cyan(message)}", format: :dots)
262
- spinner.auto_spin
263
-
264
- begin
265
- result = yield
266
- spinner.stop(@pastel.green('✓'))
267
- puts @pastel.green(success_message) if success_message
268
- result
269
- rescue => e
270
- spinner.stop(@pastel.red('✗'))
271
- puts @pastel.red("❌ <operation failed: #{e.message}>")
272
- raise e
266
+ if TTY_SPINNER_AVAILABLE
267
+ spinner = TTY::Spinner.new("[:spinner] #{@pastel.cyan(message)}", format: :dots)
268
+ spinner.auto_spin
269
+
270
+ begin
271
+ result = yield
272
+ spinner.stop(@pastel.green('✓'))
273
+ puts @pastel.green(success_message) if success_message
274
+ result
275
+ rescue => e
276
+ spinner.stop(@pastel.red('✗'))
277
+ puts @pastel.red("❌ <operation failed: #{e.message}>")
278
+ raise e
279
+ end
280
+ else
281
+ # Fallback without spinner
282
+ puts @pastel.cyan("#{message}...")
283
+ begin
284
+ result = yield
285
+ puts @pastel.green(success_message || '✓ completed')
286
+ result
287
+ rescue => e
288
+ puts @pastel.red("❌ <operation failed: #{e.message}>")
289
+ raise e
290
+ end
273
291
  end
274
292
  end
275
293
 
@@ -10,12 +10,6 @@ module Hokipoki
10
10
 
11
11
  generators do
12
12
  require 'generators/hive_mind/install_generator'
13
- require 'generators/hive_mind/brain_generator'
14
- require 'generators/hive_mind/parasite_generator'
15
- require 'generators/hive_mind/template_generator'
16
- require 'generators/hive_mind/security_generator'
17
- require 'generators/hive_mind/forge_generator'
18
- require 'generators/hive_mind/claude_cli_generator'
19
13
  end
20
14
 
21
15
  initializer "hokipoki.add_locales" do |app|
@@ -1,3 +1,3 @@
1
1
  module Hokipoki
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.1"
3
3
  end
data/lib/hokipoki.rb CHANGED
@@ -25,7 +25,7 @@ module Hokipoki
25
25
  end
26
26
 
27
27
  class << self
28
- attr_accessor :configuration
28
+ attr_accessor :configuration, :logger
29
29
 
30
30
  # Configure Hokipoki
31
31
  def configure
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hokipoki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rails Utilities
@@ -51,6 +51,20 @@ dependencies:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0.23'
54
+ - !ruby/object:Gem::Dependency
55
+ name: tty-spinner
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0.9'
61
+ type: :runtime
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0.9'
54
68
  - !ruby/object:Gem::Dependency
55
69
  name: pastel
56
70
  requirement: !ruby/object:Gem::Requirement
@@ -166,6 +180,7 @@ files:
166
180
  - lib/hokipoki/claude/parasite.rb
167
181
  - lib/hokipoki/configuration.rb
168
182
  - lib/hokipoki/engine.rb
183
+ - lib/hokipoki/engine_complex.rb
169
184
  - lib/hokipoki/feedback/ascii_banners.rb
170
185
  - lib/hokipoki/feedback/display_manager.rb
171
186
  - lib/hokipoki/intelligence/smart_retrieval_engine.rb