Class: SwarmMemory::Integration::Registration

Inherits:
Object
  • Object
show all
Defined in:
lib/swarm_memory/integration/registration.rb

Overview

Auto-registration with SwarmSDK

Registers SwarmMemory plugin with SwarmSDK when the swarm_memory gem is loaded. This enables SwarmSDK to automatically use SwarmMemory features.

Class Method Summary collapse

Class Method Details

.register!void

This method returns an undefined value.

Register SwarmMemory plugin with SwarmSDK

This is called automatically when swarm_memory is required. It registers the plugin so SwarmSDK can provide memory tools and storage.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/swarm_memory/integration/registration.rb', line 17

def register!
  # Only register if SwarmSDK is present
  return unless defined?(SwarmSDK)
  return unless defined?(SwarmSDK::PluginRegistry)

  # Register plugin with SwarmSDK
  plugin = SDKPlugin.new
  SwarmSDK::PluginRegistry.register(plugin)
rescue StandardError => e
  warn("Warning: Failed to register SwarmMemory plugin with SwarmSDK: #{e.message}")
end