Class: RosettAi::DBus::ManagerInterface

Inherits:
DBus::Object
  • Object
show all
Defined in:
lib/rosett_ai/dbus/manager_interface.rb

Overview

D-Bus interface for Rosett-AI management operations.

Interface: be.neatnerds.rosettai.Manager Methods: Compile(engine: s) -> s Run compilation for specified engine SwitchContext(name: s) Switch to named context GetStatus() -> asv Return service status dictionary Properties: Version: s (read) Service version string Signals: ContextChanged(name: s) Emitted after context switch

Security:

  • Rate limiting (10 req/s, burst 20) prevents DoS via rapid method calls
  • Compile operations have stricter limits (2 req/s, burst 5)

Constant Summary collapse

INTERFACE =
'be.neatnerds.rosettai.Manager'
RATE_LIMITS =

Rate limit configurations per operation type

{
  default: { rate: 10, burst: 20 },
  compile: { rate: 2, burst: 5 },     # Compile is expensive
  config: { rate: 5, burst: 10 }      # Config changes need moderation
}.freeze
SETCONFIG_ALLOWED_KEYS =

Keys allowed via D-Bus SetConfig — prevents arbitrary config mutation

[
  'default_engine',
  'cache.enabled',
  'cache.ttl_hours',
  'detect.on_init'
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ ManagerInterface

Returns a new instance of ManagerInterface.



75
76
77
78
79
80
# File 'lib/rosett_ai/dbus/manager_interface.rb', line 75

def initialize(path)
  super
  @current_context = 'default'
  @service = nil
  @rate_limiters = build_rate_limiters
end

Instance Attribute Details

#service=(value) ⇒ Object (writeonly)

Sets the attribute service

Parameters:

  • value

    the value to set the attribute service to.



73
74
75
# File 'lib/rosett_ai/dbus/manager_interface.rb', line 73

def service=(value)
  @service = value
end

Instance Method Details

#versionString

Version property

Returns:

  • (String)


85
86
87
# File 'lib/rosett_ai/dbus/manager_interface.rb', line 85

def version
  RosettAi::VERSION
end