Class: RailsAiBridge::Config::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_ai_bridge/config/registry.rb

Overview

Holds registry resolution configuration for skill packs.

Controls how the bridge resolves and loads skill packs from git repositories, including cache location, manifest path, explicit pack selection, and local registry overrides.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRegistry

Returns a new instance of Registry.



88
89
90
91
92
93
94
95
96
# File 'lib/rails_ai_bridge/config/registry.rb', line 88

def initialize
  @registry_manifest_path = 'config/rails_ai_bridge_registry.json'
  @skill_cache_dir = File.expand_path('~/.rails-ai-bridge/cache')
  @skill_packs = nil
  @local_registry_paths = []
  @resolver_ttl = 1800
  @git_pull_ttl = 86_400
  @git_timeout = 30
end

Instance Attribute Details

#git_pull_ttlInteger

Returns TTL in seconds between git pull refreshes per cached pack (default: 86400 = 24 h). Set to 0 to pull on every resolver rebuild. Skill pack files are documentation and rarely change between releases, so a long freshness window is appropriate.

Returns:

  • (Integer)

    TTL in seconds between git pull refreshes per cached pack (default: 86400 = 24 h). Set to 0 to pull on every resolver rebuild. Skill pack files are documentation and rarely change between releases, so a long freshness window is appropriate.



32
33
34
# File 'lib/rails_ai_bridge/config/registry.rb', line 32

def git_pull_ttl
  @git_pull_ttl
end

#git_timeoutInteger

Returns timeout in seconds for individual git operations (clone, pull, checkout). Prevents a slow or unreachable remote from blocking the calling thread indefinitely.

Returns:

  • (Integer)

    timeout in seconds for individual git operations (clone, pull, checkout). Prevents a slow or unreachable remote from blocking the calling thread indefinitely.



36
37
38
# File 'lib/rails_ai_bridge/config/registry.rb', line 36

def git_timeout
  @git_timeout
end

#local_registry_pathsArray<String>

Returns local registry directory paths.

Returns:

  • (Array<String>)

    local registry directory paths



24
25
26
# File 'lib/rails_ai_bridge/config/registry.rb', line 24

def local_registry_paths
  @local_registry_paths
end

#registry_manifest_pathString

Returns path to the registry manifest JSON file.

Returns:

  • (String)

    path to the registry manifest JSON file



15
16
17
# File 'lib/rails_ai_bridge/config/registry.rb', line 15

def registry_manifest_path
  @registry_manifest_path
end

#resolver_ttlInteger

Returns TTL in seconds for the in-memory resolver cache (default: 1800 = 30 min).

Returns:

  • (Integer)

    TTL in seconds for the in-memory resolver cache (default: 1800 = 30 min)



27
28
29
# File 'lib/rails_ai_bridge/config/registry.rb', line 27

def resolver_ttl
  @resolver_ttl
end

#skill_cache_dirString

Returns directory for caching git repositories.

Returns:

  • (String)

    directory for caching git repositories



18
19
20
# File 'lib/rails_ai_bridge/config/registry.rb', line 18

def skill_cache_dir
  @skill_cache_dir
end

#skill_packsArray<String>?

Returns explicit pack names to load, or nil for auto-detection.

Returns:

  • (Array<String>, nil)

    explicit pack names to load, or nil for auto-detection



21
22
23
# File 'lib/rails_ai_bridge/config/registry.rb', line 21

def skill_packs
  @skill_packs
end