Class: RosettAi::ContentPacks::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/rosett_ai/content_packs/manager.rb

Overview

MCP-facing facade for content pack operations.

Delegates to RosettAi::Content::PackRegistry and RosettAi::Content::PackInstaller for the actual content pack logic, providing the simplified interface expected by Mcp::Tools::ContentTool.

Author:

  • hugo

  • claude

Instance Method Summary collapse

Constructor Details

#initializeManager

Returns a new instance of Manager.



17
18
19
20
# File 'lib/rosett_ai/content_packs/manager.rb', line 17

def initialize
  @registry = Content::PackRegistry
  @installer = Content::PackInstaller.new
end

Instance Method Details

#install(pack_name) ⇒ Boolean

Installs a content pack by name.

Parameters:

  • pack_name (String)

    name of the pack to install

Returns:

  • (Boolean)

    true on success



35
36
37
38
# File 'lib/rosett_ai/content_packs/manager.rb', line 35

def install(pack_name)
  @installer.install(pack_name)
  pack_name
end

#listArray<Hash>

Lists installed content packs.

Returns:

  • (Array<Hash>)

    installed packs with :name and :version



25
26
27
28
29
# File 'lib/rosett_ai/content_packs/manager.rb', line 25

def list
  @registry.installed.map do |pack|
    { name: pack.name, version: pack.version }
  end
end

#update_allArray<String>

Updates all installed content packs.

Returns:

  • (Array<String>)

    names of updated packs



43
44
45
46
47
# File 'lib/rosett_ai/content_packs/manager.rb', line 43

def update_all
  @registry.installed.filter_map do |pack|
    @installer.update(pack.name) ? pack.name : nil
  end
end