Class: RailsAiBridge::Config::Registry
- Inherits:
-
Object
- Object
- RailsAiBridge::Config::Registry
- 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
-
#git_pull_ttl ⇒ Integer
TTL in seconds between git pull refreshes per cached pack (default: 86400 = 24 h).
-
#git_timeout ⇒ Integer
Timeout in seconds for individual git operations (clone, pull, checkout).
-
#local_registry_paths ⇒ Array<String>
Local registry directory paths.
-
#lockfile_path ⇒ String?
Path to the skill pack lockfile.
-
#lockfile_verification ⇒ Symbol
How to behave when the lockfile differs from the resolved pack: :strict (default) raises, :warn logs but proceeds, :disabled skips verification.
-
#registry_manifest_path ⇒ String
Path to the registry manifest JSON file.
-
#resolver_ttl ⇒ Integer
TTL in seconds for the in-memory resolver cache (default: 1800 = 30 min).
-
#skill_cache_dir ⇒ String
Directory for caching git repositories.
-
#skill_packs ⇒ Array<String>?
Explicit pack names to load, or nil for auto-detection.
Instance Method Summary collapse
-
#initialize ⇒ Registry
constructor
A new instance of Registry.
Constructor Details
#initialize ⇒ Registry
Returns a new instance of Registry.
95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/rails_ai_bridge/config/registry.rb', line 95 def initialize @registry_manifest_path = 'config/rails_ai_bridge_registry.json' @skill_cache_dir = File.('~/.rails-ai-bridge/cache') @skill_packs = nil @local_registry_paths = [] @resolver_ttl = 1800 @git_pull_ttl = 86_400 @git_timeout = 30 @lockfile_path = 'config/rails_ai_bridge/directory.lock' @lockfile_verification = :strict end |
Instance Attribute Details
#git_pull_ttl ⇒ Integer
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.
32 33 34 |
# File 'lib/rails_ai_bridge/config/registry.rb', line 32 def git_pull_ttl @git_pull_ttl end |
#git_timeout ⇒ Integer
Returns 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_paths ⇒ Array<String>
Returns 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 |
#lockfile_path ⇒ String?
Returns path to the skill pack lockfile. nil disables lockfile verification.
39 40 41 |
# File 'lib/rails_ai_bridge/config/registry.rb', line 39 def lockfile_path @lockfile_path end |
#lockfile_verification ⇒ Symbol
Returns how to behave when the lockfile differs from the resolved pack: :strict (default) raises, :warn logs but proceeds, :disabled skips verification.
43 44 45 |
# File 'lib/rails_ai_bridge/config/registry.rb', line 43 def lockfile_verification @lockfile_verification end |
#registry_manifest_path ⇒ String
Returns 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_ttl ⇒ Integer
Returns 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_dir ⇒ String
Returns 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_packs ⇒ Array<String>?
Returns 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 |