Class: RailsAiBridge::Registry::PackResolver
- Inherits:
-
Object
- Object
- RailsAiBridge::Registry::PackResolver
- Defined in:
- lib/rails_ai_bridge/registry/pack_resolver.rb
Overview
Service object responsible for resolving and loading skill packs and registries.
Orchestrates the loading of packs from the registry manifest, handling framework auto-detection, explicit pack selection, and local registry overrides. Returns a Resolver instance with all packs loaded and prioritized.
Constant Summary collapse
- RAILS_PACK =
Pack name constants
'rails'- HANAMI_PACK =
'hanami'- CORE_PACK =
'core'- PRIORITY_HIGH =
Priority constants (lower is higher priority)
10- PRIORITY_MEDIUM =
20- PRIORITY_LOW =
30- MAX_DEPENDENCY_DEPTH =
Cap for transitive dependency expansion to prevent runaway iteration on pathological manifests.
10
Instance Method Summary collapse
-
#initialize(source_resolver, pack_detector = PackDetector, lockfile = nil) ⇒ PackResolver
constructor
Creates a new PackResolverService with a reference to a SkillSourceResolver.
-
#resolve(manifest, explicit_packs = nil, local_registries = nil) ⇒ Resolver
Resolves active packs from the manifest and custom configuration.
Constructor Details
#initialize(source_resolver, pack_detector = PackDetector, lockfile = nil) ⇒ PackResolver
Creates a new PackResolverService with a reference to a SkillSourceResolver.
30 31 32 33 34 |
# File 'lib/rails_ai_bridge/registry/pack_resolver.rb', line 30 def initialize(source_resolver, pack_detector = PackDetector, lockfile = nil) @source_resolver = source_resolver @pack_detector = pack_detector @lockfile = lockfile || default_lockfile end |
Instance Method Details
#resolve(manifest, explicit_packs = nil, local_registries = nil) ⇒ Resolver
Resolves active packs from the manifest and custom configuration.
This will automatically resolve remote repositories if needed, load the tile manifest configurations, merge local directory overrides, and verify pack commit SHAs against the configured lockfile.
:reek:TooManyStatements -- Necessary complexity for pack loading logic
47 48 49 50 51 52 53 |
# File 'lib/rails_ai_bridge/registry/pack_resolver.rb', line 47 def resolve(manifest, explicit_packs = nil, local_registries = nil) active_pack_names = gather_active_packs(manifest, explicit_packs) loaded_packs = load_defined_packs(manifest, active_pack_names) load_local_registries(loaded_packs, local_registries) Resolver.new(loaded_packs) end |